Makefile
4.16 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#----------------------------------------------------------------------#
# Copyright (C) 1997, Nintendo.
#
# File Makefile
# Coded by Yoshitaka Yasumoto. Oct 15, 1997.
#
# $Id: Makefile,v 1.1.1.1 2002/05/02 03:29:11 blythe Exp $
#----------------------------------------------------------------------#
#-----------------------------------------------------------------------------
include $(ROOT)/usr/include/make/PRdefs
DEFINES = -DDEBUG
#SUBDIRS = F3DEX2
#SUBDIRS = S2DEX2
SUBDIRS = F3DEX2 F3DEX2.NoN F3DEX2.Rej F3DLX2.Rej L3DEX2 S2DEX2
COMMONPREF = F3DEX2
SUBPKGS = debug
#SAFE_MODE =
#SAFE_MODE = -DSAFE_MODE
include $(COMMONRULES)
default: $(_FORCE)
@for i in $(SUBDIRS) ; do \
( cd $$i ; \
echo ======== $$i.fifo ======== ; \
$(MAKE) -f ../Makefile UCODE=$$i OUTTYPE=fifo gsp$$i.fifo.o ; \
echo ======== $$i.xbus ======== ; \
$(MAKE) -f ../Makefile UCODE=$$i OUTTYPE=xbus gsp$$i.xbus.o );\
done
@for i in $(SUBPKGS) ; do \
( cd $$i ; $(MAKE) );\
done
@echo \
----------------------------------------------------------------------
@strings -30 */gsp*.o
@echo \
----------------------------------------------------------------------
@for i in $(SUBPKGS) ; do \
( cd $$i ; strings -30 */gsp*.o ); \
echo \
----------------------------------------------------------------------;\
done
safemode: $(_FORCE)
( SAFE_MODE=-DSAFE_MODE; export SAFE_MODE; make default )
clean clobber: $(_FORCE)
@for i in $(SUBDIRS) ; do \
echo ======== $$i ======== ; \
( cd $$i ; \
$(MAKE) -f ../Makefile UCODE=$$i $(COMMONPREF)$@ );\
done
@for i in $(SUBPKGS) ; do \
( cd $$i ; $(MAKE) $@ );\
done
@rm -f *~ doc/*~ Tools/*~
install exports: default
$(INSTALL) -m 444 -F /usr/src/PR/rspcode/graphics.F3DEX2 \
$(MAIN) $(COMMON_SRCS) $(COMMON_HDRS) Makefile \
Tools/binHack.perl
(cd doc; $(INSTALL) -m 444 -F /usr/src/PR/doc/gfxucode.F3DEX2 $(DOCS))
@for i in $(SUBDIRS) ; do \
echo ======== $$i ======== ; \
( cd $$i ; $(MAKE) -f ../Makefile UCODE=$$i $(COMMONPREF)$@ );\
done
@for i in $(SUBPKGS) ; do \
( cd $$i ; $(MAKE) $@ );\
done
#-----------------------------------------------------------------------------
UCPKG = F3DEX2
UROOT = ..
MAIN = gxmain.s
sinclude locdefs
UCODE_TMP = $(UCODE:.NoN=_NoN)
UCODE_DEFS = -DUCPKG_$(UCPKG) -DUCODE_$(UCODE_TMP:.Rej=_Rej) \
-DOUT_$(OUTTYPE) $(LOCAL_DEFS) $(SAFE_MODE)
UCODE_OBJS = gsp$(UCODE).$(OUTTYPE).o
UCODE_INCS = -I$(UROOT) -I$(ROOT)/usr/include -I$(ROOT)/usr/include/PR \
$(LOCAL_INCS)
VPATH = $(UROOT):$(UROOT)/F3DEX2:$(UROOT)/F3DEX2.NoN:\
:$(UROOT)/F3DEX2.Rej:$(UROOT)/F3DLX2.Rej:$(UROOT)/L3DEX2:\
:$(UROOT)/S2DEX2:$(UROOT)/../graphics.S2DEX
COMMON_SRCS = gxinit.s gxoutfifo.s gxoverlay.s gxdone.s gximm.s gxrdp.s \
gxsubmod.s gxoutxbus.s gxloop.s
COMMON_HDRS = gxdmem.h gxdmem_gstat.h gxdmem_lstat.h gxdmem_save.h \
gxdmem_submod.h gxdmem_work.h gxdmem_task.h gxmacros.h gxregs.h
SRCS = $(MAIN) $(COMMON_SRCS) $(LOCAL_SRCS)
HEADERS = $(COMMON_HDRS) $(LOCAL_HDRS)
LDIRT = gsp$(UCODE).fifo gsp$(UCODE).xbus *.submod *.u *.dat *.lst \
*.sym *.dbg *.elf *.tvd *~
RSPASM = $(ROOT)/usr/sbin/rspasm
DOCS = INSTALL.jp README.jp
PERL = perl
BINHACK = $(UROOT)/Tools/binHack.perl
MV = mv
$(COMMONPREF)install $(COMMONPREF)exports: $(_FORCE)
$(INSTALL) -m 555 -F /usr/lib/PR \
gsp$(UCODE).fifo.o gsp$(UCODE).xbus.o
$(INSTALL) -m 444 -F /usr/src/PR/rspcode/graphics.F3DEX2/$(UCODE) \
$(LOCAL_EXPT) locdefs
gsp$(UCODE).$(OUTTYPE).o: $(SRCS) $(HEADERS) locdefs
@echo '------- First Pass (前方参照のための INDEX 作成) -------'
$(RSPASM) \
$(DEFINES) $(UCODE_DEFS) $(UCODE_INCS) -F -l \
-o gsp$(UCODE).$(OUTTYPE) $(UROOT)/$(MAIN)
@echo '\n------- Second Pass (アセンブル) -------'
$(RSPASM) \
$(DEFINES) $(UCODE_DEFS) $(UCODE_INCS) \
-S gsp$(UCODE).$(OUTTYPE) \
-o gsp$(UCODE).$(OUTTYPE) $(UROOT)/$(MAIN)
@echo '\n------- Shrink DMEM -------'
$(PERL) $(BINHACK) SEG_TOP_DMEM SEG_BTM_DMEM \
gsp$(UCODE).$(OUTTYPE).dat \
gsp$(UCODE).$(OUTTYPE).dbg > gsp$(UCODE).$(OUTTYPE).dat.tmp
$(MV) gsp$(UCODE).$(OUTTYPE).dat.tmp gsp$(UCODE).$(OUTTYPE).dat
@echo '\n------- Make ELF object file -------'
$(RSP2ELF) -p -r gsp$(UCODE).$(OUTTYPE)
#======== End of Makefile ========#