forked from ArchC/MPSoCBench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.rules
115 lines (102 loc) · 3.94 KB
/
Makefile.rules
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
include platforms/$(PLATFORM)/defs.arp
ROOT=$(PWD)
export LIB_DIR:= `pkg-config --libs systemc archc` \
$(foreach ip, $(IP), -L $(ROOT)/ip/$(ip)) \
$(foreach is, $(IS), -L $(ROOT)/is/$(is)) \
$(foreach wrapper, $(WRAPPER), -L $(ROOT)/wrappers/$(wrapper)) \
$(foreach processor, $(PROCESSOR), -L $(ROOT)/processors/$(processor))
export INC_DIR:= `pkg-config --cflags systemc archc` \
$(foreach ip, $(IP), -I $(ROOT)/ip/$(ip)) \
$(foreach is, $(IS), -I $(ROOT)/is/$(is)) \
$(foreach wrapper, $(WRAPPER), -I $(ROOT)/wrappers/$(wrapper)) \
$(foreach processor, $(PROCESSOR), -I $(ROOT)/processors/$(processor))
export LIBS:= \
$(foreach processor, $(PROCESSOR), -l$(processor))\
$(foreach ip, $(IP), -l$(ip)) \
$(foreach is, $(IS), -l$(is))\
$(foreach wrapper, $(WRAPPER), -l$(wrapper)) \
-lsystemc -larchc -lm -lpowersc
export CFLAGS:=-ggdb2 -O2 -pthread -D$(SOFTWARE) -std=c++11
export CC:=g++
#------------------------------------------------------
.SILENT:
#------------------------------------------------------
all:
cd $(ROOT)
for processor in $(PROCESSOR); do \
echo Making Processor $$processor ...;\
cd processors/$$processor ; \
if [ ! -a Makefile ]; then \
$(ARCHC_PREFIX)/bin/acsim $${processor}_$(TRANSPORT).ac $(ACSIM_FLAGS) ; \
fi; \
$(MAKE) lib; \
cd $(ROOT); done
for ip in $(IP); do echo Making IP $$ip ...; \
cd ip/$$ip; $(MAKE) lib; cd $(ROOT); done
for is in $(IS); do echo Making IS $$is ...; \
cd is/$$is; $(MAKE) lib; cd $(ROOT); done
for wrapper in $(WRAPPER); do \
echo Making Wrapper $$wrapper ...; \
cd wrappers/$$wrapper; $(MAKE) lib; \
cd $(ROOT); done
for sw in $(SW); do \
echo Making Software $$sw ...; cd sw/$$sw; \
$(MAKE); cd $(ROOT); done
for sw in $(SW) ; do \
cp sw/$$sw/*.x platforms/$(PLATFORM) ; done
echo Making Platform $(PLATFORM)
cd platforms/$(PLATFORM); $(MAKE)
#------------------------------------------------------
clean:
cd $(ROOT)
for ip in $(IP) ; do cd ip/$$ip ; \
$(MAKE) clean ; cd $(ROOT); done
for is in $(IS) ; do cd is/$$is ; \
$(MAKE) clean ; cd $(ROOT); done
for wrapper in $(WRAPPER); do \
cd wrappers/$$wrapper; $(MAKE) clean; \
cd $(ROOT); done
for processor in $(PROCESSOR) ; do \
cd processors/$$processor ; \
if [ -a Makefile ]; then \
$(MAKE) clean; \
fi; \
cd $(ROOT); done
for sw in $(SW) ; do cd sw/$$sw ; \
$(MAKE) clean ; cd $(ROOT); done
for sw in $(SW) ; do \
rm -f platforms/$(PLATFORM)/*.x; cd $(ROOT); done
cd platforms/$(PLATFORM); $(MAKE) clean
#------------------------------------------------------
distclean:
cd $(ROOT)
for ip in $(IP) ; do cd ip/$$ip ; \
$(MAKE) distclean ; cd $(ROOT); done
for is in $(IS) ; do cd is/$$is ; \
$(MAKE) distclean ; cd $(ROOT); done
for wrapper in $(WRAPPER); do \
cd wrappers/$$wrapper; $(MAKE) distclean; \
cd $(ROOT); done
for processor in $(PROCESSOR) ; do \
cd processors/$$processor ; \
if [ -a Makefile ]; then \
$(MAKE) distclean; \
fi; \
cd $(ROOT); done
for sw in $(SW) ; do cd sw/$$sw ; \
$(MAKE) distclean ; cd $(ROOT); done
for sw in $(SW) ; do \
rm -f platforms/$(PLATFORM)/*.x; cd $(ROOT); done
cd platforms/$(PLATFORM); $(MAKE) distclean
#------------------------------------------------------
copy:
cd $(ROOT)
cd platforms/$(PLATFORM); $(MAKE) copy;
cd $(ROOT)
cd is/tlm_noc_at; $(MAKE) copy;
for sw in $(SW) ; do cd sw/$$sw ; \
$(MAKE) copy; done
#------------------------------------------------------
run: all
cd $(ROOT)
cd platforms/$(PLATFORM); $(MAKE) run