Makefile.sgi
1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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