Makefile 1.56 KB
#! smake
#
#  NINTENDO64 SAMPLE PROGRAM
#
#  FILE : Makefile
#
#  Copyright (C) 1998, NINTENDO Co,Ltd.
#

#DBG_FLAG = 	-D_NON_DEBUG

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

APP =		sample

#if defined(DBG_FLAG) && $(DBG_FLAG) == "-D_NON_DEBUG"
  ULTRALIB = ultra_rom
  OPTIMIZER = -mips2 -O2
  MAKEROMDEFS = 
#else
  ULTRALIB = ultra_d
  OPTIMIZER = -g
  MAKEROMDEFS = -m
#endif

TARGETS =	rom

CODEFILES =	system.c main.c mysched.c audio.c  action.c\
		cursor.c bg.c   tile.c    puzzle.c sprite.c
CODEOBJECTS =	$(CODEFILES:.c=.o)
CODESEGMENT =	codesegment.o

STATICFILES = 	static.c 
STATICOBJECTS = $(STATICFILES:.c=.o)

OBJFILES =   	cursor_txtr.c
OBJOBJECTS = 	$(OBJFILES:.c=.o)

BGFILES = 	bg_txtr.c
BGOBJECTS = 	$(BGFILES:.c=.o)

STATICSEGMENT =	staticsegment.o

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

OBJECTS =	$(CODESEGMENT) $(DATAOBJECTS) $(STATICSEGMENT)

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  =	

LDIRT   =	$(APP) *.dat *.dbg *.lst *.sym *~ $(MAPFILE) \
		Makedepend

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

default:	$(TARGETS)

include $(COMMONRULES)

install:	default

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

$(STATICSEGMENT): $(STATICOBJECTS) $(OBJOBJECTS) $(BGOBJECTS)
		  $(LD)  -o $(STATICSEGMENT)\
			 -r $(STATICOBJECTS) $(OBJOBJECTS) $(BGOBJECTS) $(LDFLAGS)

rom:		spec $(OBJECTS)
		$(MAKEROM) $(MAKEROMDEFS) -r rom spec > $(MAPFILE)