-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.arp
117 lines (99 loc) · 3.94 KB
/
Makefile.arp
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
116
117
# ####################################################
# ARP main Makefile
# ####################################################
# Variable that points to ArchC installation path
PLATFORM := dual_mips.01
# Variable that points to SystemC installation path
export SYSTEMC := /home/user/systemc-2.1.v1
# Variable that points to TLM installation path
export TLM_PATH := /home/user/TLM-2005-04-08/tlm
# Variable that points to ArchC installation path
export ARCHC_PATH = /home/user/archc
export ARP:=$(PWD)
# ####################################################
# You don't need to alter after this point
# ####################################################
include platforms/$(PLATFORM)/defs.arp
export HOST_OS:= linux
export LIB_DIR:=-L $(SYSTEMC)/lib-$(HOST_OS) -L $(ARCHC_PATH)/lib \
$(foreach ip, $(IP), -L $(ARP)/ip/$(ip)) \
$(foreach is, $(IS), -L $(ARP)/is/$(is)) \
$(foreach wrapper, $(WRAPPER), -L $(ARP)/wrappers/$(wrapper)) \
$(foreach processor, $(PROCESSOR), -L $(ARP)/processors/$(processor))
export INC_DIR:=-I $(SYSTEMC)/include -I $(ARCHC_PATH)/include/archc -I $(TLM_PATH) \
$(foreach ip, $(IP), -I $(ARP)/ip/$(ip)) \
$(foreach is, $(IS), -I $(ARP)/is/$(is)) \
$(foreach wrapper, $(WRAPPER), -I $(ARP)/wrappers/$(wrapper)) \
$(foreach processor, $(PROCESSOR), -I $(ARP)/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
export CFLAGS:=-g -O2
export CC:=g++
#------------------------------------------------------
.SILENT:
#------------------------------------------------------
all:
cd $(ARP)
for ip in $(IP); do echo Making IP $$ip ...; \
cd ip/$$ip; $(MAKE) lib; cd $(ARP); done
for is in $(IS); do echo Making IS $$is ...; \
cd is/$$is; $(MAKE) lib; cd $(ARP); done
for wrapper in $(WRAPPER); do \
echo Making Wrapper $$wrapper ...; \
cd wrappers/$$wrapper; $(MAKE) lib; \
cd $(ARP); done
for processor in $(PROCESSOR); do \
echo Making Processor $$processor ...;\
cd processors/$$processor ; $(MAKE) lib ; \
cd $(ARP); done
for sw in $(SW); do \
echo Making Software $$sw ...; cd sw/$$sw; \
$(MAKE); cd $(ARP); done
for sw in $(SW) ; do \
cp sw/$$sw/*.x platforms/$(PLATFORM) ; done
echo Making Platform $(PLATFORM)
cd platforms/$(PLATFORM); $(MAKE)
#------------------------------------------------------
clean:
cd $(ARP)
for ip in $(IP) ; do cd ip/$$ip ; \
$(MAKE) clean ; cd $(ARP); done
for is in $(IS) ; do cd is/$$is ; \
$(MAKE) clean ; cd $(ARP); done
for wrapper in $(WRAPPER); do \
cd wrappers/$$wrapper; $(MAKE) clean; \
cd $(ARP); done
for processor in $(PROCESSOR) ; do \
cd processors/$$processor ; $(MAKE) clean; \
cd $(ARP); done
for sw in $(SW) ; do cd sw/$$sw ; \
$(MAKE) clean ; cd $(ARP); done
for sw in $(SW) ; do \
rm -f platforms/$(PLATFORM)/*.x; cd $(ARP); done
cd platforms/$(PLATFORM); $(MAKE) clean
#------------------------------------------------------
distclean:
cd $(ARP)
for ip in $(IP) ; do cd ip/$$ip ; \
$(MAKE) distclean ; cd $(ARP); done
for is in $(IS) ; do cd is/$$is ; \
$(MAKE) distclean ; cd $(ARP); done
for wrapper in $(WRAPPER); do \
cd wrappers/$$wrapper; $(MAKE) distclean; \
cd $(ARP); done
for processor in $(PROCESSOR) ; do \
cd processors/$$processor ; $(MAKE) distclean; \
cd $(ARP); done
for sw in $(SW) ; do cd sw/$$sw ; \
$(MAKE) distclean ; cd $(ARP); done
for sw in $(SW) ; do \
rm -f platforms/$(PLATFORM)/*.x; cd $(ARP); done
cd platforms/$(PLATFORM); $(MAKE) distclean
#------------------------------------------------------
run: all
cd $(ARP)
cd platforms/$(PLATFORM); $(MAKE) run