Makefile 2.5 KB
#! smake
#---------------------------------------------------------------------
#	Copyright (C) 1997, Nintendo.
#	
#	File		Makefile
#	Coded    by	Yoshitaka Yasumoto.	Mar 19, 1997.
#	Modified by	
#	Comments	
#	
#	$Id: Makefile,v 1.1.1.2 2002/10/29 08:05:54 blythe Exp $
#---------------------------------------------------------------------

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

#FINAL =

#ifdef FINAL
OPTIMIZER       = -O2
LCDEFS          = -DNDEBUG -D_FINALROM
N64LIB          = -lultra_rom
#else
OPTIMIZER       = -g
LCDEFS          = -DDEBUG
N64LIB          = -lultra_d
#endif

APP =		sample

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  +=	-DF3DEX_GBI

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 $(N64LIB)

default:	$(TARGETS)

include $(COMMONRULES)

install:	default
		$(INSTALL) -m 444 -F /usr/src/PR/demos/gs2dex \
			$(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)

#ifdef FINAL
$(TARGETS):	spec $(OBJECTS) L2_TV.rgba5551
	$(MAKEROM) $(LCDEFS) -m -s 9 -r $(TARGETS) spec > $(MAPFILE)
#ifndef NOMAKEMASK
	makemask $(TARGETS)
#endif
#else
$(TARGETS):	spec $(OBJECTS) L2_TV.rgba5551
	$(MAKEROM) $(LCDEFS) -m -r $(TARGETS) spec > $(MAPFILE)
#endif

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 ========