Makefile 1.78 KB
#!smake -k
# --------------------------------------------------------------------
#        Copyright (C) 1997,1998 Nintendo. (Originated by SGI)
#        
#        $RCSfile: Makefile,v $
#        $Revision: 1.1.1.2 $
#        $Date: 2002/10/29 08:06:04 $
# --------------------------------------------------------------------
#
# Makefile for application test case 'tron'
#

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

TARGETS =	rom

HFILES =	tron.h

CODEFILES =	tron.c dram_stack.c dram_yield.c
CODEOBJECTS =	$(CODEFILES:.c=.o)

DATAFILES =	dynamic.c zbuffer.c init.c cfb.c grid.c
DATAOBJECTS =	$(DATAFILES:.c=.o)

CODESEGMENT =	codesegment.o

OBJECTS =	$(CODESEGMENT) $(CODEOBJECTS) $(DATAOBJECTS)

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

LDIRT  =	$(APP) grid.c makegrid

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

SOURCES =	Makefile spec $(HFILES) $(CODEFILES) \
		dynamic.c zbuffer.c init.c cfb.c makegrid.c

default:	$(TARGETS)

include $(COMMONRULES)

install:	default
		$(INSTALL) -m 444 -F /usr/src/PR/demos/tron $(SOURCES)

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

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

grid.c:		makegrid
		./makegrid >grid.c

makegrid:	makegrid.c
		$(CC) -g makegrid.c -o makegrid

tron.o: tron.c
	$(CC) $(CFLAGS) -c $<