Makefile.dos 1.17 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
FILE_DEPENDS	= Makefile.depend

# files to be made..
CODESEGMENT	= 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) -lgmus_d -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)