Makefile 2.66 KB
#!smake -k
#
# Makefile for topgun demo application 
#
#
#


DDPROCDIR = ../ddproc
PRDEPTH = ../../..
include $(ROOT)/usr/include/make/PRdefs

#FINAL =

#ifdef FINAL
OPTIMIZER       = -O2
LCDEFS          =
N64LIB          =  -lleo -lultra_rom
ARGS            = FINAL=  
#else
OPTIMIZER       = -g
LCDEFS          = -DDEBUG
N64LIB          =  -lleo_d -lultra_d
#endif

APP =		topgun

TARGETS =	topgun.rom

TEXHFILES =	ground.h sky.h tree.h
TEXTURES =	Textures/clouds.rgb Textures/harrier_num.rgba \
		Textures/stree1.rgba  Textures/terrain.rgb \
		Textures/camo2.int Textures/decal.inta

MODELS =	Models/av8b.flt

HFILES =	topgun.h herr.h hmenu.h

CODEFILES   =	topgun.c dram_stack.c rdp_output.c rdp_output_len.c \
				dd_proc.c dd_rtc.c dd_summon.c err.c \
				menu.c

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

DATAFILES   =	av8b.c		\
		cfb.c		\
		ground.c	\
		static.c	\
		zbuffer.c   

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

DDPROCOBJECT = ddproc.o

CODESEGMENT =	codesegment.o

OBJECTS =	$(CODESEGMENT) $(DATAOBJECTS)

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

LDIRT  =	$(APP) $(TARGETS) av8b.c av8b.h $(TEXHFILES) Makedepend

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

default:	$(TARGETS)

include $(COMMONRULES)

install:	default
		$(INSTALL) -m 444 -F /usr/src/PR/demos/reboot/topgun	\
			Makefile spec $(HFILES) $(CODEFILES)	\
			cfb.c ground.c static.c zbuffer.c	\
			$(TEXTURES) $(MODELS)

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

#ifdef FINAL
$(TARGETS) $(APP):      spec $(OBJECTS)
	$(MAKEROM) -s 9 -r $(TARGETS) -B 0 spec
#ifndef NOMAKEMASK
	makemask $(TARGETS)
#endif
#else
$(TARGETS) $(APP):      spec $(OBJECTS)
	$(MAKEROM) -r $(TARGETS) -B 0 spec
#endif

ddproc.o : $(DDPROCDIR)/ddproc.o
	cp $(DDPROCDIR)/ddproc.o .

$(DDPROCDIR)/ddproc.o !
	(cd $(DDPROCDIR);$(MAKE) START_FROM_CASSETTE= $(ARGS)); 

av8b.c:		Models/av8b.flt Textures/harrier_num.rgba Textures/camo2.int \
			Textures/decal.inta $(FLT2C)
		$(FLT2C) -m av8b -s 10 -C 1 1 1 -L 1.0 0.0 0.0 \
		-r G_RM_AA_ZB_OPA_SURF G_RM_AA_ZB_OPA_DECAL Models/av8b.flt > av8b.c

# This rule has to be here because they need to be created if Makedepend
# doesn't exist:
ground.o:       sky.h ground.h tree.h

sky.h:          Textures/clouds.rgb $(RGB2C)
		$(RGB2C) -m tex_sky -f IA -s 16 Textures/clouds.rgb >sky.h

ground.h:       Textures/terrain.rgb $(RGB2C)
		$(RGB2C) -m tex_ground -f RGBA -l 100,50,0 -h 0,50,0 \
                        Textures/terrain.rgb >ground.h

tree.h:         Textures/stree1.rgba $(RGB2C)
		$(RGB2C) -m tex_tree -f IA -s 4 Textures/stree1.rgba >tree.h