Makefile 2.25 KB
#! smake
#---------------------------------------------------------------------
#	Copyright (C) 1997, Nintendo.
#	
#	File		Makefile
#	Coded    by	Yoshitaka Yasumoto.	Mar 19, 1997.
#	Modified by	
#	Comments	
#	
#	$Id: Makefile,v 1.1.1.1 2002/05/02 03:27:17 blythe Exp $
#---------------------------------------------------------------------

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

APP =		sample
OPTIMIZER =	-g

TARGETS =	rom
CODEFILES =	system.c main.c uc_assert.c action.c sprite.c
CODEOBJECTS =	$(CODEFILES:.c=.o)
CODESEGMENT =	codesegment.o

STATICFILES =	static.c texture.c sprite_ball.c
STATICOBJECTS =	$(STATICFILES:.c=.o)
STATICSEGMENT =	staticsegment.o

BGFILES =	L2_TV.c
BGOBJECTS =	$(BGFILES:.c=.o)

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

CFILES =	$(CODEFILES) $(STATICFILES) $(DATAFILES)
HFILES =	action.h sprite.h system.h texture.h texture_pattern.h \
		uc_assert.h

OBJECTS =	$(CODESEGMENT) $(STATICSEGMENT) $(DATAOBJECTS) $(BGOBJECTS)

MAPFILE =	load.map

LCINCS  =	-I. -I$(ROOT)/usr/include/PR
LCOPTS  =	-fullwarn -wlint,-f -woff 813,819,826,827,852 \
		-non_shared -G 0 -Xcpluscomm

#LCDEFS  =	-DDEBUG -DF3DEX_GBI
#LCDEFS  =	-DDEBUG -DF3DEX_GBI -DRSP_DEBUG
LCDEFS  =	-DDEBUG -DF3DEX_GBI_2
#LCDEFS  =	-DDEBUG -DF3DEX_GBI_2 -DXBUS

LDIRT   =	$(APP) *.dat *.dbg *.lst *.sym *~ $(MAPFILE) \
		Makedepend L2_TV.rgba5551 L2_TV.ppm L2_TV.c rgb2u64
LDFLAGS =	$(MKDEPOPT) -nostdlib -L$(ROOT)/usr/lib -lultra_d

default:	$(TARGETS)

include $(COMMONRULES)

install:	default
		$(INSTALL) -m 444 -F /usr/src/PR/demos/gs2dex2 \
			$(HFILES) $(CFILES) rgb2u64.c L2_TV.rgb \
			Makefile spec ppm8to5.perl ppmtoCI.perl

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

$(STATICSEGMENT): $(STATICOBJECTS)
		$(LD) -o $(STATICSEGMENT) -r $(STATICOBJECTS) $(LDFLAGS)

rom:		spec $(OBJECTS) L2_TV.rgba5551
		$(MAKEROM) $(LCDEFS) -m -r rom spec > $(MAPFILE)

rgb2u64:	rgb2u64.c
		$(CC) rgb2u64.c -o rgb2u64 -limage

L2_TV.rgba5551:	L2_TV.rgb rgb2u64
		rgb2u64 L2_TV.rgb 328 240 > L2_TV.rgba5551

L2_TV.c:	L2_TV.rgb ppmtoCI.perl ppm8to5.perl
		toppm L2_TV.rgb L2_TV.ppm
		perl ppm8to5.perl < L2_TV.ppm | \
		$(ROOT)/usr/sbin/ppmquant 255 | \
		perl ppmtoCI.perl 328 240 L2_TV 1 > L2_TV.c
		rm L2_TV.ppm

#======== End of Makefile ========