aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 13 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 68f4da3..e349ab1 100644
--- a/Makefile
+++ b/Makefile
@@ -91,13 +91,14 @@ SIZE=$(PREFIX)size
# The Alpha is a development platform, so set GCC optimization to a
# level suitable for debugging. Recent versions of GCC have a special
-# optimization setting -Og for exactly this purpose, so we use it, along
-# with the flag to enable gdb symbols.
+# optimization setting -Og for exactly this purpose, so we use it,
+# along with the flag to enable gdb symbols. Note that some libraries
+# (in particular, libtfm) may need different optimization settings,
+# which is why this needs to remain a separate makefile variable.
#
-# If you really want optimization without debugging support, try -O2 or
-# (maybe) -O3.
+# If you really want optimization without debugging support, try -O2
+# or -O3.
-#STM32_CFLAGS_OPTIMIZATION ?= -O2
STM32_CFLAGS_OPTIMIZATION ?= -ggdb -Og
# whew, that's a lot of cflags
@@ -116,6 +117,9 @@ CFLAGS += -I$(MBED_DIR)/targets/cmsis/TARGET_STM/TARGET_STM32F4
CFLAGS += -I$(MBED_DIR)/targets/cmsis/TARGET_STM/TARGET_STM32F4/$(BOARD)
CFLAGS += -I$(MBED_DIR)/targets/hal/TARGET_STM/TARGET_STM32F4
CFLAGS += -I$(MBED_DIR)/targets/hal/TARGET_STM/TARGET_STM32F4/$(BOARD)
+ifdef DO_TASK_METRICS
+CFLAGS += -DDO_TASK_METRICS
+endif
%.o : %.c
$(CC) $(CFLAGS) -c -o $@ $<
@@ -123,7 +127,11 @@ CFLAGS += -I$(MBED_DIR)/targets/hal/TARGET_STM/TARGET_STM32F4/$(BOARD)
%.o : %.S
$(CC) $(CFLAGS) -c -o $@ $<
+ifdef DO_PROFILING
+all: hsm
+else
all: board-test cli-test libhal-test hsm bootloader
+endif
$(MBED_DIR)/libstmf4.a: .FORCE
$(MAKE) -C $(MBED_DIR)
@@ -151,9 +159,6 @@ libhal-test: $(BOARD_OBJS) $(LIBS) $(LIBHAL_BLD)/libhal.a .FORCE
ifdef DO_PROFILING
CFLAGS += -pg -DDO_PROFILING
-endif
-ifdef DO_TASK_METRICS
-CFLAGS += -DDO_TASK_METRICS
hsm: $(BOARD_OBJS) $(LIBS) $(LIBHAL_BLD)/libhal.a $(LIBCLI_BLD)/libcli.a $(LIBPROF_BLD)/libprof.a .FORCE
$(MAKE) -C projects/hsm
else