Makefile 4.84 KB
#!smake -k
# --------------------------------------------------------------------
#        Copyright (C) 1997,1998 Nintendo. (Originated by SGI)
#        
#        $RCSfile: Makefile,v $
#        $Revision: 1.1.1.1 $
#        $Date: 2002/05/02 03:27:34 $
# --------------------------------------------------------------------
#
# Makefile for Spin demo application 
#
#
#

PRDEPTH = ../..

include $(PRDEPTH)/PRdefs

APP =		spin

OPTIMIZER =	-g

TARGETS =	rom spintcl.so

TEXHFILES =	RGBA16molecule.h \
		RGBA16grid.h \
		I8mand.h    \
		I8cloud.h    \
		I4granite3.h \
		IA16tree.h \
		IA8tree.h  \
		IA4tree.h \
		I8grid.h \
		CI8mario.h \
		CI4mario.h \
		RGBA16checkMM.h \
		RGBA16check1MM.h \
		RGBA16treeMM.h \
		RGBA16foliageMM.h \
		RGBA16mario.h \
		RGBA32mario.h \
		RGBA16gridMM.h \
		I8checkMM.h

HFILES =	$(TEXHFILES) spin.h

CODEFILES   =	spin.c		\
		vect.c          \
		track.c		\
		fly.c		\
		asin.c

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

DATAFILES   =	dynamic.c	\
		zbuffer.c	\
		init.c		\
		models.c	\
		cfb.c		\
		texture.c

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

CODESEGMENT =	codesegment.o

OBJECTS =	$(CODESEGMENT) $(DATAOBJECTS)

LCDEFS =        $(HW_FLAGS)
LCINCS =	-I. -I./DB -I$(ROOT)/usr/include/PR -I $(ROOT)/usr/include
LCOPTS =	-fullwarn -non_shared -G 0

LDIRT  =	$(APP) spin $(TEXHFILES) *.so

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

default:	$(TARGETS)


include $(COMMONRULES)

RGB2CO =	$(ROOT)/usr/sbin/rgb2c


#
# what does it mean to 'install' this thing?
#
install:	default
		$(INSTALL) -m 444 -F /usr/src/PR/demos/spin README spinit rom spintcl.so
		$(INSTALL) -m 555 -F /usr/src/PR/demos/spin spinit
		cd ui; make install; cd ..


$(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.
#
spin.o: $(TEXHFILES)

$(OBJECTS): $(HFILES)

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

#
#  Make texture files
#
RGBA16molecule.h: Texture/molecule.rgba
	$(RGB2C) -m RGBA16molecule Texture/molecule.rgba > RGBA16molecule.h

RGBA16grid.h: Texture/grid.rgba
	$(RGB2C) -m RGBA16grid Texture/grid.rgba > RGBA16grid.h

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

IA16tree.h: Texture/tree32.rgba
	$(RGB2C) -f IA -s 16 -m IA16tree  Texture/tree32.rgba > IA16tree.h

IA8tree.h: Texture/tree32.rgba
	$(RGB2C) -f IA -s 8 -m IA8tree  Texture/tree32.rgba > IA8tree.h

IA4tree.h: Texture/tree32.rgba
	$(RGB2C) -f IA -s 4 -m IA4tree  Texture/tree32.rgba > IA4tree.h

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

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

I8grid.h: Texture/grid.rgba
	$(RGB2C) -f I -s 8 -m I8grid  Texture/grid.rgba > I8grid.h

CI8mario.h: Texture/mario.rgb
	cp Texture/CI8mario.h .
#	$(RGB2C) -f CI -s 8 -m CI8mario  Texture/mario.rgb > CI8mario.h

CI4mario.h: Texture/mario.rgb
#	cp Texture/CI4mario.h .
	$(RGB2C) -f CI -s 4 -m CI4mario  Texture/mario.rgb > CI4mario.h

RGBA16checkMM.h: Texture/check.rgba
#	cp Texture/RGBA16checkMM.h .
	$(RGB2CO) -f RGBA -s 16 -m RGBA16checkMM -o MIP Texture/check.rgba > RGBA16checkMM.h

RGBA16check1MM.h: Texture/check1.rgba
#	cp Texture/RGBA16check1MM.h .
	$(RGB2CO) -f RGBA -s 16 -m RGBA16check1MM -o MIP Texture/check1.rgba > RGBA16check1MM.h

I8checkMM.h: Texture/check1.rgba
	$(RGB2CO) -f I -s 8 -m I8checkMM -o MIP Texture/check1.rgba > I8checkMM.h

RGBA16treeMM.h :Texture/tree32.rgba
	$(RGB2C) -f RGBA -s 16 -m RGBA16treeMM -o MIP Texture/tree32.rgba > RGBA16treeMM.h
#	cp Texture/RGBA16treeMM.h .

RGBA16foliageMM.h :Texture/foliage4.rgb
	$(RGB2C) -f RGBA -s 16 -m RGBA16foliageMM -o MIP Texture/foliage4.rgb > RGBA16foliageMM.h
#	cp Texture/RGBA16foliageMM.h .

RGBA16mario.h: Texture/mario64.rgb
	$(RGB2C) -f RGBA -s 16 -m RGBA16mario Texture/mario64.rgb > RGBA16mario.h

RGBA32mario.h: Texture/mario.rgb
	$(RGB2C) -f RGBA -s 32 -m RGBA32mario Texture/mario.rgb > RGBA32mario.h

RGBA16gridMM.h: Texture/grid.rgba
	$(RGB2C) -f RGBA -s 16 -m RGBA16gridMM -o MIP  Texture/grid.rgba > RGBA16gridMM.h
#
# Files specific to Hardware/Emulator
#

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

#
#  Make TCL library
#
spintcl.so: spintcl.o callback.o gen_dl.o driverd.o
	$(LD) -o spintcl.so -shared -no_unresolved spintcl.o callback.o gen_dl.o driverd.o \
	 -L $(TOOLROOT)/usr/IRIXpro/lib -lX11 -lc -lm -ltcl -L $(ROOT)/usr/lib -lultrahost

spintcl.o: spintcl.c spincontrol.h
	$(CC) -c $(LCINCS) $(LCDEFS) -I$(TOOLROOT)/usr/IRIXpro/include spintcl.c

driverd.o: driverd.c
	$(CC) -c $(LCINCS) $(LCDEFS) driverd.c

callback.o: callback.c
	$(CC) -c $(LCINCS) $(LCDEFS) -I$(TOOLROOT)/usr/IRIXpro/include callback.c

gen_dl.o: gen_dl.c spincontrol.h
	$(CC) -c $(LCINCS) $(LCDEFS) -I$(TOOLROOT)/usr/IRIXpro/include gen_dl.c