-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathMakefile
156 lines (136 loc) · 5.48 KB
/
Makefile
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
################################################################################
#
# NetFPGA-10G http://www.netfpga.org
#
# File:
# Makefile
#
# Description:
# make cores : Copy Xilinx files into NetFPGA-10G library
#
# For more information about how Xilinx EDK works, please visit
# http://www.xilinx.com/support/documentation/dt_edk.htm
#
# Copyright notice:
# Copyright (C) 2010, 2011 The Board of Trustees of The Leland Stanford
# Junior University
#
# Licence:
# This file is part of the NetFPGA 10G development base package.
#
# This file is free code: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License version 2.1 as
# published by the Free Software Foundation.
#
# This package is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with the NetFPGA source package. If not, see
# http://www.gnu.org/licenses/.
#
#
NF10_SCRIPTS_DIR = tools/scripts
XILINX_HW_LIB_DIR = $(XILINX_EDK)/hw/XilinxProcessorIPLib/pcores
XILINX_SW_LIB_DIR = $(XILINX_EDK)/sw/XilinxProcessorIPLib/drivers
NF10_HW_LIB_DIR_XILINX = lib/hw/xilinx/pcores
HW_LIB_DIR_INSTANCES_XILINX := $(shell cd $(NF10_HW_LIB_DIR_XILINX) && find . -maxdepth 1 -type d)
HW_LIB_DIR_INSTANCES_XILINX := $(basename $(patsubst ./%,%,$(HW_LIB_DIR_INSTANCES_XILINX)))
NF10_HW_LIB_DIR_STD = lib/hw/std/pcores
HW_LIB_DIR_INSTANCES_STD := $(shell cd $(NF10_HW_LIB_DIR_STD) && find . -maxdepth 1 -type d)
HW_LIB_DIR_INSTANCES_STD := $(basename $(patsubst ./%,%,$(HW_LIB_DIR_INSTANCES_STD)))
NF10_SW_LIB_DIR_STD = lib/sw/std/drivers
SW_LIB_DIR_INSTANCES_STD := $(shell cd $(NF10_SW_LIB_DIR_STD) && find . -maxdepth 1 -type d)
SW_LIB_DIR_INSTANCES_STD := $(basename $(patsubst ./%,%,$(SW_LIB_DIR_INSTANCES_STD)))
NF10_HW_LIB_DIR_CONTRIB = lib/hw/contrib/pcores
HW_LIB_DIR_INSTANCES_CONTRIB := $(shell cd $(NF10_HW_LIB_DIR_CONTRIB) && find . -maxdepth 1 -type d)
HW_LIB_DIR_INSTANCES_CONTRIB := $(basename $(patsubst ./%,%,$(HW_LIB_DIR_INSTANCES_CONTRIB)))
NF10_SW_LIB_DIR_CONTRIB = lib/sw/contrib/drivers
SW_LIB_DIR_INSTANCES_CONTRIB := $(shell cd $(NF10_SW_LIB_DIR_CONTRIB) && find . -maxdepth 1 -type d)
SW_LIB_DIR_INSTANCES_CONTRIB := $(basename $(patsubst ./%,%,$(SW_LIB_DIR_INSTANCES_CONTRIB)))
cores: xilinx std contrib scripts
clean: xilinxclean stdclean contribclean scriptsclean
xilinx: check-env
for lib in $(HW_LIB_DIR_INSTANCES_XILINX) ; do \
if test -f $(NF10_HW_LIB_DIR_XILINX)/$$lib/Makefile; \
then $(MAKE) -C $(NF10_HW_LIB_DIR_XILINX)/$$lib; \
fi; \
done;
@echo "/////////////////////////////////////////";
@echo "//Xilinx EDK cores installed.";
@echo "/////////////////////////////////////////";
xilinxclean:
for lib in $(HW_LIB_DIR_INSTANCES_XILINX) ; do \
if test -f $(NF10_HW_LIB_DIR_XILINX)/$$lib/Makefile; \
then $(MAKE) -C $(NF10_HW_LIB_DIR_XILINX)/$$lib clean; \
fi; \
done;
@echo "/////////////////////////////////////////";
@echo "//Xilinx EDK cores cleaned.";
@echo "/////////////////////////////////////////";
std:
for lib in $(HW_LIB_DIR_INSTANCES_STD) ; do \
if test -f $(NF10_HW_LIB_DIR_STD)/$$lib/Makefile; \
then $(MAKE) -C $(NF10_HW_LIB_DIR_STD)/$$lib; \
fi; \
done;
for lib in $(SW_LIB_DIR_INSTANCES_STD) ; do \
if test -f $(NF10_SW_LIB_DIR_STD)/$$lib/Makefile; \
then $(MAKE) -C $(NF10_SW_LIB_DIR_STD)/$$lib; \
fi; \
done;
@echo "/////////////////////////////////////////";
@echo "//NF10 standard cores installed.";
@echo "/////////////////////////////////////////";
stdclean:
for lib in $(HW_LIB_DIR_INSTANCES_STD) ; do \
if test -f $(NF10_HW_LIB_DIR_STD)/$$lib/Makefile; \
then $(MAKE) -C $(NF10_HW_LIB_DIR_STD)/$$lib clean; \
fi; \
done;
for lib in $(SW_LIB_DIR_INSTANCES_STD) ; do \
if test -f $(NF10_SW_LIB_DIR_STD)/$$lib/Makefile; \
then $(MAKE) -C $(NF10_SW_LIB_DIR_STD)/$$lib clean; \
fi; \
done;
@echo "/////////////////////////////////////////";
@echo "//NF10 standard cores cleaned.";
@echo "/////////////////////////////////////////";
contrib:
for lib in $(HW_LIB_DIR_INSTANCES_CONTRIB) ; do \
if test -f $(NF10_HW_LIB_DIR_CONTRIB)/$$lib/Makefile; \
then $(MAKE) -C $(NF10_HW_LIB_DIR_CONTRIB)/$$lib; \
fi; \
done;
for lib in $(SW_LIB_DIR_INSTANCES_CONTRIB) ; do \
if test -f $(NF10_SW_LIB_DIR_CONTRIB)/$$lib/Makefile; \
then $(MAKE) -C $(NF10_SW_LIB_DIR_CONTRIB)/$$lib; \
fi; \
done;
@echo "/////////////////////////////////////////";
@echo "//NF10 contributed cores installed.";
@echo "/////////////////////////////////////////";
contribclean:
for lib in $(HW_LIB_DIR_INSTANCES_CONTRIB) ; do \
if test -f $(NF10_HW_LIB_DIR_CONTRIB)/$$lib/Makefile; \
then $(MAKE) -C $(NF10_HW_LIB_DIR_CONTRIB)/$$lib clean; \
fi; \
done;
for lib in $(SW_LIB_DIR_INSTANCES_CONTRIB) ; do \
if test -f $(NF10_SW_LIB_DIR_CONTRIB)/$$lib/Makefile; \
then $(MAKE) -C $(NF10_SW_LIB_DIR_CONTRIB)/$$lib clean; \
fi; \
done;
@echo "/////////////////////////////////////////";
@echo "//NF10 contributed cores cleaned.";
@echo "/////////////////////////////////////////";
scripts:
$(MAKE) -C $(NF10_SCRIPTS_DIR)
scriptsclean:
$(MAKE) -C $(NF10_SCRIPTS_DIR) clean
check-env:
ifndef XILINX_EDK
$(error XILINX_EDK is undefined)
endif