diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-07-13 17:35:53 +0200 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-07-13 17:47:01 +0200 |
commit | 140783ef66eef379feedcfef5403c5729d38936a (patch) | |
tree | 0185a6a6ef80ab134150454674a1d7e1333b8757 /utils/hwstub/stmp/Makefile | |
parent | 3dd5e983db8d83113cc76ee0f5c02e158380606a (diff) | |
download | rockbox-140783ef66eef379feedcfef5403c5729d38936a.tar.gz rockbox-140783ef66eef379feedcfef5403c5729d38936a.zip |
hwstub: split target specific code from the common part
Completely rewrite the Mafile, properly put the usb driver in its
own file and the target specific files in a subdirectory.
Change-Id: Iaeee0128e021d5dad76b4d6035a63e33e2d946c1
Diffstat (limited to 'utils/hwstub/stmp/Makefile')
-rw-r--r-- | utils/hwstub/stmp/Makefile | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/utils/hwstub/stmp/Makefile b/utils/hwstub/stmp/Makefile deleted file mode 100644 index 4185dcbbc9..0000000000 --- a/utils/hwstub/stmp/Makefile +++ /dev/null | |||
@@ -1,74 +0,0 @@ | |||
1 | # | ||
2 | # common | ||
3 | # | ||
4 | CC=arm-elf-eabi-gcc | ||
5 | LD=arm-elf-eabi-gcc | ||
6 | AS=arm-elf-eabi-gcc | ||
7 | OC=arm-elf-eabi-objcopy | ||
8 | CFLAGS=-W -Wall -Wundef -O -nostdlib -ffreestanding -Wstrict-prototypes -pipe -std=gnu99 -mcpu=arm926ej-s -fomit-frame-pointer -Wno-pointer-sign -Wno-override-init -ffunction-sections | ||
9 | ASFLAGS=$(CFLAGS) -D__ASSEMBLER__ | ||
10 | OCFLAGS= | ||
11 | LINKER_FILE=hwstub.lds | ||
12 | TMP_LDS=link.lds | ||
13 | TMP_MAP=hwstub.map | ||
14 | LDFLAGS=-lgcc -Os -nostdlib -T$(TMP_LDS) -Wl,-Map,$(TMP_MAP) | ||
15 | SRC_C=$(wildcard *.c) | ||
16 | SRC_S=$(wildcard *.S) | ||
17 | OBJ_C=$(SRC_C:.c=.o) | ||
18 | OBJ_S=$(SRC_S:.S=.o) | ||
19 | OBJ=$(OBJ_C) $(OBJ_S) | ||
20 | OBJ_EXCEPT_CRT0=$(filter-out crt0.o,$(OBJ)) | ||
21 | DEPS=$(OBJ:.o=.d) | ||
22 | EXEC_ELF=hwstub.elf | ||
23 | |||
24 | # | ||
25 | # image production | ||
26 | # | ||
27 | TOOLS=../../../tools | ||
28 | SBTOOLS=../../imxtools/sbtools | ||
29 | |||
30 | # sb (stmp37xx) | ||
31 | EXEC_SB=hwstub.sb | ||
32 | ELF2SB=$(SBTOOLS)/elftosb -d | ||
33 | ELF2SB_CMD=-c hwstub.db | ||
34 | ELF2SB_KEY?=-z | ||
35 | |||
36 | # sb1 (stmp36xx) | ||
37 | EXEC_SB1=hwstub.sb1 | ||
38 | ELF2SB1_CMD=-loadjump $(EXEC_ELF) | ||
39 | ELF2SB1_KEY?= | ||
40 | ELF2SB1=$(SBTOOLS)/elftosb1 -d | ||
41 | |||
42 | EXEC=$(EXEC_ELF) $(EXEC_SB) $(EXEC_SB1) | ||
43 | |||
44 | all: $(EXEC) | ||
45 | |||
46 | # pull in dependency info for *existing* .o files | ||
47 | -include $(DEPS) | ||
48 | |||
49 | %.o: %.c | ||
50 | $(CC) $(CFLAGS) -c -o $@ $< | ||
51 | $(CC) -MM $(CFLAGS) $*.c > $*.d | ||
52 | @cp -f $*.d $*.d.tmp | ||
53 | @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \ | ||
54 | sed -e 's/^ *//' -e 's/$$/:/' >> $*.d | ||
55 | @rm -f $*.d.tmp | ||
56 | |||
57 | %.o: %.S | ||
58 | $(AS) $(ASFLAGS) -c -o $@ $< | ||
59 | |||
60 | $(TMP_LDS): $(LINKER_FILE) | ||
61 | $(CC) -E -x c - < $< | sed '/#/d' > $@ | ||
62 | |||
63 | $(EXEC_ELF): $(OBJ) $(TMP_LDS) | ||
64 | $(LD) $(LDFLAGS) -o $@ $(OBJ_EXCEPT_CRT0) | ||
65 | |||
66 | $(EXEC_SB): $(EXEC_ELF) | ||
67 | $(ELF2SB) $(ELF2SB_CMD) $(ELF2SB_KEY) -o $@ | ||
68 | |||
69 | $(EXEC_SB1): $(EXEC_ELF) | ||
70 | $(ELF2SB1) $(ELF2SB1_CMD) $(ELF2SB1_KEY) -o $@ | ||
71 | |||
72 | clean: | ||
73 | rm -rf $(OBJ) $(DEPS) $(EXEC) $(TMP_LDS) $(TMP_MAP) | ||
74 | |||