diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-05-23 11:46:15 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-05-23 11:46:15 +0000 |
commit | 4118d8c0318e69b366d424545cbad6529bfc5e53 (patch) | |
tree | 0b9f38974bc08925d332715ad76b80acbef3c256 /firmware/Makefile | |
parent | 670965876893d9e5a0dbe7b9392622ac6977e38f (diff) | |
download | rockbox-4118d8c0318e69b366d424545cbad6529bfc5e53.tar.gz rockbox-4118d8c0318e69b366d424545cbad6529bfc5e53.zip |
attempted OBJDIR support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@663 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/Makefile')
-rw-r--r-- | firmware/Makefile | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/firmware/Makefile b/firmware/Makefile index d9670222b4..cb18c393d4 100644 --- a/firmware/Makefile +++ b/firmware/Makefile | |||
@@ -20,6 +20,9 @@ TARGET = -DARCHOS_PLAYER=1 | |||
20 | #TARGET = -DARCHOS_PLAYER_OLD=1 | 20 | #TARGET = -DARCHOS_PLAYER_OLD=1 |
21 | #TARGET = -DARCHOS_RECORDER=1 | 21 | #TARGET = -DARCHOS_RECORDER=1 |
22 | 22 | ||
23 | # store output files in this directory: | ||
24 | OBJDIR = . | ||
25 | |||
23 | CFLAGS = -W -Wall -O -m1 -nostdlib -Wstrict-prototypes $(INCLUDES) $(TARGET) | 26 | CFLAGS = -W -Wall -O -m1 -nostdlib -Wstrict-prototypes $(INCLUDES) $(TARGET) |
24 | 27 | ||
25 | ifdef DEBUG | 28 | ifdef DEBUG |
@@ -32,26 +35,28 @@ AFLAGS += -small -relax | |||
32 | 35 | ||
33 | SRC := $(wildcard drivers/*.c common/*.c malloc/*.c *.c) | 36 | SRC := $(wildcard drivers/*.c common/*.c malloc/*.c *.c) |
34 | 37 | ||
35 | OBJS := $(SRC:%.c=%.o) crt0.o | 38 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) $(OBJDIR)/crt0.o |
36 | DEPS:=.deps | 39 | DEPS:=.deps |
37 | DEPDIRS:=$(DEPS) $(DEPS)/drivers $(DEPS)/common $(DEPS)/malloc | 40 | DEPDIRS:=$(DEPS) $(DEPS)/drivers $(DEPS)/common $(DEPS)/malloc |
38 | 41 | ||
39 | librockbox.a: $(OBJS) | 42 | OUTPUT = $(OBJDIR)/librockbox.a |
43 | |||
44 | $(OUTPUT): $(OBJS) | ||
40 | $(AR) ruv $@ $+ | 45 | $(AR) ruv $@ $+ |
41 | 46 | ||
42 | clean: | 47 | clean: |
43 | -rm -f $(OBJS) *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~ | 48 | -$(RM) -f $(OBJDIR)/$(OBJS) *~ $(OUTPUT) |
44 | -$(RM) -r $(DEPS) | 49 | -$(RM) -r $(DEPS) |
45 | 50 | ||
46 | # Special targets | 51 | # Special targets |
47 | thread.o: thread.c thread.h | 52 | $(OBJDIR)/thread.o: thread.c thread.h |
48 | $(CC) -c -O -fomit-frame-pointer $(CFLAGS) $< | 53 | $(CC) -c -O -fomit-frame-pointer $(CFLAGS) $< -o $@ |
49 | 54 | ||
50 | $(DEPS)/%.d: %.c | 55 | $(DEPS)/%.d: %.c |
51 | @$(SHELL) -c 'for d in $(DEPDIRS); do { if [ ! -d $$d ]; then mkdir $$d; fi; }; done' | 56 | @$(SHELL) -c 'for d in $(DEPDIRS); do { if [ ! -d $$d ]; then mkdir $$d; fi; }; done' |
52 | @echo "Updating dependencies for $<" | 57 | @echo "Updating dependencies for $<" |
53 | @$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \ | 58 | @$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \ |
54 | |sed '\''s|\($*\)\.o[ :]*|\1.o $(<:%.c=%.d) : |g'\'' > $@; \ | 59 | |sed '\''s|\($*\)\.o[ :]*|$(OBJDIR)/\1.o $(<:%.c=%.d) : |g'\'' > $@; \ |
55 | [ -s $@ ] || rm -f $@' | 60 | [ -s $@ ] || rm -f $@' |
56 | 61 | ||
57 | -include $(SRC:%.c=$(DEPS)/%.d) | 62 | -include $(SRC:%.c=$(DEPS)/%.d) |