-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathMakefile.devs
More file actions
231 lines (177 loc) · 7.94 KB
/
Copy pathMakefile.devs
File metadata and controls
231 lines (177 loc) · 7.94 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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
$(info )
$(info )
S =
venv = . .venv/bin/activate;
SMP_FLAGS =
ifneq ($(shell which nproc 2> /dev/null),)
SMP_FLAGS = -j$(shell nproc)
endif
WORK_ROOT = $(shell cd ../..; pwd)
USE_VENV = Yes
ifneq ($(findstring abuild/rpmbuild,$(shell pwd)),)
$(info ---> Using OBS RPM build tree scheme)
PYTHON_BIN = python3
ifneq ($(findstring coriolis-eda-2.5.5-build,$(shell pwd)),)
SRC_DIR = ${HOME}/rpmbuild/BUILD/coriolis-eda-2.5.5-build
else
SRC_DIR = ${HOME}/rpmbuild/BUILD
endif
CORIOLIS_SRC = ${SRC_DIR}/coriolis-eda-2.5.5
ALLIANCE_SRC = ${SRC_DIR}/alliance/alliance/src
BUILDDIR = ${CORIOLIS_SRC}/build
PREFIX = /usr
else
ifneq ($(findstring src/coriolis-rpm,$(shell pwd)),)
$(info ---> Using local (fast release) RPM build tree scheme)
PYTHON_BIN = python3
SRC_DIR = ${HOME}/coriolis-2.x/src/coriolis-rpm/BUILD
CORIOLIS_SRC = ${SRC_DIR}/coriolis-eda-2.5.5
ALLIANCE_SRC = ${SRC_DIR}/alliance/alliance/src
BUILDDIR = ${CORIOLIS_SRC}/build
PREFIX = /usr
else
ifneq ($(findstring packages/BUILD,$(shell pwd)),)
$(info ---> Using DEB build tree scheme)
PYTHON_BIN = python3
SRC_DIR = /usr/src/packages/BUILD
CORIOLIS_SRC = ${SRC_DIR}
ALLIANCE_SRC = ${SRC_DIR}
BUILDDIR = ${CORIOLIS_SRC}/build
PREFIX = /usr
else
$(info ---> Using Developpers build tree scheme)
PYTHON_BIN = /usr/bin/python3.11
PYTHON_BIN = python3
SRC_DIR = $(WORK_ROOT)/src
CORIOLIS_SRC = ${SRC_DIR}/coriolis
ALLIANCE_SRC = ${SRC_DIR}/alliance/alliance/src
BUILDTYPE = release
BUILDDIR = ${WORK_ROOT}/$(BUILDTYPE)/build
PREFIX = ${WORK_ROOT}/$(BUILDTYPE)/install
endif
endif
endif
$(info $S WORK_ROOT = $(WORK_ROOT))
ifeq ($(USE_VENV),Yes)
PDM_BIN = $(CORIOLIS_SRC)/.venv/bin/pdm
MESON_BIN = $(CORIOLIS_SRC)/.venv/bin/meson
PELICAN_BIN = $(CORIOLIS_SRC)/.venv/bin/pelican
DOIT_BIN = $(CORIOLIS_SRC)/.venv/bin/doit
else
PDM_BIN = /usr/bin/pdm
MESON_BIN = /usr/bin/meson
PELICAN_BIN = /usr/bin/pelican
DOIT_BIN = /usr/bin/doit
endif
help:
@echo ""; \
echo "============================================================================"; \
echo "Coriolis build & install top Makefile"; \
echo ""; \
echo "This Makefile is intended *only* for Developpers"; \
echo ""; \
echo "To build it, simply type (in coriolis/, at the shell prompt):"; \
echo " ego@home:coriolis> make install"; \
echo "To remove the build directory (and keep the software installed):"; \
echo " ego@home:coriolis> make clean_build"; \
echo "To fully remove build & install:"; \
echo " ego@home:coriolis> make uninstall"; \
echo "============================================================================"; \
echo "SMP_FLAGS = $(SMP_FLAGS)" ; \
echo "SRC_DIR = $(SRC_DIR)" ; \
echo "CORIOLIS_SRC = $(CORIOLIS_SRC)" ; \
echo "BUILDDIR = $(BUILDDIR)" ; \
echo "PREFIX = $(PREFIX)" ; \
echo "DESTDIR = $(DESTDIR)" ; \
echo "============================================================================"; \
echo ""; echo "";
check_dir:
@if [ "`pwd`" != "${CORIOLIS_SRC}" ]; then \
echo "Coriolis uses a fixed directory from the user's root."; \
echo "You must put in:"; \
echo " <${CORIOLIS_SRC}>"; \
echo "Instead of:"; \
echo " <`pwd`>"; \
echo "Stopping build."; \
exit 1; \
fi
$(CORIOLIS_SRC)/.venv:
$(PYTHON_BIN) -m venv .venv
$(MESON_BIN): $(CORIOLIS_SRC)/.venv
$(venv) if [ ! -x "$(MESON_BIN)" ]; then pip install meson; fi
$(PELICAN_BIN): $(CORIOLIS_SRC)/.venv
$(venv) if [ ! -x "$(PELICAN_BIN)" ]; then pip install pelican; fi
$(DOIT_BIN): $(CORIOLIS_SRC)/.venv
$(venv) if [ ! -x "$(DOIT_BIN)" ]; then pip install doit==0.33.1; fi
ifeq ($(USE_SYSTEM_PDM),)
$(PDM_BIN): $(CORIOLIS_SRC)/.venv
$(venv) if [ ! -x "$(PDM_BIN)" ]; then pip install pdm; pdm install --no-self -d --plugins; fi
install_venv: $(PDM_BIN) $(MESON_BIN) $(PELICAN_BIN) #$(DOIT_BIN)
else
install_venv: $(MESON_BIN) $(PELICAN_BIN)
endif
wheel: check_dir install_venv
$(venv) python -m pip --use-feature=in-tree-build wheel .
wipe: check_dir install_venv
$(venv) meson setup ${BUILDDIR} --wipe -Dpython.install_env=prefix -Donly-docs=false
setup: check_dir install_venv
$(venv) meson setup ${BUILDDIR} --prefix=$(PREFIX) -Dpython.install_env=prefix -Donly-docs=false
configure: check_dir install_venv
$(venv) meson configure ${BUILDDIR} --prefix=$(PREFIX) -Dpython.install_env=prefix
install: setup configure
$(venv) meson install -C $(BUILDDIR)
@echo ""; \
echo "============================================================================"; \
echo "Coriolis has been successfully built"; \
echo "============================================================================"; \
echo "It has been installed under the directory:"; \
echo " $(PREFIX)/{bin,lib,lib64,include,share,...}"; \
echo "============================================================================";
install_docs: check_dir configure
$(venv) echo "PYTHON=`which python`"
$(venv) meson configure ${BUILDDIR} --prefix=$(PREFIX) -Ddocs=true
$(venv) meson install -C $(BUILDDIR)
@echo "Documentation generated and installed."
install_alliance:
export ALLIANCE_TOP=$(PREFIX); \
export LD_LIBRARY_PATH=$(PREFIX)/lib:$(LD_LIBRARY_PATH); \
cd $(ALLIANCE_SRC); \
sed -i 's,dirs="\\$$newdirs documentation",dirs="$$newdirs",' ./autostuff; \
./autostuff clean; \
./autostuff; \
mkdir -p $(BUILDDIR); \
cd $(BUILDDIR); \
$(ALLIANCE_SRC)/configure --prefix=$(PREFIX) --enable-alc-shared; \
make -j1 install
install_tasyagle:
cd ../tas-yagle && ./build.sh --install-dir=$(PREFIX)
install_ihpsg13g2:
cd ../coriolis-pdk-ihpsg13g2 && ./build-devs.sh
install_ihpsg13g2_c4m:
cd ../coriolis-pdk-ihpsg13g2-c4m && ./build-devs.sh
install_gf180mcu:
cd ../coriolis-pdk-gf180mcu && ./build-devs.sh
install_gf180mcu_c4m:
cd ../coriolis-pdk-gf180mcu-c4m && ./build-devs.sh
install_sky130_c4m:
cd ../coriolis-pdk-sky130-c4m && ./build-devs.sh
install_nsx2:
cd ../coriolis-pdk-nsx2 && ./build-devs.sh
install_all_pdks: install_ihpsg13g2 \
install_ihpsg13g2_c4m \
install_gf180mcu \
install_gf180mcu_c4m \
install_sky130_c4m \
install_nsx2
clean_build: check_dir
@echo "Removing the build tree only."; \
echo " $(BUILDDIR)"; \
rm -rf $(BUILDDIR)
clean_pdm:
@echo "Removing all pip, pdm & venv installed files."
rm -rf ${CORIOLIS_SRC}/.venv
rm -f ${CORIOLIS_SRC}/.pdm_python
rm -rf ${CORIOLIS_SRC}/.pdm_plugins
uninstall: check_dir
@echo "Removing the whole build & install tree..."; \
@$(venv) ninja -C $(BUILDDIR) uninstall