GNUmakefile 3.85 KB
#!smake -k
# --------------------------------------------------------------------
#        Copyright (C) 1997 Nintendo. (Originated by SGI)
#        
#        $RCSfile: GNUmakefile,v $
#        $Revision: 1.1 $
#        $Date: 2003/04/04 17:27:09 $
# --------------------------------------------------------------------
#
# Makefile for RSP verification application test suite.
#
include $(ROOT)/usr/include/make/PRdefs

APP =		rspverif
APP_EM =	rspverif_em

OPTIMIZER =	-g

TARGETS =	rom

EMULATE	= 	$(ROOT)/usr/sbin/emulate

TEXHFILES =

HFILES =	rspverif.h texture.h controller.h
GENHFILES = 	map.h CI8ramp.h CI4ramp.h

CODEFILES =	rspverif.c main.c controller.c dram_stack.c dram_yield.c \
		rdp_output.c rdp_output_len.c
CODEOBJECTS =	$(CODEFILES:.c=.o)

DATAFILES =	zbuffer.c init.c static.c cfb.c texture.c
DATAOBJECTS =	 $(GENHFILES) $(DATAFILES:.c=.o)

CODESEGMENT =	codesegment.o

OBJECTS =	$(CODESEGMENT) $(DATAOBJECTS)

LCINCS =	-I. -I$(ROOT)/usr/include/PR -I $(ROOT)/usr/include
LCOPTS =	-Wall -non_shared -G 0 -mips2

LDIRT  =	$(APP) $(APP_EM) rspverif rspverif_em $(GENHFILES) \
		InData/test*Z $(TEXHFILES)

LDFLAGS =	$(MKDEPOPT) -L$(ROOT)/usr/lib -L$(ROOT)/usr/lib/PR \
		-lultra_d -lgcc

LCDEFS =

default:	$(TARGETS)

include $(COMMONRULES)

#
# what does it mean to 'install' this thing?
#
install:	default
		$(INSTALL) -m 444 -F /usr/src/PR/demos/rspverif Makefile spec \
			$(HFILES) $(CODEFILES) $(DATAFILES)

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

#
# This must depend on the generated h-files, which in turn depend
# on the cases utility. If we don't do this, smake fails.
#
texture.c: $(GENHFILES)

rom $(APP):	spec $(OBJECTS) $(MAKEROM)
		$(MAKEROM) -r rom spec

#
# Files specific to Hardware/Emulator
#

main.o: main.c
	$(CC) $(CFLAGS) $(LCDEFS) -c $< 

rspverif.o: rspverif.c
	$(CC) $(CFLAGS) $(LCDEFS) -c $< 

static.o: static.c
	$(CC) $(CFLAGS) $(LCDEFS) -c $< 

#
# ADD TEST CASE:
#
# Note: due to fopen() restrictions in the rsp simulator, the
# directory you send the output to must exist before running...
#

NIGHTLY_REGRESSION_TEST_ARCHIVE =

OTHER_TESTS_ARCHIVE =

NIGHTLY_REGRESSION_TESTS        = ${NIGHTLY_REGRESSION_TEST_ARCHIVE:R:R:R:R:T}
NIGHTLY_REGRESSION_TEST_TARGETS = ${NIGHTLY_REGRESSION_TEST_ARCHIVE:R}
OTHER_TESTS                     = ${OTHER_TESTS_ARCHIVE:R:R:R:R:T}
OTHER_TESTS_TARGETS             = ${OTHER_TESTS_ARCHIVE:R}
TESTS                           = ${OTHER_TESTS} ${NIGHTLY_REGRESSION_TESTS}

#
# Header file build rules
#

map.h: mktex.c
	$(HOST_CC) -o mktex mktex.c
	./mktex > map.h
	rm -rf mktex

CI8ramp.h: make_ci8_tex.c
	$(HOST_CC) -D_LANGUAGE_C -g -I$(ROOT)/usr/include -I$(ROOT)/usr/include/PR \
	    -o make_ci8_tex make_ci8_tex.c
	./make_ci8_tex $(LCDEFS) > CI8ramp.h
	rm -rf make_ci8_tex

CI4ramp.h: make_ci4_tex.c
	$(HOST_CC) -D_LANGUAGE_C -g -I$(ROOT)/usr/include -I$(ROOT)/usr/include/PR \
	    -o make_ci4_tex make_ci4_tex.c
	./make_ci4_tex $(LCDEFS) > CI4ramp.h
	rm -rf make_ci4_tex

#
# Anti-aliased
#
test000:                        InData/test000.0.rdp.Z

InData/test000.0.rdp.Z:        $(APP)
	$(EMULATE) -n -s -a "-m -a -o 0 -n InData/test000" $(APP) rom
	compress -f InData/test000*.rdp



tests:	$(TESTS)

#
# Run a smaller subset of the total test coverage on a nightly basis.
#
nightly_regression: $(NIGHTLY_REGRESSION_TESTS)

#
# Only checkin archived versions of the .rdp files on a periodic, 
# on-demand basis (e.g. whenever an RSP simulator/ucode change affects the 
# output files mumble.rdp).
#
# Otherwise we'll pollute the source tree with unnecessary copies
# of these data files.  The intent is to provide a way to resurrect data
# files for downstream simulation purposes whenever the output files generated
# by the rsp sim environment causes a hiccup downstream.
#
periodic_checkin: $(NIGHTLY_REGRESSION_TESTS)
	$(ROOT)/PR/tools/scripts/copyToArchive $(NIGHTLY_REGRESSION_TEST_TARGETS)