-
Notifications
You must be signed in to change notification settings - Fork 105
/
adaptabuild.mak
executable file
·104 lines (79 loc) · 3.43 KB
/
adaptabuild.mak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# ----------------------------------------------------------------------------
# umm_malloc makefile
# (c)2006-2023 by Ralph Hempel, Owen Sound, Canada
#
# This is designed to be included as part of a make system designed
# to be expandable and maintainable using techniques found in:
#
# Managing Projects with GNU Make - Robert Mecklenburg - ISBN 0-596-00610-1
# ----------------------------------------------------------------------------
MODULE := umm_malloc
MODULE_PATH := $(call make_current_module_path)
$(info MODULE_PATH is $(MODULE_PATH))
$(MODULE)_PATH := $(MODULE_PATH)
$(info $(MODULE)_PATH is $($(MODULE)_PATH))
# ----------------------------------------------------------------------------
# Source file lists go here, C dependencies are automatically generated
# by the compiler using the -m option
#
# You can set up a common source path late in the file
#
# Note that each module gets its own, privately scoped variable for building
# ----------------------------------------------------------------------------
# We need both else a previous definition is used :-) Can we make this an include?
SRC_C :=
SRC_ASM :=
SRC_TEST :=
# Here is where we begin to add files to list of sources
SRC_C += src/umm_malloc.c
SRC_TEST += unittest/test_FirstMalloc.c
SRC_TEST += unittest/test_TooBigMalloc.c
SRC_TEST += unittest/test_Free.c
SRC_TEST += unittest/test_Realloc.c
SRC_TEST += unittest/test_MultiMalloc.c
SRC_TEST += unittest/test_Metrics.c
SRC_TEST += unittest/test_Poison.c
SRC_TEST += unittest/test_Stress.c
SRC_TEST += unittest/support_umm_malloc.c
SRC_TEST += unittest/main.c
# ----------------------------------------------------------------------------
# Set up the module level specifics for the source, include, and object paths
$(MODULE)_SRCPATH :=
$(MODULE)_SRCPATH += $(MODULE_PATH)/src
$(MODULE)_INCPATH :=
$(MODULE)_INCPATH += $(umm_libc_PATH)/include
ifeq (unittest,$(MAKECMDGOALS))
$(MODULE)_SRCPATH += $(MODULE_PATH)/unittest
$(MODULE)_INCPATH += $(MODULE_PATH)/src
$(MODULE)_INCPATH += $(MODULE_PATH)/unittest
endif
# ----------------------------------------------------------------------------
# NOTE: The default config file must be created somehow - it is normally
# up to the developer to specify which defines are needed and how they
# are to be configured.
#
# By convention we place config files in product/$(PRODUCT)/config/$(MCU) because
# that's an easy pace to leave things like HAL config, linker scripts etc
$(MODULE)_INCPATH += product/$(PRODUCT)/config/$(MCU)
# ----------------------------------------------------------------------------
# Set any module level compile time defaults here
$(MODULE)_CDEFS :=
$(MODULE)_CDEFS +=
$(MODULE)_CFLAGS :=
$(MODULE)_CFLAGS += -Wno-builtin-declaration-mismatch
ifeq (unittest,$(MAKECMDGOALS))
$(MODULE)_CDEFS +=
endif
# ----------------------------------------------------------------------------
# Include the adaptabuild library makefile - must be done for each module!
include $(ADAPTABUILD_PATH)/make/library.mak
# ----------------------------------------------------------------------------
# Include the unit test framework makefile that works for this module
# if the target is unittest
ifeq (unittest,$(MAKECMDGOALS))
TESTABLE_MODULES += $(MODULE)
$(MODULE)_test_main = $(MODULE)/unittest/main.o
include $(ADAPTABUILD_PATH)/make/test/cpputest.mak
endif
# ----------------------------------------------------------------------------