Makefile 6.57 KB
#!smake -k -J 1
# --------------------------------------------------------------------
#        Copyright (C) 1997,1998 Nintendo. (Originated by SGI)
#        
#        $RCSfile: Makefile,v $
#        $Revision: 1.1.1.1 $
#        $Date: 2002/05/02 03:27:26 $
# --------------------------------------------------------------------
##################################################################
#
#  Makefile for Stress demo application 
#
#  Compile flags:
#
#  _DEBUG - compile with rmon thread
#
#
##################################################################

include $(ROOT)/usr/include/make/PRdefs

PRDEPTH=../../

APP =		stress

#
#  Target for no tcl interface, simply orbit around center of database
#
OPTIMIZER =	-g -D_DEBUG

#OPTIMIZER =	-g

TARGETS =	rom

TEXHFILES = \
		RGBA16foilage4.h \
		RGBA16rock2.h    \
		RGBA16L2_TV.h    \
		I4ripple2.h      \
		I4water1.h       \
		I4grass1.h       \
		I4shell1.h	     \
		CI4grass1.h

#
#  These texture files are checked in because the alpha
#  channel must be hand tweaked.
#
# IA4palmtrunk.h
# IA4palmhalf.h
# IA4palmshadow.h
# IA4umbshadow.h
#

HFILES =	$(TEXHFILES) flight_path.h fly.h stress.h texture.h vect.h

CODEFILES   =	\
		vect.c 			\
		fly.c 			\
		font.c 			\
		audio.c 		\
		dram_stack.c 	\
		rdp_output.c 	\
		rdp_output_len.c \
		waves.c			\
		flight_path.c   \
		clock.c

CODEOBJECTS =	$(CODEFILES:.c=.o)

DATAFILES   =	\
		dynamic.c	\
		zbuffer.c	\
		cfb.c		\
		rsp_cfb.c	\
		gfxinit.c	\
		models.c	\
		texture.c	\
		gfxyield.c

DATAOBJECTS =	$(DATAFILES:.c=.o)

CODESEGMENT =	codesegment.o


OBJECTS =	$(CODESEGMENT) $(DATAOBJECTS)

LCINCS =	-I. -I./Db -I$(ROOT)/usr/include/PR -I$(ROOT)/usr/include
LCOPTS =	-fullwarn -non_shared -G 0 -Xcpluscomm 

LDIRT  =	$(APP) $(APP_EM) $(TEXHFILES) *.so so_locations *.rgb \
		*.mem.Z *.mem *.rdp *.tsk InData/* OutData/*

LDFLAGS =	$(MKDEPOPT) -nostdlib -L$(ROOT)/usr/lib -L$(ROOT)/usr/lib/PR \
			-lultra_d


default:	$(TARGETS)

include $(COMMONRULES)

##################################################################
#
# Install rule
#
##################################################################
install:	default
		$(INSTALL) -m 444 -F /usr/src/PR/demos/stress \
			$(HFILES) $(CODEFILES) main.c \
			stresstcl.c stressctrl.h driverd.c \
			Makefile spec stressit \
			Texture/L2_TV.rgb \
			Texture/foilage4.rgb \
			Texture/grass1.rgb \
			Texture/ripple2.rgb \
			Texture/rock2.rgb \
			Texture/shell1.rgb \
			Texture/water1.rgb

$(CODESEGMENT):	$(CODEOBJECTS) main.o
		$(LD) -o $(CODESEGMENT) -r $(CODEOBJECTS) main.o $(LDFLAGS)

##################################################################
#
# This must depend on the generated h-files.
# If we don't do this, smake fails.
#
##################################################################
stress.o: $(TEXHFILES)

$(OBJECTS): $(HFILES)

$(APP) rom:	spec $(OBJECTS) $(MAKEROM)
		$(MAKEROM) $(LCINCS) -r rom spec

##################################################################
#
# Files specific to Hardware/Emulator
#
##################################################################

main.o: main.c
	$(CC) $(CFLAGS) -c $<


##################################################################
#  make utilites
##################################################################
make_rdram: make_rdram.c
	$(CC) -g -I$(ROOT)/usr/include -I$(ROOT)/usr/include/PR -o $* $*.c

##################################################################
#  Make texture files
#
#  NOTE:  not all these are currently used and some texture files 
#         are hand edited.
#
##################################################################
RGBA16dana.h: Texture/dana_tiny.rgb
	$(RGB2C) -m RGBA16dana Texture/dana_tiny.rgb > RGBA16dana.h

RGBA16luna.h: Texture/luna.rgb
	$(RGB2C) -m RGBA16luna Texture/luna.rgb > RGBA16luna.h

RGBA16mario.h: Texture/mario_1.rgb
	$(RGB2C) -m RGBA16mario Texture/mario_1.rgb > RGBA16mario.h

RGBA16L2_TV.h: Texture/L2_TV.rgb
	$(RGB2C) -F -m RGBA16L2_TV Texture/L2_TV.rgb > RGBA16L2_TV.h

I4luna.h: Texture/luna.rgb
	$(RGB2C) -m I4luna -f I -s 4 Texture/luna.rgb > I4luna.h

I4granite3.h: Texture/granite.3.bw
	$(RGB2C) -f I -s 4 -m I4granite3 Texture/granite.3.bw > I4granite3.h

I4palmtrunk.h: Texture/palmtrunk.rgb
	$(RGB2C) -f I -s 4 -m I4palmtrunk Texture/palmtrunk.rgb > I4palmtrunk.h

I4ripple2.h: Texture/ripple2.rgb
	$(RGB2C) -f I -s 4 -m I4ripple2 Texture/ripple2.rgb > I4ripple2.h

I4water1.h: Texture/water1.rgb
	$(RGB2C) -f I -s 4 -m I4water1 Texture/water1.rgb > I4water1.h

I4grass1.h: Texture/grass1.rgb
	$(RGB2C) -f I -s 4 -m I4grass1 Texture/grass1.rgb > I4grass1.h

I4bamboo5.h: Texture/bamboo5.rgb
	$(RGB2C) -f I -s 4 -m I4bamboo5 Texture/bamboo5.rgb > I4bamboo5.h

I4bamboo6.h: Texture/bamboo6.rgb
	$(RGB2C) -f I -s 4 -m I4bamboo6 Texture/bamboo6.rgb > I4bamboo6.h

I8shell1.h: Texture/shell1.rgb
	$(RGB2C) -f I -s 8 -m I8shell1 Texture/shell1.rgb > I8shell1.h

I4shell1.h: Texture/shell1.rgb
	$(RGB2C) -f I -s 4 -m I4shell1 Texture/shell1.rgb > I4shell1.h

I4sidewalk2.h: Texture/sidewalk2.rgb
	$(RGB2C) -f I -s 4 -m I4sidewalk2 Texture/sidewalk2.rgb > I4sidewalk2.h

I8sinc.h: Texture/I8sinc.c
	cd Texture; $(CC) -g I8sinc.c -o I8sinc -lm
	Texture/I8sinc > I8sinc.h

I4rock1.h: Texture/rock1.rgb
	$(RGB2C) -f I -s 4 -m I4rock1 Texture/rock1.rgb > I4rock1.h

CI4palmhalf.h: Texture/palmhalf.rgb
	$(RGB2C) -Q -t c -o c -f CI -s 4 -m CI4palmhalf Texture/palmhalf.rgb > CI4palmhalf.h

IA4palmhalf.h: Texture/palmhalf.rgb
	$(RGB2C) -f IA -s 4 -m IA4palmhalf Texture/palmhalf.rgb > IA4palmhalf.h

CI4palmtrunk.h: Texture/palmtrunk.rgb
	$(RGB2C) -Q -t c -o c -f CI -s 4 -m CI4palmtrunk Texture/palmtrunk.rgb > CI4palmtrunk.h

IA4palmtrunk.h: Texture/palmtrunk.rgb
	$(RGB2C) -f IA -s 4 -m IA4palmtrunk Texture/palmtrunk.rgb > IA4palmtrunk.h

IA4palmshadow.h: Texture/palmshadow.rgb
	$(RGB2C) -f IA -s 4 -m IA4palmshadow Texture/palmshadow.rgb > IA4palmshadow.h

IA4umbshadow.h: Texture/umbshadow.rgb
	$(RGB2C) -f IA -s 4 -m IA4umbshadow Texture/umbshadow.rgb > IA4umbshadow.h

IA8palmshadow.h: Texture/palmshadow.rgb
	$(RGB2C) -f IA -s 8 -m IA8palmshadow Texture/palmshadow.rgb > IA8palmshadow.h

CI4L2_TV.h: Texture/L2_TV.rgb
	$(RGB2C) -Q -t c -o c -f CI -s 4 -m CI4L2_TV Texture/L2_TV.rgb > CI4L2_TV.h

CI8mandrill.h: Texture/mandrill48x42.rgb
	$(RGB2C) -Q -t c -o c -f CI -s 8 -m CI8mandrill Texture/mandrill48x42.rgb > CI8mandrill.h

CI4grass1.h: Texture/grass1.rgb
	$(RGB2C) -Q -t c -o c -f CI -s 4 -m CI4grass1 Texture/grass1.rgb > CI4grass1.h

RGBA16foilage4.h: Texture/foilage4.rgb
	$(RGB2C) -m RGBA16foilage4 -f RGBA -s 16 -o MIP Texture/foilage4.rgb > RGBA16foilage4.h

RGBA16rock2.h: Texture/rock2.rgb
	$(RGB2C) -f RGBA -s 16 -m RGBA16rock2 -o MIP Texture/rock2.rgb > RGBA16rock2.h