summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-05-23 11:46:15 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-05-23 11:46:15 +0000
commit4118d8c0318e69b366d424545cbad6529bfc5e53 (patch)
tree0b9f38974bc08925d332715ad76b80acbef3c256 /firmware
parent670965876893d9e5a0dbe7b9392622ac6977e38f (diff)
downloadrockbox-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')
-rw-r--r--firmware/Makefile17
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:
24OBJDIR = .
25
23CFLAGS = -W -Wall -O -m1 -nostdlib -Wstrict-prototypes $(INCLUDES) $(TARGET) 26CFLAGS = -W -Wall -O -m1 -nostdlib -Wstrict-prototypes $(INCLUDES) $(TARGET)
24 27
25ifdef DEBUG 28ifdef DEBUG
@@ -32,26 +35,28 @@ AFLAGS += -small -relax
32 35
33SRC := $(wildcard drivers/*.c common/*.c malloc/*.c *.c) 36SRC := $(wildcard drivers/*.c common/*.c malloc/*.c *.c)
34 37
35OBJS := $(SRC:%.c=%.o) crt0.o 38OBJS := $(SRC:%.c=$(OBJDIR)/%.o) $(OBJDIR)/crt0.o
36DEPS:=.deps 39DEPS:=.deps
37DEPDIRS:=$(DEPS) $(DEPS)/drivers $(DEPS)/common $(DEPS)/malloc 40DEPDIRS:=$(DEPS) $(DEPS)/drivers $(DEPS)/common $(DEPS)/malloc
38 41
39librockbox.a: $(OBJS) 42OUTPUT = $(OBJDIR)/librockbox.a
43
44$(OUTPUT): $(OBJS)
40 $(AR) ruv $@ $+ 45 $(AR) ruv $@ $+
41 46
42clean: 47clean:
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
47thread.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)