as3525*: initialize cpu_frequency correctly
[kugel-rb.git] / firmware / test / i2c / Makefile
blob51e72b859b64932ae2cc7576c7c3d71f7ce931c2
1 CC = sh-elf-gcc
2 LD = sh-elf-ld
3 AR = sh-elf-ar
4 AS = sh-elf-as
5 OC = sh-elf-objcopy
7 FIRMWARE=../..
9 INCLUDES=-I$(FIRMWARE) -I$(FIRMWARE)/common -I$(FIRMWARE)/drivers
11 TARGET = -DARCHOS_PLAYER_OLD=1
13 CFLAGS = -g -W -Wall -m1 -save-temps -nostdlib -Wstrict-prototypes -fschedule-insns -fno-builtin $(INCLUDES) $(TARGET) -DDEBUG
14 AFLAGS += -small -relax
16 SRC := $(wildcard *.c)
17 OBJS := $(SRC:%.c=%.o) $(FIRMWARE)/crt0.o
18 DEPS:=.deps
19 DEPDIRS:=$(DEPS)
21 all : archos.mod
23 archos.elf : $(OBJS) app.lds
24 $(CC) -nostartfiles -o archos.elf $(OBJS) -lgcc -lrockbox -L$(FIRMWARE) -Tapp.lds -Wl,-Map,archos.map
26 archos.bin : archos.elf
27 $(OC) -O binary archos.elf archos.bin
29 archos.asm: archos.bin
30 sh2d -sh1 archos.bin > archos.asm
32 archos.mod : archos.bin
33 scramble archos.bin archos.mod
35 archos.mod.gz : archos.mod
36 gzip -f archos.mod
38 dist:
39 tar czvf dist.tar.gz Makefile main.c start.s app.lds
41 clean:
42 -rm -f $(OBJS) *.x *.i *.o *.s *.elf *.bin *.map *.mod *.bak *~
43 -$(RM) -r $(DEPS)
45 $(DEPS)/%.d: %.c
46 @$(SHELL) -c 'for d in $(DEPDIRS); do { if [ ! -d $$d ]; then mkdir $$d; fi; }; done'
47 @echo "Updating dependencies for $<"
48 @$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \
49 |sed '\''s|\($*\)\.o[ :]*|\1.o $(<:%.c=%.d) : |g'\'' > $@; \
50 [ -s $@ ] || rm -f $@'
52 -include $(SRC:%.c=$(DEPS)/%.d)