GNUmakefile
2.27 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
include $(ROOT)/usr/include/make/PRdefs
IS_BB = 1
BUNDLE_SA2=../viewer/rom
SYSAPP_AES=sysapp.aes
SYSAPP_TIK=sysapp.tik
USE_TEXTURE = 1
#DEBUG = 1
LCDEFS += -D_BBID_GUARD
APP = sysapp
ifdef DEBUG
OPTIMIZER = -g
else
OPTIMIZER = -Os
endif
TARGETS = rom
CODE_HFILES = sysapp.h
CODE_CFILES = sysapp.c sa2load.c mon.c vidreset.c
ifdef USE_TEXTURE
LCDEFS += -DUSE_TEXTURE=1
CODE_HFILES += gfx.h
CODE_CFILES += gfx.c gfxdynamic.c gfxstack.c gfxstatic.c gfxyield.c texture/home_msg1_gz.c texture/home_msg2_gz.c
endif
CODE_OBJECTS= $(CODE_CFILES:.c=.o)
CODESEGMENT = code.o
DATAFILES = reserved.c
DATAOBJECTS = $(DATAFILES:.c=.o)
OBJECTS = $(CODESEGMENT) $(DATAOBJECTS)
VERSION = $(shell date "+%D %T")
LCINCS = -I. -I$(ROOT)/usr/include/PR
LCOPTS = -mips2 -Wall -non_shared -G 0 -DVERSION="\"$(VERSION)\"" -DUSB_RDB -DEMS_MON
ifdef RMA_MON
LCDEFS += -DRMA_MON
else
LCDEFS += -DBBCARD_WRITE_ENABLE
endif
ifdef IS_BB
LCOPTS += -DIS_BB
MKOPTS = -DIS_BB
endif
ifdef DEBUG
LCOPTS += -DDEBUG -DUSB_PRINTF -DFBDEBUG
else
LCOPTS += -DNDEBUG
endif
LASINCS = $(LCINCS)
LASOPTS = -non_shared -G 0
LDIRT = $(APP)
ifdef DEBUG
LDFLAGS = $(MKDEPOPT) -lfb -L$(ROOT)/usr/lib -lultra_d -lcrypto -lz -lgcc --no-warn-mismatch
else
LDFLAGS = $(MKDEPOPT) -lfb -L$(ROOT)/usr/lib -lultra -lcrypto -lz -lgcc --no-warn-mismatch
endif
default: $(TARGETS)
ifdef BUNDLE_SA2
../bundleBootapp2 $(TARGETS) $(BUNDLE_SA2)
else
../bundleBootapp $(TARGETS) $(SYSAPP_AES) $(SYSAPP_TIK)
endif
# ../bundleBootapp -r 0xffffffff -R 0xffffffff $(TARGETS) $(SYSAPP_AES) $(SYSAPP_TIK)
# ../bundleBootapp -r 0x000001B3 -R 0x00000E01 $(TARGETS) $(SYSAPP_AES) $(SYSAPP_TIK)
include $(COMMONRULES)
install: default
.PHONY: lib
clobber clean:
rm -rf *.o $(LDIRT) texture/*.tex texture/*.c texture/*.o texture/*.h texture/*.gz rom.map
$(CODESEGMENT): $(CODE_OBJECTS)
$(LD) -o $@ -r $(CODE_OBJECTS) $(LDFLAGS)
$(TARGETS) $(APP): spec $(OBJECTS) $(MAKEROM)
$(MAKEROM) $(MKOPTS) -r $(TARGETS) spec -m > rom.map
texture/home_msg1_gz.c: texture/home_msg1.rgb
(../viewer/tool/gzimg.pl RGBA 16 texture/home_msg1.rgb texture/home_msg1_gz.c gzTexMsg1 gzTexMsg1Size;)
texture/home_msg2_gz.c: texture/home_msg2.rgb
(../viewer/tool/gzimg.pl RGBA 16 texture/home_msg2.rgb texture/home_msg2_gz.c gzTexMsg2 gzTexMsg2Size;)