diff options
-rw-r--r-- | firmware/Makefile | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/firmware/Makefile b/firmware/Makefile index 25d1b1e29c..dbcff16eb8 100644 --- a/firmware/Makefile +++ b/firmware/Makefile | |||
@@ -23,19 +23,16 @@ TARGET = -DARCHOS_PLAYER=1 | |||
23 | CFLAGS = -W -Wall -m1 -nostdlib -Wstrict-prototypes $(INCLUDES) $(TARGET) | 23 | CFLAGS = -W -Wall -m1 -nostdlib -Wstrict-prototypes $(INCLUDES) $(TARGET) |
24 | 24 | ||
25 | ifdef DEBUG | 25 | ifdef DEBUG |
26 | CFLAGS += -g -DDEBUG | 26 | CFLAGS += -O -g -DDEBUG |
27 | else | 27 | else |
28 | CFLAGS += -O -fomit-frame-pointer -fschedule-insns | 28 | CFLAGS += -O -fomit-frame-pointer -fschedule-insns -save-temps |
29 | endif | 29 | endif |
30 | 30 | ||
31 | AFLAGS += -small -relax | 31 | AFLAGS += -small -relax |
32 | 32 | ||
33 | SRC := $(wildcard drivers/*.c common/*.c malloc/*.c *.c) | 33 | SRC := $(wildcard drivers/*.c common/*.c malloc/*.c *.c) |
34 | EXCLUDED_SRC := thread.c | ||
35 | 34 | ||
36 | SRC := $(filter-out $(EXCLUDED_SRC),$(SRC)) | 35 | OBJS := $(SRC:%.c=%.o) crt0.o |
37 | |||
38 | OBJS := $(SRC:%.c=%.o) $(EXCLUDED_SRC:%.c=%.o) crt0.o | ||
39 | DEPS:=.deps | 36 | DEPS:=.deps |
40 | DEPDIRS:=$(DEPS) $(DEPS)/drivers $(DEPS)/common $(DEPS)/malloc | 37 | DEPDIRS:=$(DEPS) $(DEPS)/drivers $(DEPS)/common $(DEPS)/malloc |
41 | 38 | ||
@@ -46,6 +43,10 @@ clean: | |||
46 | -rm -f $(OBJS) *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~ | 43 | -rm -f $(OBJS) *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~ |
47 | -$(RM) -r $(DEPS) | 44 | -$(RM) -r $(DEPS) |
48 | 45 | ||
46 | # Special targets | ||
47 | thread.o: thread.c thread.h | ||
48 | $(CC) -c -O -fomit-frame-pointer $(CFLAGS) $< | ||
49 | |||
49 | $(DEPS)/%.d: %.c | 50 | $(DEPS)/%.d: %.c |
50 | @$(SHELL) -c 'for d in $(DEPDIRS); do { if [ ! -d $$d ]; then mkdir $$d; fi; }; done' | 51 | @$(SHELL) -c 'for d in $(DEPDIRS); do { if [ ! -d $$d ]; then mkdir $$d; fi; }; done' |
51 | @echo "Updating dependencies for $<" | 52 | @echo "Updating dependencies for $<" |
@@ -54,7 +55,3 @@ $(DEPS)/%.d: %.c | |||
54 | [ -s $@ ] || rm -f $@' | 55 | [ -s $@ ] || rm -f $@' |
55 | 56 | ||
56 | -include $(SRC:%.c=$(DEPS)/%.d) | 57 | -include $(SRC:%.c=$(DEPS)/%.d) |
57 | |||
58 | # Special targets | ||
59 | thread.o: thread.c thread.h | ||
60 | $(CC) -c -O -fomit-frame-pointer $(CFLAGS) $< | ||