Makefile 2.64 KB
#!smake -k
# --------------------------------------------------------------------
#        Copyright (C) 1997 Nintendo. (Originated by SGI)
#        
#        $RCSfile: Makefile,v $
#        $Revision: 1.1.1.1 $
#        $Date: 2002/05/02 03:27:09 $
# --------------------------------------------------------------------
#
# 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 =	-fullwarn -wlint,-f -woff 813,819,826,827,852 -non_shared -G 0
LDFLAGS =	$(MKDEPOPT) -nostdlib -L$(ROOT)/usr/lib -lultra_d

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
	$(CC) -g -I$(ROOT)/usr/include -I$(ROOT)/usr/include/PR -o $* $*.c

make_ci4_tex: make_ci4_tex.c
	$(CC) -g -I$(ROOT)/usr/include -I$(ROOT)/usr/include/PR -o $* $*.c

##################################################################
#  make textures
##################################################################

RGBA16dana.h: Texture/dana_tiny.rgb
	$(RGB2C) -F -s 16 -m $* $> > $@


CI8mandrill.h: Texture/mandrill.rgb
	$(RGB2C) $(QUADRICATE) -t c -o c -f CI -s 8 -m CI8mandrill Texture/mandrill.rgb > 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