Makefile.dos.n 1.19 KB
# command names #
LIB		= $(ROOT)/usr/lib
LPR		= $(LIB)/PR
INC		= $(ROOT)/usr/include
RM		= del
CC		= gcc
LD		= ld
MAKEROM		= mild

# compile C files to object files #
.c.o:
	$(CC) $(DEFINES) -O0 -g -G 0 -c -I. -I$(INC) -I$(INC)/PR -D_MIPS_SZLONG=32 -D_MIPS_SZINT=32 $<

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

# files to be made..
CODESEGMENT	= n_test_wave.o
APP		= simple.out
TARGETS		= simple.n64
CODEFILES	= test_main.c test_music.c
CODEOBJECTS	= $(CODEFILES:.c=.o)
DATAFILES	= test_workspace.c
DATAOBJECTS	= $(DATAFILES:.c=.o)
OBJECTS		= $(CODESEGMENT) $(DETAOBJECTS)

# default settings for compilation and linking #
LDFLAGS = $(MKDEPOPT) -L$(LIB) -ln_gmus_d -ln_gaudio_sc -lgultra_d -L$(GCCDIR)/mipse/lib -lkmc
DEFINES = -D_DEBUG

default:	$(TARGETS)

include $(FILE_DEPENDS)

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

# generate stand alone test rom #
$(TARGETS):	$(FILE_MAKEROM) $(CODESEGMENT) $(DATAOBJECTS)
	@echo "Making rom"
	$(MAKEROM) $(FILE_MAKEROM) -r $(TARGETS) -e $(APP)

# remove generated output files #
remove:
	$(RM) *.o
	$(RM) $(APP)
	$(RM) $(TARGETS)