Makefile 4.67 KB
#!smake -k
#
# Makefile for Go/No-go rdp display list checksum test
#
include $(ROOT)/usr/include/make/PRdefs

OPTIMIZER =	-g

TEXDIR =	Texture

TEXTURES =	${TEXDIR}/letters.rgb

TEXHFILES =	RGBA16dana.h    \
		RGBA16grid.h	\
		IA8phong.h      \
		RGBA16cbar.h	\
		IA4checker.h	\
		I4granite3.h	\
		I4luna.h	\
		I4haeberli_fixed.h	\
		IA4haeberli_fixed.h	\
		IA4Tymes-Elfin.h	\
		I4Tymes-Elfin.h

HFILES =	dldriver.h

#
# These header files are generated by the programs mka5tex, mkrandtex, & cases
#
MKA5TEXFILES =	map_a5.h map_5a.h

MKRANDTEXFILES =map_rand.h map_rand_comp.h map_rand32.h map_cs16_rand.h

CASESFILES =	rdpcov_case_edge_00.h rdpcov_case_vertex_00.h \
		rdpcov_case_skinny_00.h rdpcov_case_tiny_00.h \
		rdpcov_case_disc_00.h


GENHFILES = 	$(MKA5TEXFILES) $(MKRANDTEXFILES) $(CASESFILES)

CODEFILES =	dldriver.c toplevel.c cs.c tm.c tc.c tf.c cc.c bl.c ms.c \
		rdpatt.c rdpcov.c

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

DATAFILES =	init.c cs_static.c tm_static.c tc_static.c \
		tf_static.c cc_static.c bl_static.c ms_static.c texture.c \
		rdpatt_static.c rdpcov_static.c

DATAOBJECTS =	$(DATAFILES:.c=.o)

OBJECTS =	$(CODEOBJECTS) $(DATAOBJECTS)

STATIC_SEGMENT =	rdpStaticSegment.o
CODESEGMENT =		rdpCodeSegment.o

LCINCS =	-I. -I$(ROOT)/usr/include/PR -I$(ROOT)/usr/include \
		-I../testDriver

LCOPTS =	-fullwarn -non_shared -G 0 -woff 516

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

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

LCDEFS =

default:	$(CODESEGMENT) $(STATIC_SEGMENT)

include $(COMMONRULES)

install:	default

$(OBJECTS): $(HFILES)

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

$(STATIC_SEGMENT): $(DATAOBJECTS)
		$(LD) -o $(STATIC_SEGMENT) -r $(DATAOBJECTS)

rdpatt.o:	rdpatt.c $(TEXHFILES) rdpatt.h dldriver.h

rdpcov_static.o: rdpcov_static.c $(GENHFILES) $(TEXHFILES) rdpatt.h dldriver.h

rdpatt_static.o: rdpatt_static.c $(TEXHFILES) rdpatt.h dldriver.h

dldriver.o:	dldriver.c $(GENHFILES) $(TEXHFILES) checksum.h \
		../testDriver/controller.h dldriver.h

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

cs_static.o: cs_static.c cs.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
#
mka5tex: mka5tex.c
	$(CC) -o mka5tex mka5tex.c

#
# mka5tex makes both map_a5.h and map_5a.h
#
map_a5.h: mka5tex
	./mka5tex

map_5a.h: mka5tex
	./mka5tex

#
# mkrandtex makes map_rand, map_rand_comp.h, map_rand32.h, & map_cs16_rand.h
#
mkrandtex: mkrandtex.c
	$(CC) -o mkrandtex mkrandtex.c

map_rand.h: mkrandtex
	./mkrandtex

map_rand_comp.h: mkrandtex
	./mkrandtex

map_rand32.h: mkrandtex
	./mkrandtex

map_cs16_rand.h: mkrandtex
	./mkrandtex

RGBA16dana.h: $(TEXDIR)/dana_tiny.rgb
	$(RGB2C) -m RGBA16dana $(TEXDIR)/dana_tiny.rgb > RGBA16dana.h

RGBA16grid.h: $(TEXDIR)/grid.rgb
	$(RGB2C) -m RGBA16grid $(TEXDIR)/grid.rgb > RGBA16grid.h

IA8phong.h: $(TEXDIR)/phong.rgba
	$(RGB2C) -m IA8phong -s 8 -f IA $(TEXDIR)/phong.rgba > IA8phong.h

RGBA16cbar.h: $(TEXDIR)/colorbar.rgb
	$(RGB2C) -m RGBA16cbar $(TEXDIR)/colorbar.rgb > RGBA16cbar.h

IA4checker.h: $(TEXDIR)/checker.rgb
	$(RGB2C) -f IA -s 4 -m IA4checker $(TEXDIR)/checker.rgb > IA4checker.h

I4granite3.h: $(TEXDIR)/granite.3.bw
	$(RGB2C) -f I -s 4 -m I4granite3 $(TEXDIR)/granite.3.bw > I4granite3.h

I4luna.h: $(TEXDIR)/luna.rgb
	$(RGB2C) -f I -s 4 -m I4luna $(TEXDIR)/luna.rgb > I4luna.h

I4haeberli_fixed.h: $(TEXDIR)/haeberli_fixed.bw
	$(RGB2C) -f I -s 4 -m I4haeberli_fixed $(TEXDIR)/haeberli_fixed.bw > I4haeberli_fixed.h

IA4haeberli_fixed.h: $(TEXDIR)/haeberli_fixed.bw
	$(RGB2C) -f IA -s 4 -m IA4haeberli_fixed $(TEXDIR)/haeberli_fixed.bw > IA4haeberli_fixed.h

IA4Tymes-Elfin.h: $(TEXDIR)/Tymes-Elfin.bw
	$(RGB2C) -f IA -s 4 -m IA4Tymes_Elfin $(TEXDIR)/Tymes-Elfin.bw > IA4Tymes-Elfin.h

I4Tymes-Elfin.h: $(TEXDIR)/Tymes-Elfin.bw
	$(RGB2C) -f I -s 4 -m I4Tymes_Elfin $(TEXDIR)/Tymes-Elfin.bw > I4Tymes-Elfin.h

rdpcov_case_edge_00.h:	cases
	./cases -w 0

rdpcov_case_vertex_00.h:	cases
	./cases -w 1

rdpcov_case_skinny_00.h:	cases
	./cases -w 2

rdpcov_case_tiny_00.h:	cases
	./cases -w 3

rdpcov_case_disc_00.h:	cases
	./cases -w 4

#
# The program to build the above include files...
#
cases:	cases.c
	$(CC) -o $@ cases.c -lm