GNUmakefile
2.63 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
#!smake -k
# --------------------------------------------------------------------
# Copyright (C) 1997 Nintendo. (Originated by SGI)
#
# $RCSfile: GNUmakefile,v $
# $Revision: 1.1 $
# $Date: 2003/04/08 00:57:20 $
# --------------------------------------------------------------------
#
# Makefile for demo application
#
#
include $(ROOT)/usr/include/make/PRdefs
APP = demo
#
# Used to test load tlut workaround macros,
#
# for hw1
#QUADRICATE = -Q
# for hw2
QUADRICATE =
OPTIMIZER = -g
TARGETS = rom
TEXHFILES = RGBA16dana.h CI8mandrill.h CI8ramp.h CI4ramp.h \
RGBA32mandrill.h RGBA16mandrill.h I4mandrill.h
HFILES = $(TEXHFILES) app.h vector.h matrix.h walk_around.h texture.h
CODEFILES = main.c \
vector.c \
matrix.c \
walk_around.c \
rdp_output.c \
rdp_output_len.c \
dram_stack.c
CODEOBJECTS = $(CODEFILES:.c=.o)
DATAFILES = static.c cfb.c rsp_cfb.c czb.c rsp_czb.c texture.c
DATAOBJECTS = $(DATAFILES:.c=.o)
CODESEGMENT = codesegment.o
OBJECTS = $(CODESEGMENT) $(DATAOBJECTS)
LCDEFS = -DWALK_AROUND
LCINCS = -I.
LCOPTS = -Wall -non_shared -G 0 -mips2
LDFLAGS = $(MKDEPOPT) -L$(ROOT)/usr/lib -lultra_d -lgcc
LDIRT = $(APP) $(TEXHFILES) make_ci8_tex make_ci4_tex
default: $(TARGETS)
include $(COMMONRULES)
install: default
$(INSTALL) -m 444 -F /usr/src/PR/demos/demo \
$(HFILES) $(CODEFILES) $(DATAFILES) Makefile spec
texture.o: $(TEXHFILES)
$(CODESEGMENT): $(CODEOBJECTS)
$(LD) -o $(CODESEGMENT) -r $(CODEOBJECTS) $(LDFLAGS)
rom $(APP): spec $(OBJECTS) $(MAKEROM)
$(MAKEROM) -r rom spec
##################################################################
# make utilites
##################################################################
make_ci8_tex: make_ci8_tex.c
$(HOST_CC) -g -I/usr/include -I$(ROOT)/usr/include -I$(ROOT)/usr/include/PR -o $@ $^
make_ci4_tex: make_ci4_tex.c
$(HOST_CC) -g -I/usr/include -I$(ROOT)/usr/include -I$(ROOT)/usr/include/PR -o $@ $^
##################################################################
# make textures
##################################################################
RGBA16dana.h: Texture/dana_tiny.rgb
echo $>
$(RGB2C) -F -s 16 -m $* $^ > $@
CI8mandrill.h: Texture/mandrill.rgb
$(RGB2C) $(QUADRICATE) -t c -o c -f CI -s 8 -m $* $^ > CI8mandrill.h
RGBA32mandrill.h: Texture/mandrill32.rgb
$(RGB2C) -f RGBA -s 32 -m $* $^ > $@
RGBA16mandrill.h: Texture/mandrill32.rgb
$(RGB2C) -f RGBA -s 16 -m $* $^ > $@
I4mandrill.h: Texture/mandrill32.rgb
$(RGB2C) -f I -s 4 -m $* $^ > $@
CI8ramp.h: make_ci8_tex
- ./make_ci8_tex $(QUADRICATE) > CI8ramp.h
CI4ramp.h: make_ci4_tex
- ./make_ci4_tex $(QUADRICATE) > CI4ramp.h