GNUmakefile 1.86 KB
#
# Makefile for RSP simulator
#

include $(ROOT)/usr/include/make/commondefs

#CVERSION = -xansi
CVERSION=
GCINCS=-D_LANGUAGE_C -I$(ROOT)/host_include
GLDOPTS=
OPTIMIZER = -g

# local options
#LCOPTS = -mips2
# local defs
#LCDEFS = -I${ROOT}/usr/include -I${ROOT}/usr/include/PR
LCDEFS = -I${ROOT}/PR/  -I${ROOT}/host_include/PR
# local includes
#LCINCS = std_input.h std_output.h std_cmds.h std_visual.h		\
	rsp.h rspctl.h memory.h cop0.h dcache.h icache.h su.h vu.h	\
	opcode.h disasm.h i128.h trace_print.h

CFILES = std_main.c std_input.c std_output.c std_cmds.c \
	i128.c rspctl.c memory.c cop0.c dcache.c icache.c disasm.c su.c	\
	vu.c vadd.c vdiv.c vmult.c vpack.c vsel.c vldst.c vlogic.c vmove.c \
	trace_print.c std_shmem.c sema.c

LDLIBS = -lm

TARGETS = rsp ${rspg} rsp_ops

default:
	@$(MAKE) ${TARGETS}

exports install: ${TARGETS}
	$(INSTALL) -m 555 -F /usr/sbin $(TARGETS)

clean:
	/bin/rm -rf ${OBJECTS} std_gfx.o std_visual.o

clobber: clean
	/bin/rm -rf ${TARGETS} ${MKDEPFILE}

#
# touching std_main.c makes sure the compiled version reports the
# right compilation date.
#
rsp: ${OBJECTS} std_visual.o ${LCINCS}
	touch std_main.c
	make std_main.o
	$(CC) -o $@ ${OBJECTS} std_visual.o ${LDFLAGS} -lcurses

rspg: ${OBJECTS} std_gfx.o ${LCINCS}
	touch std_main.c
	make std_main.o
	$(CC) -o $@ ${OBJECTS} std_gfx.o ${LDFLAGS} -lgl

client:	client.o sema.o
	$(CC) -o $@ client.o sema.o

#
# rsp_ops is a utility program that dumps the disassembly table, showing
# you the entire command set in a nice fashion.
# The weird make rules (copying to a tmp file) are necessary to avoid a
# race condition when running smake (compiling rsp and rsp_ops at the same time)
#
rsp_ops:	disasm.c disasm.h
	cp disasm.c _tmpdisasm.c
	chmod ug+w _tmpdisasm.c
	$(CCF) -DDUMPMODE ${LCDEFS} -D_LANGUAGE_C -o $@ _tmpdisasm.c
	/bin/rm -f _tmpdisasm.c

# DO NOT DELETE THIS LINE -- make depend depends on it.