summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-01-26 18:43:39 +0100
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-01-26 19:15:08 +0100
commit693330a3616e418c4eda90ff5528ef0cbe5fa4cc (patch)
tree2b509c2aa11c1f915a71f54eb2173dc89ba6a29f
parent5d6081e960e007c1224e73e2d1f8f930f39c970d (diff)
Trying to perfect makefiles; making the difference between CPPFLAGS, CFLAGS and ASFLAGS.
-rw-r--r--config/general.mk3
-rw-r--r--config/toolchain.mk3
-rw-r--r--target-rules.mk4
3 files changed, 7 insertions, 3 deletions
diff --git a/config/general.mk b/config/general.mk
index b82dae3..cd50fdc 100644
--- a/config/general.mk
+++ b/config/general.mk
@@ -1,2 +1,5 @@
VERBOSE = false
+
+ifneq ($(VERBOSE),true)
MAKE_OPTS = --no-print-directory -s
+endif
diff --git a/config/toolchain.mk b/config/toolchain.mk
index 21808c8..4e58227 100644
--- a/config/toolchain.mk
+++ b/config/toolchain.mk
@@ -3,7 +3,8 @@ TOOLCHAIN = arm-none-eabi
ifeq ($(CPU_FLAVOR),lpc1768)
TARGET_CPPFLAGS += -mcpu=cortex-m3 -mtune=cortex-m3 -D__thumb2__=1 -march=armv7-m -mfix-cortex-m3-ldrd
endif
-TARGET_CPPFLAGS += -mthumb -Os -mapcs-frame -msoft-float -mno-sched-prolog -fno-hosted -ffunction-sections -fdata-sections -fshort-wchar
+TARGET_CPPFLAGS += -Os -mapcs-frame -msoft-float -mno-sched-prolog -fno-hosted -ffunction-sections -fdata-sections -fshort-wchar
+TARGET_CFLAGS += -mthumb
endif
TARGET_CC = $(TOOLCHAIN)-gcc
diff --git a/target-rules.mk b/target-rules.mk
index 6a608f6..a2bd0fc 100644
--- a/target-rules.mk
+++ b/target-rules.mk
@@ -1,10 +1,10 @@
%.o: %.c
$(E) "[TC] Compiling $<"
- $(Q)$(TARGET_CC) -ffunction-sections -Wall -Werror $(addprefix -I, $(TARGET_INCLUDES)) $(TARGET_CPPFLAGS) -c -o $@ $<
+ $(Q)$(TARGET_CC) -ffunction-sections -Wall -Werror $(addprefix -I, $(TARGET_INCLUDES)) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -c -o $@ $<
%.o: %.s
$(E) "[TS] Compiling $<"
- $(Q)$(TARGET_AS) $(addprefix -I, $(TARGET_INCLUDES)) $(TARGET_CPPFLAGS) -c -o $@ $<
+ $(Q)$(TARGET_AS) $(addprefix -I, $(TARGET_INCLUDES)) $(TARGET_ASFLAGS) $(TARGET_CPPFLAGS) -c -o $@ $<
TARGET_OBJS = $(addsuffix .o, $(basename $(TARGET_SRCS)))