GNUmakefile
914 Bytes
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
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 = cartdma.hex
ASFILES = entry.s
CFILES = cartdma.c
OPTIMIZER=
#LCOPTS += -mips3 -g
#LCOPTS += -mips2 -Os -G 0
LCOPTS += -mips2 -g -G 0
#LASOPTS += -mips2 -Os -G 0
LASOPTS += -mips2 -g -G 0
LLDOPTS += -N -lultra_d -lgcc --no-warn-mismatch
ifdef ENTRY_ADDR
LLDOPTS += -Ttext $(ENTRY_ADDR)
else
LLDOPTS += -Ttext 0x80004000
endif
LDIRT += cpu.log*
#ifeq ($(BIG_APP), 1)
#LASOPTS += -DBIG_APP
#endif
LDIRT += cartdma.elf cartdma.bin
.PRECIOUS: %.bin
default: $(TARGETS)
#test: default copy
cartdma.elf: $(OBJECTS)
$(CCF) -o cartdma.elf $(OBJECTS) $(LDFLAGS)
%.bin: %.elf
$(OBJCOPY) -O binary -S $(REMOVE_SECTS) $< $@
%.hex: %.bin
od -v -w4 -An -tx1 $< | tr -d " " > $@
install exports headers:
include $(COMMONRULES)