Makefile 949 Bytes
#

PRDEPTH = ../../..
include $(PRDEPTH)/PRdefs

IOSIMLIB	= ../libiosim.a


TARGETS = si_test si_testr


CFILES	= si_test.c

#
# C Flags
#
LCINCS	= -I. -I$(ROOT)/usr/include -I$(ROOT)/usr/include/PR
# possible -D defines: DEBUG, CHATTY
LCOPTS	= -g -Wall -W -DDEBUG -DCHATTY
LCFLAGS = $(LCOPTS) $(LCINCS)
CC=$(HOST_CC)

#
# Linker Flags
#
LLDLIBS	= $(IOSIMLIB)

SIMRUN = sim.ipc +vcs+lic+wait +cpu_mon +cbus_mon +io_mon
ifdef SIMIPC_OUT
SIMRUN += > $(SIMIPC_OUT)
endif

TESTRUN = si_test -q
ifdef SI_TEST_LOG
TESTRUN += -l $(SI_TEST_LOG)
endif
ifdef SI_TEST_OUT
TESTRUN += > $(SI_TEST_OUT)
endif

default: subdirs $(TARGETS)

subdirs: 
#	$(SUBDIRS_MAKERULE)

include $(COMMONRULES)

si_test: $(OBJECTS) $(IOSIMLIB)
	$(CC) -o $@ $^ $(SUBDIR_OBJS) $(SUBDIR_LIBS) $(LLDLIBS)

si_testr: si_testr.o $(IOSIMLIB)
	$(CC) -o $@ si_testr.o $(LLDLIBS)

run: default
	cd $(BBROOT)/hw/chip/vsim; $(SIMRUN) &
	$(TESTRUN)

.c.o:
	$(CC) $(LCFLAGS) -c $<