Makefile
2.5 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
#! smake
#---------------------------------------------------------------------
# Copyright (C) 1997, Nintendo.
#
# File Makefile
# Coded by Yoshitaka Yasumoto. Mar 19, 1997.
# Modified by
# Comments
#
# $Id: Makefile,v 1.1.1.2 2002/10/29 08:05:54 blythe Exp $
#---------------------------------------------------------------------
include $(ROOT)/usr/include/make/PRdefs
#FINAL =
#ifdef FINAL
OPTIMIZER = -O2
LCDEFS = -DNDEBUG -D_FINALROM
N64LIB = -lultra_rom
#else
OPTIMIZER = -g
LCDEFS = -DDEBUG
N64LIB = -lultra_d
#endif
APP = sample
TARGETS = rom
CODEFILES = system.c main.c uc_assert.c action.c sprite.c
CODEOBJECTS = $(CODEFILES:.c=.o)
CODESEGMENT = codesegment.o
STATICFILES = static.c texture.c sprite_ball.c
STATICOBJECTS = $(STATICFILES:.c=.o)
STATICSEGMENT = staticsegment.o
BGFILES = L2_TV.c
BGOBJECTS = $(BGFILES:.c=.o)
DATAFILES = system_cfb.c system_rspbuf.c
DATAOBJECTS = $(DATAFILES:.c=.o)
CFILES = $(CODEFILES) $(STATICFILES) $(DATAFILES)
HFILES = action.h sprite.h system.h texture.h texture_pattern.h \
uc_assert.h
OBJECTS = $(CODESEGMENT) $(STATICSEGMENT) $(DATAOBJECTS) $(BGOBJECTS)
MAPFILE = load.map
LCINCS = -I. -I$(ROOT)/usr/include/PR
LCOPTS = -fullwarn -wlint,-f -woff 813,819,826,827,852 \
-non_shared -G 0 -Xcpluscomm
LCDEFS += -DF3DEX_GBI
LDIRT = $(APP) *.dat *.dbg *.lst *.sym *~ $(MAPFILE) \
Makedepend L2_TV.rgba5551 L2_TV.ppm L2_TV.c rgb2u64
LDFLAGS = $(MKDEPOPT) -nostdlib -L$(ROOT)/usr/lib $(N64LIB)
default: $(TARGETS)
include $(COMMONRULES)
install: default
$(INSTALL) -m 444 -F /usr/src/PR/demos/gs2dex \
$(HFILES) $(CFILES) rgb2u64.c L2_TV.rgb \
Makefile spec ppm8to5.perl ppmtoCI.perl
$(CODESEGMENT): $(CODEOBJECTS)
$(LD) -o $(CODESEGMENT) -r $(CODEOBJECTS) $(LDFLAGS)
$(STATICSEGMENT): $(STATICOBJECTS)
$(LD) -o $(STATICSEGMENT) -r $(STATICOBJECTS) $(LDFLAGS)
#ifdef FINAL
$(TARGETS): spec $(OBJECTS) L2_TV.rgba5551
$(MAKEROM) $(LCDEFS) -m -s 9 -r $(TARGETS) spec > $(MAPFILE)
#ifndef NOMAKEMASK
makemask $(TARGETS)
#endif
#else
$(TARGETS): spec $(OBJECTS) L2_TV.rgba5551
$(MAKEROM) $(LCDEFS) -m -r $(TARGETS) spec > $(MAPFILE)
#endif
rgb2u64: rgb2u64.c
$(CC) rgb2u64.c -o rgb2u64 -limage
L2_TV.rgba5551: L2_TV.rgb rgb2u64
rgb2u64 L2_TV.rgb 328 240 > L2_TV.rgba5551
L2_TV.c: L2_TV.rgb ppmtoCI.perl ppm8to5.perl
toppm L2_TV.rgb L2_TV.ppm
perl ppm8to5.perl < L2_TV.ppm | \
$(ROOT)/usr/sbin/ppmquant 255 | \
perl ppmtoCI.perl 328 240 L2_TV 1 > L2_TV.c
rm L2_TV.ppm
#======== End of Makefile ========