Makefile
1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#
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 $<