summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/test/i2c/Makefile39
1 files changed, 16 insertions, 23 deletions
diff --git a/firmware/test/i2c/Makefile b/firmware/test/i2c/Makefile
index fe0f85e59e..51e72b859b 100644
--- a/firmware/test/i2c/Makefile
+++ b/firmware/test/i2c/Makefile
@@ -4,29 +4,24 @@ AR = sh-elf-ar
4AS = sh-elf-as 4AS = sh-elf-as
5OC = sh-elf-objcopy 5OC = sh-elf-objcopy
6 6
7INCLUDES=-I../../common -I../.. -I../../drivers 7FIRMWARE=../..
8
9INCLUDES=-I$(FIRMWARE) -I$(FIRMWARE)/common -I$(FIRMWARE)/drivers
8 10
9TARGET = -DARCHOS_PLAYER_OLD=1 11TARGET = -DARCHOS_PLAYER_OLD=1
10 12
11CFLAGS = -g -W -Wall -m1 -save-temps -nostdlib -Wstrict-prototypes -fschedule-insns -fno-builtin $(INCLUDES) $(TARGET) -DDEBUG 13CFLAGS = -g -W -Wall -m1 -save-temps -nostdlib -Wstrict-prototypes -fschedule-insns -fno-builtin $(INCLUDES) $(TARGET) -DDEBUG
12AFLAGS += -small -relax 14AFLAGS += -small -relax
13 15
14OBJS= ../../crt0.o main.o ../../drivers/i2c.o ../../drivers/mas.o \ 16SRC := $(wildcard *.c)
15 ../../debug.o ../../kernel.o thread.o ../../common/sprintf.o \ 17OBJS := $(SRC:%.c=%.o) $(FIRMWARE)/crt0.o
16 ../../drivers/dac.o ../../panic.o ../../system.o ../../drivers/led.o \ 18DEPS:=.deps
17 ../../drivers/lcd.o ata.o ../../drivers/fat.o \ 19DEPDIRS:=$(DEPS)
18 ../../common/disk.o ../../common/file.o ../../common/dir.o
19
20%.o: %.S
21 $(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) -c $<
22
23 20
24all : archos.mod 21all : archos.mod
25 22
26main.o: main.c
27
28archos.elf : $(OBJS) app.lds 23archos.elf : $(OBJS) app.lds
29 $(CC) -nostartfiles -o archos.elf $(OBJS) -lgcc -Tapp.lds -Wl,-Map,archos.map 24 $(CC) -nostartfiles -o archos.elf $(OBJS) -lgcc -lrockbox -L$(FIRMWARE) -Tapp.lds -Wl,-Map,archos.map
30 25
31archos.bin : archos.elf 26archos.bin : archos.elf
32 $(OC) -O binary archos.elf archos.bin 27 $(OC) -O binary archos.elf archos.bin
@@ -45,16 +40,14 @@ dist:
45 40
46clean: 41clean:
47 -rm -f $(OBJS) *.x *.i *.o *.s *.elf *.bin *.map *.mod *.bak *~ 42 -rm -f $(OBJS) *.x *.i *.o *.s *.elf *.bin *.map *.mod *.bak *~
43 -$(RM) -r $(DEPS)
48 44
49install: 45$(DEPS)/%.d: %.c
50 mount /mnt/archos; cp archos.mod /mnt/archos; umount /mnt/archos 46 @$(SHELL) -c 'for d in $(DEPDIRS); do { if [ ! -d $$d ]; then mkdir $$d; fi; }; done'
51 47 @echo "Updating dependencies for $<"
52thread.o: ../../thread.c 48 @$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \
53 $(CC) -O $(CFLAGS) -fomit-frame-pointer -c $< 49 |sed '\''s|\($*\)\.o[ :]*|\1.o $(<:%.c=%.d) : |g'\'' > $@; \
54 50 [ -s $@ ] || rm -f $@'
55ata.o: ../../drivers/ata.c
56 $(CC) -O $(CFLAGS) -c $<
57 51
58main.o: main.c 52-include $(SRC:%.c=$(DEPS)/%.d)
59 $(CC) -O $(CFLAGS) -c $<
60 53