Makefile 1.68 KB
#

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

IOSIMLIB	= ../libiosim.a

SUBDIRS = ecc aes
SUBDIR_OBJS = ecc/pi_ecc.o
SUBDIR_LIBS = aes/pi_aes.a

TARGETS = pi_functest gen_ext_rand pi_bufdma pi_gp_ide_io

TESTS = ecc_test.c flash_io_test.c aes_test.c bufdma_test.c \
        atb_test.c bufpi_test.c reg_test.c gpio_test.c \
	md_ind_test.c acc_test.c ide_test.c

CFILES	= wrapper.c pi_functest.c $(TESTS) pi_util.c  atb_setup.c 

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

ifdef TOSHIBA_FLASH
LCOPTS += -DTOSHIBA_FLASH
endif

#
# Linker Flags
#
LLDLIBS	= $(IOSIMLIB)

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

TESTRUN = pi_functest -k -f $(BBROOT)/hw/chip/vsim/External_File.txt
ifdef PI_FUNCTEST_LOG
TESTRUN += -l $(PI_FUNCTEST_LOG)
endif
ifdef PI_FUNCTEST_OUT
TESTRUN += > $(PI_FUNCTEST_OUT) 2>&1
endif

default: subdirs $(TARGETS)

subdirs: 
	$(SUBDIRS_MAKERULE)

include $(COMMONRULES)

pi_functest: $(OBJECTS)
	$(HOST_CC) -o $@ $^ $(SUBDIR_OBJS) $(SUBDIR_LIBS) $(LLDLIBS)

gen_ext_rand: gen_flash_file.o
	$(HOST_CC) -o gen_ext_rand gen_flash_file.o $(SUBDIR_OBJS) $(SUBDIR_LIBS) $(LCFLAGS)

# for random testing framework
pi_bufdma: wrapper_bufdma.o bufdma_rand.o bufdma_test.o pi_util.o
	$(HOST_CC) -o $@ $^ $(SUBDIR_OBJS) $(SUBDIR_LIBS) $(LLDLIBS)

# for random testing framework
pi_gp_ide_io: wrapper.o gpio_rand.o gpio_test.o pi_util.o
	$(HOST_CC) -o $@ $^ $(SUBDIR_OBJS) $(SUBDIR_LIBS) $(LLDLIBS)

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

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