GNUmakefile
1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
include $(ROOT)/usr/include/make/commondefs
include $(ROOT)/usr/include/make/PRdefs
OBJCOPY = mips-linux-objcopy
REMOVE_SECTS = -R .reginfo -R .note -R .comment -R .mdebug
TARGETS = atbtest.hex gen_testfile
ASFILES = entry.s
CFILES = atbtest.c
OPTIMIZER=
#LCOPTS += -mips3 -g
#LCOPTS += -mips2 -Os -G 0
LCOPTS += -mips2 -Wa,-32 -g -G 0
#LASOPTS += -mips2 -Os -G 0
LASOPTS += -mips2 -Wa,-32 -g -G 0
LLDOPTS += -N -Wl,--no-warn-mismatch
ifdef ENTRY_ADDR
LLDOPTS += -Ttext $(ENTRY_ADDR)
else
LLDOPTS += -Ttext 0x80004000
endif
LDIRT += cpu.log*
LLDLIBS += -lultra_d -lcrypto -lgcc
FLAGS = $(LCDEFS) $(LCINCS) -non_shared -G 0 -mips3 -Wa,-32 -c $(GCFLAGS)
#ifeq ($(BIG_APP), 1)
#LASOPTS += -DBIG_APP
#endif
LDIRT += atbtest.elf atbtest.bin
.PRECIOUS: %.bin
default: $(TARGETS)
#test: default copy
atbtest.elf: $(OBJECTS)
$(CCF) -o atbtest.elf $(OBJECTS) $(LDFLAGS)
%.bin: %.elf
$(OBJCOPY) -O binary -S $(REMOVE_SECTS) $< $@
%.hex: %.bin
od -v -w4 -An -tx1 $< | tr -d " " > $@
install exports headers:
#atbtest.o: atbtest.c
# $(CC) $(FLAGS) -o $@ atbtest.c
include $(COMMONRULES)
gen_testfile: gen_testfile.c
$(HOST_CC) -o gen_testfile gen_testfile.c