summaryrefslogtreecommitdiff
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
parent670965876893d9e5a0dbe7b9392622ac6977e38f (diff)
downloadrockbox-4118d8c0318e69b366d424545cbad6529bfc5e53.zip
rockbox-4118d8c0318e69b366d424545cbad6529bfc5e53.tar.gz
rockbox-4118d8c0318e69b366d424545cbad6529bfc5e53.tar.bz2
rockbox-4118d8c0318e69b366d424545cbad6529bfc5e53.tar.xz
attempted OBJDIR support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@663 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/Makefile17
1 files changed, 11 insertions, 6 deletions
diff --git a/firmware/Makefile b/firmware/Makefile
index d967022..cb18c39 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -20,6 +20,9 @@ TARGET = -DARCHOS_PLAYER=1
#TARGET = -DARCHOS_PLAYER_OLD=1
#TARGET = -DARCHOS_RECORDER=1
+# store output files in this directory:
+OBJDIR = .
+
CFLAGS = -W -Wall -O -m1 -nostdlib -Wstrict-prototypes $(INCLUDES) $(TARGET)
ifdef DEBUG
@@ -32,26 +35,28 @@ AFLAGS += -small -relax
SRC := $(wildcard drivers/*.c common/*.c malloc/*.c *.c)
-OBJS := $(SRC:%.c=%.o) crt0.o
+OBJS := $(SRC:%.c=$(OBJDIR)/%.o) $(OBJDIR)/crt0.o
DEPS:=.deps
DEPDIRS:=$(DEPS) $(DEPS)/drivers $(DEPS)/common $(DEPS)/malloc
-librockbox.a: $(OBJS)
+OUTPUT = $(OBJDIR)/librockbox.a
+
+$(OUTPUT): $(OBJS)
$(AR) ruv $@ $+
clean:
- -rm -f $(OBJS) *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~
+ -$(RM) -f $(OBJDIR)/$(OBJS) *~ $(OUTPUT)
-$(RM) -r $(DEPS)
# Special targets
-thread.o: thread.c thread.h
- $(CC) -c -O -fomit-frame-pointer $(CFLAGS) $<
+$(OBJDIR)/thread.o: thread.c thread.h
+ $(CC) -c -O -fomit-frame-pointer $(CFLAGS) $< -o $@
$(DEPS)/%.d: %.c
@$(SHELL) -c 'for d in $(DEPDIRS); do { if [ ! -d $$d ]; then mkdir $$d; fi; }; done'
@echo "Updating dependencies for $<"
@$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \
- |sed '\''s|\($*\)\.o[ :]*|\1.o $(<:%.c=%.d) : |g'\'' > $@; \
+ |sed '\''s|\($*\)\.o[ :]*|$(OBJDIR)/\1.o $(<:%.c=%.d) : |g'\'' > $@; \
[ -s $@ ] || rm -f $@'
-include $(SRC:%.c=$(DEPS)/%.d)