aboutsummaryrefslogtreecommitdiffstats
path: root/demos/ARM7-LPC214x-GCC/Makefile.thumb
diff options
context:
space:
mode:
Diffstat (limited to 'demos/ARM7-LPC214x-GCC/Makefile.thumb')
-rw-r--r--demos/ARM7-LPC214x-GCC/Makefile.thumb24
1 files changed, 17 insertions, 7 deletions
diff --git a/demos/ARM7-LPC214x-GCC/Makefile.thumb b/demos/ARM7-LPC214x-GCC/Makefile.thumb
index 8c6147f15..05a63460d 100644
--- a/demos/ARM7-LPC214x-GCC/Makefile.thumb
+++ b/demos/ARM7-LPC214x-GCC/Makefile.thumb
@@ -62,12 +62,13 @@ UDEFS =
UADEFS =
# List ARM-mode C source files here
-ASRC = chcore.c
+ASRC =
# List THUMB-mode C sources here
# NOTE: If any module is compiled in thumb mode then -mthumb-interwork is
# enabled for all modules and that lowers performance.
-TSRC = ../../src/chinit.c ../../src/chdebug.c ../../src/chlists.c ../../src/chdelta.c \
+TSRC = chcore.c \
+ ../../src/chinit.c ../../src/chdebug.c ../../src/chlists.c ../../src/chdelta.c \
../../src/chschd.c ../../src/chthreads.c ../../src/chsem.c ../../src/chevents.c \
../../src/chmsg.c ../../src/chsleep.c ../../src/chqueues.c ../../src/chserial.c \
../../ports/ARM7-LPC214x/GCC/vic.c ../../ports/ARM7-LPC214x/GCC/lpc214x_serial.c \
@@ -91,14 +92,14 @@ ULIBS =
AOPT =
# THUMB-specific options here
-TOPT = -mthumb -D THUMB
+TOPT = -mthumb
# Common options here
# NOTE: -ffixed-r7 is only needed if you enabled CH_CURRP_REGISTER_CACHE in
# chconf.h.
# NOTE: -falign-functions=16 may improve the performance, not always, but
# increases the code size.
-OPT = -O2 -ggdb -fomit-frame-pointer -fno-strict-aliasing
+OPT = -Os -ggdb -fomit-frame-pointer -fno-strict-aliasing
#OPT += -ffixed-r7
OPT += -falign-functions=16
@@ -125,10 +126,19 @@ CPFLAGS = $(MCFLAGS) $(OPT) $(WARN) -Wa,-ahlms=$(<:.c=.lst) $(DEFS)
LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch $(LIBDIR)
ODFLAGS = -x --syms
+# Thumb interwork enabled only if needed because it kills performance.
ifneq ($(TSRC),)
- ASFLAGS += -mthumb-interwork -D THUMB_INTERWORK
- CPFLAGS += -mthumb-interwork -D THUMB_INTERWORK
- LDFLAGS += -mthumb-interwork
+ ifneq ($(ASRC),)
+ # Both ARM and THUMB case
+ CPFLAGS += -mthumb-interwork -D THUMB
+ LDFLAGS += -mthumb-interwork
+ ASFLAGS += -mthumb-interwork -D THUMB
+ else
+ # Pure THUMB case, THUMB C code cannot be called by ARM asm code directly
+ CPFLAGS += -D THUMB
+ LDFLAGS += -mthumb
+ ASFLAGS += -mthumb-interwork -D THUMB -D PURE_THUMB
+ endif
endif
# Generate dependency information