Makefile.sgi 1.24 KB
include $(ROOT)/usr/include/make/PRdefs

# command names #
RM		= rm -f
CC		= cc
LD		= ld

MAKEDISK	= /usr/sbin/makedisk

# addition files used by make #
FILE_MAKEDISK	= Makefile.makedisk
FILE_DEPENDS	= Makefile.depend

# custom settings for compilation and linking #
OPTIMISE	= -O0 -g -mips2
DEFINES		= -D_DEBUG -DDISK
LIBS		= -lmus_d -lleo_d -lultra_d

# default settings for compilation and linking #
CCOPTS = -Wab,-r4300_mul $(DEFINES) -fullwarn -non_shared -G 0 -Xcpluscomm -I/usr/include/PR  -I./
LDFLAGS = $(MKDEPOPT) -nostdlib -L$(ROOT)/usr/lib -L$(ROOT)/usr/lib/PR $(LIBS)

# files to be made..
CODESEGMENT	= test_wave.o
CODEFILES	= test_main.c test_music.c test_mem.o test_n64dd.o
CODEOBJECTS 	= $(CODEFILES:.c=.o)

default:        disk

include $(COMMONRULES)
include $(FILE_DEPENDS)

$(CODESEGMENT):	$(CODEOBJECTS)
	@echo "Linking code files"
	$(LD) -o $(CODESEGMENT) -r $(CODEOBJECTS) $(LDFLAGS)

# generate stand alone test rom #
disk:	$(FILE_MAKEDISK) $(CODESEGMENT)
	@echo "Making disk file 'gwrite'"
	$(MAKEDISK) -m -t 0 -r rom $(FILE_MAKEDISK) >test_rom.map

# remove generated output files #
remove:
	$(RM) *.o test_wave rom test_rom.map gwrite

# compile C files to object files #
.c.o:
	@echo Compiling ':' $*.c
	$(CC) $(CCOPTS) $(OPTIMISE) -c $*.c