GNUmakefile 3.21 KB
#!smake -k
#
# Makefile for Go/No-go diagnostic 
#
include $(ROOT)/usr/include/make/PRdefs

include ../gngdefs

APP =		gng

OPTIMIZER =	-g -O2

TARGETS =	bbgng 

HFILES =	controller.h gng.h

ifdef dvt_board
     LCINCS += -DDVT_BOARD
endif

ifdef dvt_burn
     LCINCS += -DDVT_BURN
endif

ifdef dvt_system
     LCINCS += -DDVT_SYSTEM
endif

ifdef bb_breakout
     LCINCS += -DBB_BREAKOUT
endif

ifdef bb_dummy
     LCINCS += -DBB_DUMMY
endif

#RDRAMTEST_LASOPTS=-Wab,-mips3 -Wab,-diag -non_shared -coff -G 0
#RDRAMTEST_LDFLAGS =-allow_jump_at_eop -coff -N -T A4000000 -G 0
RDRAMTEST_LASOPTS=-Wab,$(MIPSI) -Wab,-diag -non_shared -G 0
RDRAMTEST_LDFLAGS =-N -Ttext A4000000 -G 0

#
# main.c MUST be first, so that the boot() function is the first function in
#        the module.
#
CODEFILES =	main.c controller.c  testDriver.c  \
	 	audiotest.c intcheck.c bb_test.c bb_dummy.c graph.c asci.c

CODEOBJECTS =	$(CODEFILES:.c=.o) int1.o

OTHEROBJS = 	../audio/audio.o \
		../gng_report/gng_report.o \
		../gng_report/font.o \
		../rdp/rdpCodeSegment.o \
		../rsp/rsp.o \
		../uji/ujiCodeSegment.o \
		../video/vi.o

CODESEGMENT =   testDriverCodeSegment.o

DATAFILES =	cfb.c cfb_dash.c cfb_testarea.c
DATAOBJECTS =	$(DATAFILES:.c=.o) rdp/rdpStaticSegment.o

BOOTFILES =     boot.c
BOOTOBJECTS =   $(BOOTFILES:.c=.o)
BOOTSEGMENT =   bootsegment.o

OBJECTS =	$(CODESEGMENT) $(DATAOBJECTS) rdramTest.o

LASINCS =	-I$(ROOT)/usr/include/PR -I$(ROOT)/usr/include
LDIRT  =	$(APP) boot load.map \

#LCOPTS += -woff 835

#LDFLAGS =	$(MKDEPOPT) -nostdlib -L$(ROOT)/usr/lib -L$(ROOT)/usr/lib/PR \
#		-l$(ULTRALIB)
LDFLAGS =	$(MKDEPOPT)  -L$(ROOT)/usr/lib -L$(ROOT)/usr/lib/PR \
		-l$(ULTRALIB) -lgcc --no-warn-mismatch

default:	$(TARGETS)

include $(COMMONRULES)

install:	default

$(CODESEGMENT):	$(CODEOBJECTS) $(OTHEROBJS)
		$(LD) -o $(CODESEGMENT) -r $(CODEOBJECTS) \
		    $(OTHEROBJS) $(LDFLAGS)

$(BOOTSEGMENT): $(BOOTOBJECTS)
#		$(LD) -m -o $(BOOTSEGMENT) -r $(BOOTOBJECTS) $(LDFLAGS) > load.map
		$(LD) --print-map -o $(BOOTSEGMENT) -r $(BOOTOBJECTS) $(LDFLAGS) > load.map

$(OBJECTS): $(HFILES)

boot.o:

rom $(APP):	spec $(OBJECTS) $(MAKEROM) $(BOOTSEGMENT) 
#		$(MAKEROM) $(MAKEROMDEFS) -o -m spec >load.map
		$(MAKEROM) $(MAKEROMDEFS) -o -m spec >load.map

pvt: rom
	make clobber
	make 
	./skrom rom _rom
	dd if=_rom of=../00000000.rom bs=16384 conv=sync
	../../boot/bundleBootapp ../00000000.rom bbgng.aes bbgng.tik
	cat ../../sk/sk.aes > ../00000000.app
	cat bbgng.tik >> ../00000000.app
	cat bbgng.aes >> ../00000000.app

bbgng:    rom
	make clobber
	make dvt_board=1 rom
	cp rom ../bb_manf_board.n64
	./skrom rom _rom
	dd if=_rom of=../bb_manf_board.rom bs=16384 conv=sync
	make clobber
	make dvt_burn=1 rom
	cp rom ../bb_manf_sys.n64
	./skrom rom _rom
	dd if=_rom of=../bb_manf_sys.rom bs=16384 conv=sync
	rm -rf _rom
	make clobber
	make dvt_system=1 rom
	cp rom ../bb_manf_oqc.n64
	./skrom rom _rom
	dd if=_rom of=../bb_manf_oqc.rom bs=16384 conv=sync
	rm -rf _rom
	make clobber
	make bb_breakout=1 rom
	cp rom ../breakout_manf_sys.n64
	./skrom rom _rom
	dd if=_rom of=../breakout_manf_sys.rom bs=16384 conv=sync
	rm -rf _rom
	make clobber
	make bb_dummy=1 rom
	cp rom ../dummy_manf_sys.n64
	./skrom rom _rom
	dd if=_rom of=../dummy_manf_sys.rom bs=16384 conv=sync
	rm -rf _rom