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

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

# addition files used by make #
FILE_MAKEROM	= Makefile.makerom
FILE_DEPENDS	= Makefile.depend

# custom settings for compilation and linking #
OPTIMISE	= -O0 -g -mips2
DEFINES		= -D_DEBUG
LIBS		= -lmus_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
CODEOBJECTS 	= $(CODEFILES:.c=.o)
DATAFILES	= test_workspace.c
DATAOBJECTS	= $(DATAFILES:.c=.o)

default:        rom

include $(COMMONRULES)
include $(FILE_DEPENDS)

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

# generate stand alone test rom #
rom:	$(FILE_MAKEROM) $(CODESEGMENT) $(DATAOBJECTS)
	@echo "Making rom"
	$(MAKEROM) $(FILE_MAKEROM)

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

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