GNUmakefile
960 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
50
51
52
53
include $(ROOT)/usr/include/make/commondefs
include $(ROOT)/usr/include/make/PRdefs
FLASH_FILE = testapp.nand
OBJCOPY = mips-linux-objcopy
REMOVE_SECTS = -R .reginfo -R .note -R .comment -R .mdebug
TARGETS = testapp.hex
ASFILES = ../entry.s skapi.s
CFILES = ../message.c testapp.c
OPTIMIZER=
LCOPTS += -mips3 -g -G 0
LASOPTS += -mips3 -g -G 0
ifdef ENTRY_ADDR
LLDOPTS += -Ttext $(ENTRY_ADDR) -N
else
LLDOPTS += -Ttext 0x80004000 -N
endif
LDIRT += cpu.log*
ifeq ($(BIG_APP), 1)
LASOPTS += -DBIG_APP
LCOPTS += -DBIG_APP
endif
# log messages into dram
ifeq ($(LOG_MEM), 1)
LCOPTS += -DLOG_MEM
endif
LDIRT += testapp.elf testapp.bin ../entry.o ../message.o
.PRECIOUS: %.bin
default: $(TARGETS)
#test: default copy
testapp.elf: $(OBJECTS)
$(CCF) -o testapp.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)