Makefile 3.01 KB
#!smake -k
#
# Makefile for RDP verification application test suite.
#
include $(ROOT)/usr/include/make/PRdefs

TEXDIR =	$(ROOT)/PR/apps/rdpatt/Texture

APP =		rdpvector

OPTIMIZER =	-g

TARGETS =	rom rdpascii2rdram getimages

HFILES =	rdpvector.h controller.h
GENHFILES = 	map_a5.h map_5a.h map_rand.h map_rand_comp.h

CODEFILES =	main.c controller.c toplevel.c \
		cs.c ew.c st.c tm.c tc.c tf.c cc.c bl.c ms.c 
CODEOBJECTS =	$(CODEFILES:.c=.o)

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

DATAFILES =	zbuffer.c init.c cfb.c \
		cs_static.c ew_static.c st_static.c tm_static.c tc_static.c \
		tf_static.c cc_static.c bl_static.c ms_static.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 =	-fullwarn -non_shared -G 0 -woff 516

LDIRT  =	$(APP) boot load.map $(GENHFILES) \
		cases $(TEXHFILES)

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

LCDEFS =

default:	$(TARGETS)

include $(COMMONRULES)

install:	default
#		Doesn't really make sense to install this to /usr/src/PR...
#		$(INSTALL) -m 444 -F /usr/src/PR/rdpvector Makefile spec \
#			$(HFILES) $(CODEFILES) $(DATAFILES)

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

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

$(OBJECTS): $(HFILES)

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

#
# Tool to translate ascii dump of rdp into separately named .rdp binary files
#
rdpascii2rdram:	rdpascii2rdram.c
		cc -O $(LCINCS) -o rdpascii2rdram rdpascii2rdram.c

#
# Tool to extract image files from the running rdpvector application.
#
getimages:	getimages.c
		cc -O $(LCINCS) -L$(ROOT)/usr/lib \
		-o getimages getimages.c -lultrahost -limage

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

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

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

cs_static.o: cs_static.c cs.h
	$(CC) $(CFLAGS) $(LCDEFS) -c $< 

ew_static.o: ew_static.c ew.h
	$(CC) $(CFLAGS) $(LCDEFS) -c $< 

st_static.o: st_static.c st.h
	$(CC) $(CFLAGS) $(LCDEFS) -c $< 

tm_static.o: tm_static.c tm.h
	$(CC) $(CFLAGS) $(LCDEFS) -c $< 

tc_static.o: tc_static.c tc.h
	$(CC) $(CFLAGS) $(LCDEFS) -c $< 

tf_static.o: tf_static.c tf.h
	$(CC) $(CFLAGS) $(LCDEFS) -c $< 

cc_static.o: cc_static.c cc.h
	$(CC) $(CFLAGS) $(LCDEFS) -c $< 

bl_static.o: bl_static.c bl.h
	$(CC) $(CFLAGS) $(LCDEFS) -c $< 

ms_static.o: ms_static.c ms.h
	$(CC) $(CFLAGS) $(LCDEFS) -c $< 

texture.o: texture.c RGBA16checkerMM.h $(GENHFILES)
	$(CC) $(CFLAGS) $(LCDEFS) -c $< 

#
# Header file build rules
#

# mka5tex makes both map_a5.h and map_5a.h
map_a5.h: mka5tex.c
	$(CC) -o mka5tex mka5tex.c
	mka5tex
	rm -rf mka5tex

#k mkrandtex makes both map_rand and map_rand_comp.h
map_rand.h: mkrandtex.c
	$(CC) -o mkrandtex mkrandtex.c
	mkrandtex
	rm -rf mkrandtex