Makefile 2.64 KB
# --------------------------------------------------------------------
#        Copyright (C) 1997 Nintendo. (Originated by SGI)
#        
#        $RCSfile: Makefile,v $
#        $Revision: 1.1.1.1 $
#        $Date: 2002/05/02 03:27:21 $
# --------------------------------------------------------------------
include $(ROOT)/usr/include/make/PRdefs

APP =		space

OPTIMIZER =	-O

TARGETS =	rom

MVTOPT =	-DMVTVIEW
MVTFILES =	mvtview.c

HFILES =	space.h audio.h gfx.h misc.h spacerom.h \
		gfx_tri.h gfx_vtx.h matrix.h vector.h

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

SPECIFICCODEFILES =	main.c space.c audio.c matrix.c vector.c \
		${MVTFILES}
SCODEOBJECTS =	$(SPECIFICCODEFILES:.c=.o)

CODESEGMENT =	codesegment.o

MODELFILES =	enterprise.c

DATAFILES =	gfxdynamic.c gfxzbuffer.c gfxinit.c gfxstatic.c gfxcfb.c \
		gfxyield.c ${MODELFILES}


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

OBJECTS =	$(CODESEGMENT) $(DATAOBJECTS)

#if defined(DBG_FLAG) && $(DBG_FLAG) == "-D_NON_DEBUG"
    DFLAG = -DNDEBUG
    ULTRALIB = ultra
#else
    DFLAG = -D_DEBUG
    ULTRALIB = ultra_d
#endif

LCINCS =	-I. -I$(ROOT)/usr/include/PR 
LCOPTS =	$(DFLAG) $(MVTOPT) $(SMALLCFBOPT) -fullwarn -non_shared -G 0

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

LDIRT =		$(APP) sphere17.h sphere17.c sphere12.h sphere12.c sphere10.h sphere10.c \
		makesphere ./sp_background.h ./mahogany.h \
		Texture/background_bms.h Texture/background_imgs.h load.map

default:	$(TARGETS)

include $(COMMONRULES)

install:	default
		$(INSTALL) -m 444 -F /usr/src/PR/demos/space\
			$(HFILES) $(CODEFILES) $(SPECIFICCODEFILES) \
			$(DATAFILES) Makefile spec log.fmt

$(CODESEGMENT):	$(CODEOBJECTS) $(SCODEOBJECTS)
		$(LD) -m -o $(CODESEGMENT) -r $(CODEOBJECTS) \
			$(SCODEOBJECTS) $(LDFLAGS) > load.map

rom $(APP):	spec $(OBJECTS) $(MAKEROM)
		$(MAKEROM) $(MVTOPT) spec

16bit:		clean
		$(MAKE) SMALLCFBOPT=-DCFB_16_BIT rom

main.o:		./sp_background.h

gfxstatic.o:	./sphere10.c ./sphere12.c ./sphere17.c ./mahogany.h

./mahogany.h: Texture/mahogany.rgb $(RGB2C)
		$(RGB2C) -m mahogany -f IA Texture/mahogany.rgb > mahogany.h

./sp_background.h: Texture/SpaceBackground.rgb
		cd Texture; $(MKSPRITE) background SpaceBackground.rgb 160 6 0 > ../sp_background.h

makesphere:	makesphere.c
		$(CC) -o makesphere makesphere.c -lm

./sphere10.c:	makesphere
		makesphere -S 256 -T 512 -r 10 > sphere10.h
		makesphere -S 256 -T 512 -r 10 -t > sphere10.c

./sphere12.c:	makesphere
		makesphere -S 256 -T 512 -r 12 > sphere12.h
		makesphere -S 256 -T 512 -r 12 -t > sphere12.c

./sphere17.c:	makesphere
		makesphere -S 256 -T 512 -r 17 > sphere17.h
		makesphere -S 256 -T 512 -r 17 -t > sphere17.c