GNUmakefile 2.06 KB
#!smake -k
# --------------------------------------------------------------------
#        Copyright (C) 1997,1998 Nintendo. (Originated by SGI)
#        
#        $RCSfile: GNUmakefile,v $
#        $Revision: 1.1 $
#        $Date: 2003/04/08 01:03:05 $
# --------------------------------------------------------------------
#
# Makefile for tile_rect demo application 
#
#

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

#FINAL =

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

APP =		tile_rect

TARGETS =	rom

ROADHFILES = ./rd01.h ./rd02.h ./rd03.h ./rd04.h ./rd05.h ./rd06.h
CAFEHFILES = ./cv01.h ./cv03.h ./cv04.h ./cv05.h ./cv06.h
WORLDHFILES = ./world01.h ./world02.h ./world03.h ./world04.h	\
		./world05.h ./world06.h

TEXHFILES =	$(ROADHFILES) $(CAFEHFILES) $(WORLDHFILES)

HFILES =	$(TEXHFILES) tile_rect.h controller.h cafe.h road.h world.h

CODEFILES   =	main.c tile_rectangle.c controller.c dram_stack.c

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

DATAFILES   =	static.c cfb.c rsp_cfb.c cafe.c road.c world.c

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

CODESEGMENT =	codesegment.o

OBJECTS =	$(CODESEGMENT) $(DATAOBJECTS)

LCDEFS +=	$(HW_FLAGS)
LCINCS =	-I.
LCOPTS =	-Wall -non_shared -G 0 -mips2
LDFLAGS =	$(MKDEPOPT) -L$(ROOT)/usr/lib $(N64LIB) -lgcc

LDIRT  =	$(APP) $(TEXHFILES)

default:	$(TARGETS)

include $(COMMONRULES)

install:	default
		$(INSTALL) -m 444 -F /usr/src/PR/demos/$(APP)3d \
			$(CODEFILES) $(DATAFILES) Makefile spec *.rgb	\
			tile_rect.h controller.h cafe.h road.h world.h

cafe.o:	$(CAFEHFILES)

road.o:	$(ROADHFILES)

world.o: $(WORLDHFILES)

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

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

.SUFFIXES: .rgb .h

.rgb.h:
	$(RGB2C) -F -s 16 -m RGBA16$(*F) $^ > $@