Makefile.sgi
1.17 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
# 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
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