GNUmakefile 2.63 KB
#!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