verilog: add sv_maps iterators
[ghdl-vlg.git] / Makefile.in
blob42fe0280ad4a7d0d4b5917ea7389d3d831e456da
1 # Top level -*- Makefile -*- for GHDL.
2 # Copyright (C) 2002 - 2014 Tristan Gingold
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <gnu.org/licenses>.
16 CC=@CC@
17 CFLAGS=@CFLAGS@
18 CXX=@CXX@
19 CXXFLAGS=@CXXFLAGS@
20 build=@build@
21 srcdir=@srcdir@
22 abs_srcdir=@abs_srcdir@
23 GNATMAKE=@GNATMAKE@
24 ADA_FLAGS=@ADA_FLAGS@
25 MAKE=@MAKE@
26 prefix=@prefix@
27 backend=@backend@
28 libdirsuffix=@libdirsuffix@
29 libghdldirsuffix=@libghdldirsuffix@
30 incdirsuffix=@incdirsuffix@
31 EXEEXT=@EXEEXT@
32 SOEXT=@SOEXT@
33 PIC_FLAGS=@PIC_FLAGS@
34 gcc_src_dir=@gcc_src_dir@
35 LLVM_CONFIG=@llvm_config@
36 LDFLAGS=@LDFLAGS@
37 LIBBACKTRACE=@backtrace_lib@
38 llvm_be=@llvm_be@
39 build_mode=@build_mode@
40 ghdl_version=@ghdl_version@
41 libghdl_version=@libghdl_version@
42 enable_werror=@enable_werror@
43 enable_checks=@enable_checks@
44 enable_gplcompat=@enable_gplcompat@
45 enable_libghdl=@enable_libghdl@
46 default_pic=@default_pic@
47 with_sundials=@with_sundials@
48 sundials_incflags=@sundials_incflags@
49 sundials_ldflags=@sundials_ldflags@
51 INSTALL_PROGRAM=install -m 755
52 INSTALL_DATA=install -m 644
53 PYTHON=python3
54 PWD=$(CURDIR)
55 DESTDIR=
56 bindir=$(prefix)/bin
57 libdir=$(prefix)/$(libdirsuffix)
58 libghdldir=$(prefix)/$(libghdldirsuffix)
59 incdir=$(prefix)/$(incdirsuffix)/ghdl
60 MKDIR=mkdir
61 LN=ln -s
62 CP=cp
63 MV=mv
64 SED=sed
65 GRT_RANLIB=ranlib
66 GHDL_DESC?=tarball
68 VHDL_LIB_DIR=$(prefix)/$(libghdldirsuffix)
70 ifeq "$(enable_checks)" "true"
71 # Debug + checks
72 OPT_FLAGS+=-g
73 ADA_FLAGS+=-gnata
74 LIB_CFLAGS+=
75 else
76 # Optimize + no checks
77 ADA_FLAGS+=-gnatpn
78 OPT_FLAGS+=-O
79 LIB_CFLAGS=-O
80 endif
82 # Profiling.
83 #ADA_FLAGS+=-gnatn
84 #OPT_FLAGS+=-pg -O
86 # Coverage
87 ifeq "$(build_mode)" "coverage"
88 COVERAGE_FLAGS+=-fprofile-arcs -ftest-coverage
89 endif
91 # Warnings as errors. Comment this line if a warning looks not valid.
92 ifeq "$(enable_werror)" "true"
93 WARN_ADAFLAGS+=-gnatwe
94 endif
96 WARN_ADAFLAGS+=-gnatwa -gnatwC -gnatf
98 GNATFLAGS=-gnat12 -gnaty3befhkmr $(OPT_FLAGS) $(COVERAGE_FLAGS) $(WARN_ADAFLAGS) $(ADA_FLAGS)
99 GRT_FLAGS=$(COVERAGE_FLAGS)
100 GRT_ADAFLAGS:=$(OPT_FLAGS) $(WARN_ADAFLAGS) -gnatw.X $(filter-out -gnata,$(ADA_FLAGS))
102 ifeq "$(default_pic)" "true"
103 GRT_FLAGS+=$(PIC_FLAGS)
104 endif
106 WARN_CFLAGS=-Wall
108 CFLAGS:=$(OPT_FLAGS) $(WARN_CFLAGS) $(CFLAGS)
109 CXXFLAGS:=$(OPT_FLAGS) $(WARN_CFLAGS) $(CXXFLAGS)
111 GNAT_BARGS=-bargs -E
113 target=$(build)
114 #target=i686-pc-linux-gnu
115 #target=x86_64-pc-linux-gnu
116 #target=i686-apple-darwin
117 #target=x86_64-apple-darwin
118 #target=i386-pc-mingw32
120 ifeq ($(SOEXT),.so)
121 SHLIB_FLAGS=-Wl,-soname,$(notdir $@)
122 else ifeq ($(SOEXT),.dll)
123 SHLIB_FLAGS=
124 else ifeq ($(SOEXT),.dylib)
125 # Allow the use of -rpath in executable
126 SHLIB_FLAGS=-Wl,-install_name,@rpath/$(notdir $@)
127 endif
129 # Flags for libraries
130 LIBSRC_DIR:=$(srcdir)/libraries
131 LIBDST_DIR:=$(libghdldirsuffix)
133 LIBVHDL_FLAGS_TO_PASS=\
134 LIBSRC_DIR="$(LIBSRC_DIR)" \
135 LIBDST_DIR="$(LIBDST_DIR)" \
136 enable_gplcompat="$(enable_gplcompat)" \
137 LN="$(LN)" CP="$(CP)" MKDIR="$(MKDIR)"
139 # Object files from grt for the synthesis.
140 GRT_SYNTH_OBJS=grt-cstdio.o grt-cdynload.o
142 all: Makefile all.$(backend) all.libghdl all.ghw
144 install: install.$(backend) install.vhdllib install.vpi install.libghdl install.ghw
145 # Generate std.standard package VHDL source
146 "$(DESTDIR)$(bindir)/ghdl$(EXEEXT)" --disp-standard --std=87 > "$(DESTDIR)$(VHDL_LIB_DIR)/src/std/v87/standard.vhdl"
147 "$(DESTDIR)$(bindir)/ghdl$(EXEEXT)" --disp-standard --std=93 > "$(DESTDIR)$(VHDL_LIB_DIR)/src/std/v93/standard.vhdl"
148 "$(DESTDIR)$(bindir)/ghdl$(EXEEXT)" --disp-standard --std=08 > "$(DESTDIR)$(VHDL_LIB_DIR)/src/std/v08/standard.vhdl"
150 uninstall: uninstall.$(backend) uninstall.vhdllib uninstall.vpi uninstall.libghdl uninstall.ghw
152 test: test.$(backend)
154 copy-sources: copy-sources.$(backend)
156 libs: libs.vhdl.$(backend)
158 ./config.status: $(srcdir)/configure
159 @if [ -e $@ ]; then \
160 echo "./config.status --reconfigure"; \
161 ./config.status --reconfigure; \
162 else \
163 echo "config.status is lost, please configure manually" ; \
164 exit 1; \
167 Makefile: $(srcdir)/Makefile.in ./config.status
168 ./config.status
170 setup.py: $(srcdir)/setup.py.in ./config.status
171 ./config.status
173 scripts/gcc/Make-lang.in: $(srcdir)/scripts/gcc/Make-lang.in.in ./config.status
174 ./config.status
176 GHDL_COMMON_INCFLAGS=-aI$(srcdir)/src -aI$(srcdir)/src/vhdl -aI$(srcdir)/src/verilog -aI$(srcdir)/src/synth -aI$(srcdir)/src/grt -aI$(srcdir)/src/psl -aI$(srcdir)/src/vhdl/translate
178 GRTSRCDIR=$(abs_srcdir)/src/grt
179 include $(srcdir)/src/grt/Makefile.inc
181 version.tmp: $(srcdir)/src/version.in force
182 # Create version.tmp from version.in, using git date/hash, or envvars.
183 # The user is allowed to set GHDL_VER_DESC to override description.
184 VER_DESC=tarball; \
185 VER_REF=unknown; \
186 VER_HASH=unknown; \
187 if test -d $(srcdir)/.git && desc=`cd $(srcdir); git describe --dirty --long`; then \
188 VER_DESC=`echo $$desc | sed -e 's/\([^-]*-g\)/r\1/' -e 's/-/./g' -e 's/^v//g'`; \
189 VER_REF=`cd $(srcdir); git rev-parse --abbrev-ref HEAD`; \
190 VER_HASH=`cd $(srcdir); git rev-parse HEAD`; \
191 fi; \
192 sed \
193 -e "s#@VER@#$(ghdl_version)#" \
194 -e "s#@DESC@#$${GHDL_VER_DESC:-$$VER_DESC}#" \
195 -e "s#@REF@#$${GHDL_VER_REF:-$$VER_REF}#" \
196 -e "s#@HASH@#$${GHDL_VER_HASH:-$$VER_HASH}#" \
197 < $< > $@;
199 version.ads: version.tmp
200 # Change version.ads only if version.tmp has been modified to avoid
201 # useless rebuild.
202 if [ ! -r $@ ] || ! cmp $< $@ > /dev/null; then $(CP) $< $@; fi
204 VPI_OBJS=sys_display.o sys_finish.o sys_priv.o sys_time.o sys_fileio.o \
205 sys_scanf.o sys_random.o \
206 vpi_mcd.o vpip_format.o \
207 sys_readmem.o sys_readmem_lex.o \
208 v2009_bitvec.o \
209 vpi_debug.o sys_clog2.o sys_plusargs.o
211 VPI_PIC_OBJS=$(foreach v,$(VPI_OBJS),pic/$(v))
213 VPI_CFLAGS=-I$(srcdir)/src/verilog -Wall -std=c99 $(CFLAGS) -D_SVID_SOURCE=1
214 VPI_CCOMPILE=$(CC) -c -o $@ $< -DGHDL $(VPI_CFLAGS)
215 VPI_CCOMPILE_PIC=$(VPI_CCOMPILE) $(PIC_FLAGS)
217 sys_display.o: $(srcdir)/src/verilog/vpi/sys_display.c
218 $(VPI_CCOMPILE)
220 pic/sys_display.o: $(srcdir)/src/verilog/vpi/sys_display.c
221 $(VPI_CCOMPILE_PIC)
223 sys_finish.o: $(srcdir)/src/verilog/vpi/sys_finish.c
224 $(VPI_CCOMPILE)
226 pic/sys_finish.o: $(srcdir)/src/verilog/vpi/sys_finish.c
227 $(VPI_CCOMPILE_PIC)
229 sys_priv.o: $(srcdir)/src/verilog/vpi/sys_priv.c
230 $(VPI_CCOMPILE)
232 pic/sys_priv.o: $(srcdir)/src/verilog/vpi/sys_priv.c
233 $(VPI_CCOMPILE_PIC)
235 sys_time.o: $(srcdir)/src/verilog/vpi/sys_time.c
236 $(VPI_CCOMPILE)
238 pic/sys_time.o: $(srcdir)/src/verilog/vpi/sys_time.c
239 $(VPI_CCOMPILE_PIC)
241 vpi_mcd.o: $(srcdir)/src/verilog/vpilib/vpi_mcd.c
242 $(VPI_CCOMPILE)
244 pic/vpi_mcd.o: $(srcdir)/src/verilog/vpilib/vpi_mcd.c
245 $(VPI_CCOMPILE_PIC)
247 sys_fileio.o: $(srcdir)/src/verilog/vpi/sys_fileio.c
248 $(VPI_CCOMPILE)
250 pic/sys_fileio.o: $(srcdir)/src/verilog/vpi/sys_fileio.c
251 $(VPI_CCOMPILE_PIC)
253 sys_scanf.o: $(srcdir)/src/verilog/vpi/sys_scanf.c
254 $(VPI_CCOMPILE)
256 pic/sys_scanf.o: $(srcdir)/src/verilog/vpi/sys_scanf.c
257 $(VPI_CCOMPILE_PIC)
259 sys_random.o: $(srcdir)/src/verilog/vpi/sys_random.c
260 $(VPI_CCOMPILE)
262 pic/sys_random.o: $(srcdir)/src/verilog/vpi/sys_random.c
263 $(VPI_CCOMPILE_PIC)
265 vpip_format.o: $(srcdir)/src/verilog/vpilib/vpip_format.c
266 $(VPI_CCOMPILE)
268 pic/vpip_format.o: $(srcdir)/src/verilog/vpilib/vpip_format.c
269 $(VPI_CCOMPILE_PIC)
271 sys_readmem.o: $(srcdir)/src/verilog/vpi/sys_readmem.c
272 $(VPI_CCOMPILE)
274 pic/sys_readmem.o: $(srcdir)/src/verilog/vpi/sys_readmem.c
275 $(VPI_CCOMPILE_PIC)
277 sys_readmem_lex.o: $(srcdir)/src/verilog/vpi/sys_readmem_lex.c
278 $(VPI_CCOMPILE)
280 pic/sys_readmem_lex.o: $(srcdir)/src/verilog/vpi/sys_readmem_lex.c
281 $(VPI_CCOMPILE_PIC)
283 v2009_bitvec.o: $(srcdir)/src/verilog/vpi/v2009_bitvec.c
284 $(VPI_CCOMPILE)
286 pic/v2009_bitvec.o: $(srcdir)/src/verilog/vpi/v2009_bitvec.c
287 $(VPI_CCOMPILE_PIC)
289 vpi_debug.o: $(srcdir)/src/verilog/vpi/vpi_debug.c
290 $(VPI_CCOMPILE)
292 pic/vpi_debug.o: $(srcdir)/src/verilog/vpi/vpi_debug.c
293 $(VPI_CCOMPILE_PIC)
295 sys_clog2.o: $(srcdir)/src/verilog/vpi/sys_clog2.c
296 $(VPI_CCOMPILE)
298 pic/sys_clog2.o: $(srcdir)/src/verilog/vpi/sys_clog2.c
299 $(VPI_CCOMPILE_PIC)
301 sys_plusargs.o: $(srcdir)/src/verilog/vpi/sys_plusargs.c
302 $(VPI_CCOMPILE)
304 pic/sys_plusargs.o: $(srcdir)/src/verilog/vpi/sys_plusargs.c
305 $(VPI_CCOMPILE_PIC)
307 #################### For mcode backend ##############################
309 all.mcode: ghdl_mcode$(EXEEXT) libs.vhdl.mcode all.vpi
311 GHDL_MCODE_INCFLAGS=$(GHDL_COMMON_INCFLAGS) -aI$(srcdir)/src/ghdldrv -aI$(srcdir)/src/ortho -aI$(srcdir)/src/ortho/mcode -aI$(srcdir)/src/synth
313 ghdl_mcode$(EXEEXT): GRT_FLAGS+=-DWITH_GNAT_RUN_TIME
314 ghdl_mcode$(EXEEXT): $(GRT_ADD_OBJS) $(GRT_SRC_DEPS) $(ORTHO_DEPS) $(VPI_OBJS) \
315 memsegs_c.o chkstk.o version.ads force
316 $(GNATMAKE) -o $@ -gnat12 $(GHDL_MCODE_INCFLAGS) $(GNATFLAGS) -gnatw.A ghdl_jit.adb $(GNAT_BARGS) -largs memsegs_c.o chkstk.o $(GRT_ADD_OBJS) $(LDFLAGS) $(subst @,$(GRTSRCDIR),$(GRT_EXTRA_LIB) $(GRT_EXEC_OPTS)) $(VPI_OBJS) $(sundials_ldflags) -shared-libgcc
318 memsegs_c.o: $(srcdir)/src/ortho/mcode/memsegs_c.c
319 $(CC) -c $(COVERAGE_FLAGS) $(CFLAGS) -o $@ $<
321 libs.vhdl.mcode: ghdl_mcode$(EXEEXT)
322 $(MAKE) -f $(srcdir)/libraries/Makefile.inc $(LIBVHDL_FLAGS_TO_PASS) GHDL=$(PWD)/ghdl_mcode$(EXEEXT) GHDL_FLAGS="" VHDL_COPY_OBJS=no vhdl.libs.all
324 install.mcode.program: install.dirs ghdl_mcode$(EXEEXT)
325 $(INSTALL_PROGRAM) ghdl_mcode$(EXEEXT) "$(DESTDIR)$(bindir)/ghdl$(EXEEXT)"
327 uninstall.mcode.program:
328 $(RM) "$(DESTDIR)$(bindir)/ghdl$(EXEEXT)"
330 install.mcode: install.mcode.program install.vhdllib
332 install.mcode.deps.dll:
333 for f in $$($(PYTHON) $(srcdir)/scripts/win-dll.py ghdl_mcode$(EXEEXT)); do \
334 $(INSTALL_PROGRAM) -p $$f "$(DESTDIR)$(bindir)/"; \
335 done
337 uninstall.mcode: uninstall.mcode.program uninstall.vhdllib
339 test.mcode: ghdl_mcode$(EXEEXT)
340 cd $(srcdir)/testsuite; GHDL=$(CURDIR)/ghdl_mcode$(EXEEXT) ./testsuite.sh
342 oread-mcode$(EXEEXT): force
343 $(MAKE) -f $(srcdir)/src/ortho/mcode/Makefile \
344 ortho_srcdir=$(srcdir)/src/ortho ortho_exec=$@ \
345 GNATFLAGS="-aI$(srcdir)/src/ortho/oread $(GNATFLAGS)" all
347 #################### For gcc backend ##############################
349 gcc_vhdl_dir=$(gcc_src_dir)/gcc/vhdl
351 all.gcc:
352 @echo "For installing sources in gcc, do:"
353 @echo "1) $(MAKE) copy-sources"
354 @echo "2) configure, build and install gcc"
355 @echo "3) $(MAKE) ghdllib"
356 @echo "4) $(MAKE) install"
358 copy-sources.gcc: version.ads scripts/gcc/Make-lang.in
359 $(RM) -rf $(gcc_vhdl_dir)
360 $(MKDIR) $(gcc_vhdl_dir)
361 $(CP) -p version.ads ghdlsynth_maybe.ads $(gcc_vhdl_dir)
362 $(CP) -p grt-readline.ads $(gcc_vhdl_dir)
363 $(CP) -p $(srcdir)/src/*.ad? $(gcc_vhdl_dir)
364 $(CP) -p $(srcdir)/src/vhdl/*.ad? $(gcc_vhdl_dir)
365 $(CP) -p $(srcdir)/src/vhdl/translate/*.ad? $(gcc_vhdl_dir)
366 $(CP) -p $(srcdir)/src/synth/*.ad? $(gcc_vhdl_dir)
367 $(CP) -p $(srcdir)/src/psl/*.ad? $(gcc_vhdl_dir)
368 $(CP) -p $(srcdir)/src/grt/grt.ad? $(gcc_vhdl_dir)
369 $(CP) -p $(srcdir)/src/grt/grt-types.ads $(gcc_vhdl_dir)
370 $(CP) -p $(srcdir)/src/grt/grt-vhdl_types.ads $(gcc_vhdl_dir)
371 $(CP) -p $(srcdir)/src/grt/grt-c.ad? $(gcc_vhdl_dir)
372 $(CP) -p $(srcdir)/src/grt/grt-fcvt.ad? $(gcc_vhdl_dir)
373 $(CP) -p $(srcdir)/src/grt/grt-algos.ad? $(gcc_vhdl_dir)
374 $(CP) -p $(srcdir)/src/grt/grt-arith.ad? $(gcc_vhdl_dir)
375 $(CP) -p $(srcdir)/src/grt/grt-vstrings.ad? $(gcc_vhdl_dir)
376 $(CP) -p $(srcdir)/src/grt/grt-cstdio.c $(gcc_vhdl_dir)
377 $(CP) -p $(srcdir)/src/grt/grt-stdio.ad? $(gcc_vhdl_dir)
378 $(CP) -p $(srcdir)/src/grt/grt-table.ad? $(gcc_vhdl_dir)
379 $(CP) -p $(srcdir)/src/grt/grt-files_operations.ad? $(gcc_vhdl_dir)
380 $(CP) -p $(srcdir)/src/grt/grt-to_strings.ad? $(gcc_vhdl_dir)
381 $(CP) -p $(srcdir)/src/grt/grt-strings.ad? $(gcc_vhdl_dir)
382 $(CP) -p $(srcdir)/src/grt/grt-severity.ads $(gcc_vhdl_dir)
383 $(CP) -p $(srcdir)/src/grt/grt-readline_*.ad? $(gcc_vhdl_dir)
384 $(CP) -p $(srcdir)/src/grt/grt-dynload.ad? $(gcc_vhdl_dir)
385 $(CP) -p $(srcdir)/src/grt/grt-cdynload.c $(gcc_vhdl_dir)
386 $(CP) -p $(srcdir)/src/ortho/*.ad? $(gcc_vhdl_dir)
387 $(CP) -p $(srcdir)/src/ortho/gcc/*.ad? $(gcc_vhdl_dir)
388 $(CP) -p $(srcdir)/src/ortho/gcc/*.c $(gcc_vhdl_dir)
389 $(CP) -p $(srcdir)/src/ortho/gcc/*.opt $(gcc_vhdl_dir)
390 base_ver=`cat $(gcc_src_dir)/gcc/BASE-VER`; \
391 case $$base_ver in \
392 4.9*) gcc_ortho_lang=ortho-lang-49.c ;; \
393 5.*) gcc_ortho_lang=ortho-lang-5.c ;; \
394 6 | 6.*) gcc_ortho_lang=ortho-lang-6.c ;; \
395 7.*) gcc_ortho_lang=ortho-lang-7.c ;; \
396 8.*) gcc_ortho_lang=ortho-lang-8.c ;; \
397 9.* | 10.* | 11.*) gcc_ortho_lang=ortho-lang-9.c ;; \
398 12.*) gcc_ortho_lang=ortho-lang-9.c ;; \
399 *) echo "Mismatch gcc version from $(gcc_src_dir)"; \
400 echo "Need gcc version 4.9.x, 5.x to 12.x"; \
401 exit 1 ;; \
402 esac; \
403 $(CP) -p $(srcdir)/src/ortho/gcc/$$gcc_ortho_lang \
404 $(gcc_vhdl_dir)/ortho-lang.c
405 $(CP) -p $(srcdir)/doc/ghdl.texi $(srcdir)/doc/ghdl.1 $(gcc_vhdl_dir)
406 $(MKDIR) $(gcc_vhdl_dir)/ghdldrv
407 $(CP) -pR $(srcdir)/src/ghdldrv/*.ad? $(gcc_vhdl_dir)/ghdldrv
408 $(CP) -p scripts/gcc/Make-lang.in $(gcc_vhdl_dir)
409 $(CP) -p $(srcdir)/scripts/gcc/config-lang.in $(gcc_vhdl_dir)
410 $(CP) -p $(srcdir)/scripts/gcc/lang-options.h $(gcc_vhdl_dir)
411 $(CP) -p $(srcdir)/scripts/gcc/lang-specs.h $(gcc_vhdl_dir)
412 # For gcc 12.x, use .cc extension
413 base_ver=`cat $(gcc_src_dir)/gcc/BASE-VER`; \
414 case $$base_ver in \
415 12.*) for f in $(gcc_vhdl_dir)/*.c; do mv $$f $${f}c; done; \
416 sed -e 's/ortho-lang.c/ortho-lang.cc/' \
417 < $(srcdir)/scripts/gcc/config-lang.in \
418 > $(gcc_vhdl_dir)/config-lang.in ;; \
419 esac
421 # To build vhdl libs using a non-installed ghdl, define GHDL_GCC_BIN to the
422 # path of ghdl and GHDL1_GCC_BIN to path of ghdl1
423 GHDL_GCC_BIN=$(DESTDIR)$(bindir)/ghdl$(EXEEXT)
424 GHDL1_GCC_BIN= # --GHDL1=/path/to/ghdl1
426 libs.vhdl.gcc:
427 $(MAKE) -f $(srcdir)/libraries/Makefile.inc $(LIBVHDL_FLAGS_TO_PASS) GHDL="$(GHDL_GCC_BIN)" GHDL_FLAGS="$(GHDL1_GCC_BIN) $(LIB_CFLAGS)" vhdl.libs.all libs.vhdl.standard
429 ghdllib: libs.vhdl.gcc $(libghdldirsuffix)/libgrt.a all.libghdl all.ghw
431 install.gcc: install.grt
433 uninstall.gcc: uninstall.grt
435 test.gcc:
436 cd $(srcdir)/testsuite; GHDL=$(GHDL_GCC_BIN) GHWDUMP=$(CURDIR)/ghwdump$(EXEEXT) ./testsuite.sh
438 #################### For gcc backend - development only (local build) ####
440 GHDL_GCC_INCFLAGS=$(GHDL_COMMON_INCFLAGS)
442 ghdl1-gcc$(EXEEXT): version.ads $(GRT_SYNTH_OBJS) force
443 $(MAKE) -f $(srcdir)/src/ortho/gcc/Makefile \
444 ortho_srcdir=$(srcdir)/src/ortho ortho_exec=$@ \
445 GNATLFLAGS="$(GRT_SYNTH_OBJS)" \
446 GNATFLAGS="$(GHDL_GCC_INCFLAGS) $(GNATFLAGS)" all
448 ghdl_gcc$(EXEEXT): version.ads $(GRT_SYNTH_OBJS) force
449 $(GNATMAKE) $(GHDL_GCC_INCFLAGS) -aI$(srcdir)/src/ghdldrv \
450 $(GNATFLAGS) ghdl_gcc $(GNAT_BARGS) \
451 -largs $(LDFLAGS) $(GRT_SYNTH_OBJS)
453 libs.vhdl.local_gcc: ghdl_gcc$(EXEEXT) ghdl1-gcc$(EXEEXT)
454 $(MAKE) -f $(srcdir)/libraries/Makefile.inc $(LIBVHDL_FLAGS_TO_PASS) GHDL=$(PWD)/ghdl_gcc$(EXEEXT) GHDL_FLAGS="--GHDL1=$(PWD)/ghdl1-gcc$(EXEEXT) $(LIB_CFLAGS)" vhdl.libs.all libs.vhdl.standard
456 ghdl1-debug$(EXEEXT): version.ads $(GRT_SYNTH_OBJS) force
457 $(MAKE) -f $(srcdir)/src/ortho/debug/Makefile \
458 ortho_srcdir=$(srcdir)/src/ortho ortho_exec=$@ \
459 GNATFLAGS="$(GHDL_GCC_INCFLAGS) $(GNATFLAGS)" \
460 GNATLFLAGS="$(GRT_SYNTH_OBJS)" \
461 GNATMAKE="$(GNATMAKE)" all
463 oread-gcc$(EXEEXT): force
464 $(MAKE) -f $(srcdir)/src/ortho/gcc/Makefile \
465 ortho_srcdir=$(srcdir)/src/ortho ortho_exec=$@ \
466 GNATFLAGS="-aI$(srcdir)/src/ortho/oread $(GNATFLAGS)" all
468 #################### For llvm backend ##############################
470 GHDL_LLVM_INCFLAGS=$(GHDL_COMMON_INCFLAGS) -aI$(srcdir)/src/ghdldrv -aI$(srcdir)/src/ortho -aI$(srcdir)/src/ortho/$(llvm_be) -aI$(srcdir)/src/synth
472 all.llvm: ghdl1-llvm$(EXEEXT) ghdl_llvm$(EXEEXT) grt-all libs.vhdl.llvm all.vpi
474 all.llvm_jit: ghdl_llvm_jit$(EXEEXT)
476 ghdl_llvm_jit$(EXEEXT): GRT_FLAGS+=-DWITH_GNAT_RUN_TIME
477 ghdl_llvm_jit$(EXEEXT): $(GRT_ADD_OBJS) $(GRT_SRC_DEPS) $(ORTHO_DEPS) \
478 llvm-cbindings.o version.ads force
479 $(GNATMAKE) -o $@ $(GHDL_LLVM_INCFLAGS) $(GNATFLAGS) ghdl_jit.adb \
480 $(GNAT_BARGS) -largs llvm-cbindings.o $(GRT_ADD_OBJS) \
481 $(subst @,$(GRTSRCDIR),$(GRT_EXTRA_LIB)) --LINK=$(CXX) \
482 `$(LLVM_CONFIG) --ldflags --libs --system-libs` $(LDFLAGS)
484 llvm-cbindings.o: $(srcdir)/src/ortho/$(llvm_be)/llvm-cbindings.cpp
485 $(CXX) -c `$(LLVM_CONFIG) --includedir --cxxflags` \
486 $(COVERAGE_FLAGS) $(CXXFLAGS) -o $@ $<
488 libs.vhdl.llvmjit: ghdl_llvm_jit$(EXEEXT)
489 $(MAKE) -f $(srcdir)/libraries/Makefile.inc $(LIBVHDL_FLAGS_TO_PASS) GHDL=$(PWD)/ghdl_llvm$(EXEEXT) GHDL_FLAGS="" VHDLLIBS_COPY_OBJS=no vhdl.libs.all
491 libs.vhdl.llvm: ghdl_llvm$(EXEEXT) ghdl1-llvm$(EXEEXT)
492 $(MAKE) -f $(srcdir)/libraries/Makefile.inc $(LIBVHDL_FLAGS_TO_PASS) GHDL=$(PWD)/ghdl_llvm$(EXEEXT) GHDL_FLAGS="--GHDL1=$(PWD)/ghdl1-llvm$(EXEEXT) $(LIB_CFLAGS)" vhdl.libs.all libs.vhdl.standard
494 libs.vhdl.debug-llvm: ghdl_llvm$(EXEEXT) ghdl1-debug$(EXEEXT)
495 $(MAKE) -f $(srcdir)/libraries/Makefile.inc $(LIBVHDL_FLAGS_TO_PASS) GHDL=$(PWD)/ghdl_llvm$(EXEEXT) GHDL_FLAGS="--GHDL1=$(PWD)/ghdl1-debug$(EXEEXT) $(LIB_CFLAGS)" vhdl.libs.all libs.vhdl.standard
497 ghdl_llvm$(EXEEXT): version.ads $(GRT_SYNTH_OBJS) force
498 $(GNATMAKE) $(GHDL_LLVM_INCFLAGS) \
499 -aI$(srcdir)/src/ghdldrv $(GNATFLAGS) \
500 ghdl_llvm $(GNAT_BARGS) \
501 -largs $(LDFLAGS) $(GRT_SYNTH_OBJS)
503 ghdl1-llvm$(EXEEXT): version.ads $(GRT_SYNTH_OBJS) force
504 $(MAKE) -f $(srcdir)/src/ortho/$(llvm_be)/Makefile \
505 ortho_srcdir=$(srcdir)/src/ortho ortho_exec=$@ \
506 GNATFLAGS="$(GHDL_LLVM_INCFLAGS) $(GNATFLAGS)" \
507 GNATLFLAGS="$(GRT_SYNTH_OBJS)" \
508 LDFLAGS="$(LDFLAGS)" \
509 LLVM_CONFIG="$(LLVM_CONFIG)" CXX="$(CXX)" \
510 CXXFLAGS="$(COVERAGE_FLAGS) $(CXXFLAGS)" \
511 GNATMAKE="$(GNATMAKE)" all
513 oread-llvm$(EXEEXT): force
514 $(MAKE) -f $(srcdir)/src/ortho/$(llvm_be)/Makefile \
515 ortho_srcdir=$(srcdir)/src/ortho ortho_exec=$@ \
516 GNATMAKE="$(GNATMAKE)" \
517 GNATFLAGS="-aI$(srcdir)/src/ortho/oread $(GNATFLAGS)" \
518 LLVM_CONFIG="$(LLVM_CONFIG)" CXX="$(CXX)"
520 install.llvm.program: install.dirs ghdl1-llvm$(EXEEXT) ghdl_llvm$(EXEEXT)
521 $(INSTALL_PROGRAM) ghdl_llvm$(EXEEXT) $(DESTDIR)$(bindir)/ghdl$(EXEEXT)
522 $(INSTALL_PROGRAM) ghdl1-llvm$(EXEEXT) $(DESTDIR)$(bindir)/ghdl1-llvm$(EXEEXT)
524 test.llvm: ghdl_llvm$(EXEEXT)
525 cd $(srcdir)/testsuite; GHDL=$(CURDIR)/ghdl_llvm$(EXEEXT) ./testsuite.sh
527 uninstall.llvm.program:
528 $(RM) $(DESTDIR)$(bindir)/ghdl1-llvm$(EXEEXT)
529 $(RM) $(DESTDIR)$(bindir)/ghdl$(EXEEXT)
531 install.llvm: install.llvm.program install.grt
533 uninstall.llvm: uninstall.llvm.program uninstall.grt
535 ################ For simul (no code generation, interpretation) ##########
537 GHDL_SIMUL_INCFLAGS=$(GHDL_COMMON_INCFLAGS) -aI$(srcdir)/src/ghdldrv -aI$(srcdir)/src/simul -aI$(srcdir)/src/synth
539 GRT_SIMUL_OBJS=$(GRT_C_OBJS) grt-cdynload.o
541 ghdl_simul$(EXEEXT): GRT_FLAGS+=-DWITH_GNAT_RUN_TIME
542 ghdl_simul$(EXEEXT): $(GRT_SIMUL_OBJS) $(GRT_SRC_DEPS) version.ads force
543 $(GNATMAKE) $(GHDL_SIMUL_INCFLAGS) $(GNATFLAGS) -gnat12 ghdl_simul $(GNAT_BARGS) -largs $(LDFLAGS) $(GRT_SIMUL_OBJS) $(subst @,$(GRTSRCDIR),$(GRT_EXTRA_LIB)) $(sundials_ldflags)
545 libs.vhdl.simul: ghdl_simul$(EXEEXT)
546 $(MAKE) -f $(srcdir)/libraries/Makefile.inc $(LIBVHDL_FLAGS_TO_PASS) GHDL=$(PWD)/ghdl_simul$(EXEEXT) GHDL_FLAGS="" VHDLLIBS_COPY_OBJS=no vhdl.libs.all
548 install.simul.program: install.dirs ghdl_simul$(EXEEXT)
549 $(INSTALL_PROGRAM) ghdl_simul$(EXEEXT) $(DESTDIR)$(bindir)/ghdl$(EXEEXT)
551 uninstall.simul.program:
552 $(RM) $(DESTDIR)$(bindir)/ghdl$(EXEEXT)
554 install.simul: install.simul.program
556 uninstall.simul: uninstall.simul.program
559 ################ libghdl (library for the vhdl part) ####################
561 LIBGHDL_INCFLAGS=$(GHDL_COMMON_INCFLAGS) -aI$(srcdir)/src/synth -aI$(srcdir)/src/vhdl/libghdl -aI$(srcdir)/src/ghdldrv
563 libghdl_name=libghdl-$(libghdl_version)$(SOEXT)
565 LIBGHDL_GRT_OBJS= pic/grt-cstdio.o pic/grt-cdynload.o $(VPI_PIC_OBJS)
567 lib/$(libghdl_name): $(GRT_SRC_DEPS) $(LIBGHDL_GRT_OBJS) version.ads force
568 # Use -g for gnatlink so that the binder file is not removed. We need
569 # it for libghdl.a
570 $(GNATMAKE) -I- -aI. -D pic -z libghdl -o $@ -gnat12 $(GNATFLAGS) $(PIC_FLAGS) $(LIBGHDL_INCFLAGS) -bargs -shared -Llibghdl_ -largs -g -shared $(SHLIB_FLAGS) $(filter-out -static,$(LDFLAGS)) $(LIBGHDL_GRT_OBJS)
571 # On windows, gnatmake (via Osint.Executable_Name) always appends .exe
572 # Adjust. (Other solution: use gnatmake for compilation and binding,
573 # then use gnatlink directly for linking).
574 ifeq ($(SOEXT),.dll)
575 -mv lib/$(libghdl_name).exe $@
576 endif
578 libghdl.a: lib/$(libghdl_name)
579 # Also create a static library
580 sed -e '1,/-- BEGIN/d' -e '/-- END/,$$d' -e 's/^ -- //' < b~libghdl.adb > libghdl.bind
581 $(RM) -f $@
582 ar rc $@ b~libghdl.o $(LIBGHDL_GRT_OBJS) `sed -e /^-/d < libghdl.bind`
583 grep adalib libghdl.bind | sed -e 's/^-L//' -e 's@adalib/@adalib/libgnat.a@' > libghdl.link
585 $(srcdir)/src/synth/include/synth_gates.h: $(srcdir)/src/synth/netlists.ads $(srcdir)/src/synth/netlists-gates.ads
586 echo "/* DO NOT MODIFY" > $@
587 echo " This file is automatically generated by Makefile. */" >> $@
588 echo "enum Module_Id {" >> $@
589 grep -h "constant Module_Id :=" $^ | sed -e '/constant Module_Id :=/s/:.*://' -e 's/;/,/' -e 's/ *--.*//' >> $@
590 echo "};" >> $@
591 echo "" >> $@
592 echo "enum Param_Type {" >> $@
593 grep ' Param_' $(srcdir)/src/synth/netlists.ads >> $@
594 echo "};" >> $@
596 all.libghdl.true: lib/$(libghdl_name) libghdl.a
597 all.libghdl.false:
598 all.libghdl: all.libghdl.$(enable_libghdl)
600 install.libghdl.include: install.dirs $(srcdir)/src/synth/include/synth_gates.h
601 $(INSTALL_DATA) -p $(srcdir)/src/synth/include/synth.h "$(DESTDIR)$(incdir)/"
602 $(INSTALL_DATA) -p $(srcdir)/src/synth/include/synth_gates.h "$(DESTDIR)$(incdir)/"
604 test.$(backend): install.libghdl.local
605 install.libghdl.local: all.libghdl $(srcdir)/src/synth/include/synth_gates.h
606 $(MKDIR) -p $(incdirsuffix)/ghdl/
607 $(INSTALL_DATA) -p $(srcdir)/src/synth/include/synth.h $(incdirsuffix)/ghdl/
608 $(INSTALL_DATA) -p $(srcdir)/src/synth/include/synth_gates.h $(incdirsuffix)/ghdl/
610 install.libghdl.lib:
611 $(INSTALL_PROGRAM) -p lib/$(libghdl_name) "$(DESTDIR)$(libdir)/"
612 $(INSTALL_PROGRAM) -p libghdl.a "$(DESTDIR)$(libdir)/"
613 $(INSTALL_DATA) -p libghdl.link "$(DESTDIR)$(libdir)/"
615 install.libghdl.true: install.libghdl.lib install.libghdl.include
617 install.libghdl.false:
618 install.libghdl: install.libghdl.$(enable_libghdl)
620 copy.libghdl.deps.dll:
621 $(MKDIR) -p bin
622 ldd lib/$(libghdl_name)
623 # Set IFS to handle CR-LF end of lines
624 IFS=$$'\r\n\t '; \
625 for f in $$($(PYTHON) $(srcdir)/scripts/win-dll.py lib/$(libghdl_name)); do\
626 $(INSTALL_PROGRAM) -p $$f "bin/"; \
627 done
629 copy.libghdl.deps.dylib:
630 copy.libghdl.deps.so:
632 uninstall.libghdl:
633 $(RM) $(DESTDIR)$(libdir)/$(libghdl_name)
635 libghdl-py.tgz:
636 [ -d pythonb ] || $(MKDIR) pythonb
637 $(CP) -r $(srcdir)/pyGHDL/libghdl $(srcdir)/setup.py pythonb
638 tar -zcvf $@ -C pythonb .
640 ################ ghwdump #################################################
642 GHWDUMP_OBJS=ghwdump.o libghw.o
644 ghwdump$(EXEEXT): $(GHWDUMP_OBJS)
645 $(CC) $(LDFLAGS) -o $@ $(GHWDUMP_OBJS)
647 lib/libghw$(SOEXT): libghw.o
648 $(CC) $(PIC_FLAGS) $(LDFLAGS) -shared -o $@ $^
650 ghwdump.o: $(srcdir)/ghw/ghwdump.c $(srcdir)/ghw/libghw.h
651 $(CC) -c -o $@ $< $(COVERAGE_FLAGS) $(CFLAGS)
653 libghw.o: $(srcdir)/ghw/libghw.c $(srcdir)/ghw/libghw.h
654 $(CC) $(PIC_FLAGS) -c -o $@ $< $(COVERAGE_FLAGS) $(CFLAGS)
656 all.ghw: ghwdump$(EXEEXT) lib/libghw$(SOEXT)
658 install.ghw:
659 $(INSTALL_PROGRAM) -p ghwdump$(EXEEXT) "$(DESTDIR)$(bindir)/"
660 $(INSTALL_PROGRAM) -p lib/libghw$(SOEXT) "$(DESTDIR)$(libdir)/"
661 $(INSTALL_DATA) -p $(srcdir)/ghw/libghw.h "$(DESTDIR)$(incdir)/"
663 uninstall.ghw:
664 $(RM) "$(DESTDIR)$(bindir)/ghwdump$(EXEEXT)"
665 $(RM) "$(DESTDIR)$(libdir)/libghw$(EXEEXT)"
666 $(RM) "$(DESTDIR)$(incdir)/libghw.h"
668 ############### grt #####################################################
670 install.grt: \
671 $(libghdldirsuffix)/libgrt.a \
672 $(libghdldirsuffix)/grt.lst \
673 $(libghdldirsuffix)/grt-exec.lst \
674 $(libghdldirsuffix)/grt-shared.lst \
675 install.dirs
676 $(INSTALL_DATA) $(libghdldirsuffix)/libgrt.a $(DESTDIR)$(VHDL_LIB_DIR)/libgrt.a
677 $(INSTALL_DATA) $(libghdldirsuffix)/grt.lst $(DESTDIR)$(VHDL_LIB_DIR)/grt.lst
678 $(INSTALL_DATA) $(libghdldirsuffix)/grt-exec.lst $(DESTDIR)$(VHDL_LIB_DIR)/grt-exec.lst
679 $(INSTALL_DATA) $(libghdldirsuffix)/grt-shared.lst $(DESTDIR)$(VHDL_LIB_DIR)/grt-shared.lst
680 $(INSTALL_DATA) $(GRTSRCDIR)/grt.ver $(DESTDIR)$(VHDL_LIB_DIR)/grt.ver
681 test "x$(LIBBACKTRACE)" = x || test "x$(backend)" = xgcc || \
682 $(INSTALL_DATA) $(LIBBACKTRACE) $(DESTDIR)$(VHDL_LIB_DIR)/libbacktrace.a
684 uninstall.grt:
685 $(RM) $(DESTDIR)$(VHDL_LIB_DIR)/libgrt.a
686 $(RM) $(DESTDIR)$(VHDL_LIB_DIR)/grt.lst
687 $(RM) $(DESTDIR)$(VHDL_LIB_DIR)/grt-exec.lst
688 $(RM) $(DESTDIR)$(VHDL_LIB_DIR)/grt-shared.lst
689 $(RM) $(DESTDIR)$(VHDL_LIB_DIR)/grt.ver
690 $(RM) $(DESTDIR)$(VHDL_LIB_DIR)/libbacktrace.a
692 ################ VPI #####################################################
694 vpi_thunk.o: $(GRTSRCDIR)/vpi_thunk.c $(GRTSRCDIR)/vpi_thunk.h
695 $(CC) -c -o $@ $< $(PIC_FLAGS) $(CFLAGS)
697 vhpi_thunk.o: $(GRTSRCDIR)/vhpi_thunk.c $(GRTSRCDIR)/vhpi_thunk.h
698 $(CC) -c -o $@ $< $(PIC_FLAGS) $(CFLAGS)
700 $(libdirsuffix)/libghdlvpi$(SOEXT): vpi_thunk.o vhpi_thunk.o
701 $(MKDIR) -p $(libdirsuffix)
702 $(CC) $(SHLIB_FLAGS) $(LDFLAGS) -shared -o $@ $^
704 all.vpi: $(libdirsuffix)/libghdlvpi$(SOEXT)
706 install.vpi: all.vpi install.dirs
707 $(INSTALL_PROGRAM) -p $(libdirsuffix)/libghdlvpi$(SOEXT) "$(DESTDIR)$(libdir)/"
708 $(INSTALL_DATA) -p $(GRTSRCDIR)/vpi_user.h "$(DESTDIR)$(incdir)/"
709 $(INSTALL_DATA) -p $(GRTSRCDIR)/vhpi_user.h "$(DESTDIR)$(incdir)/"
711 uninstall.vpi:
712 $(RM) -f "$(DESTDIR)$(libdir)/libghdlvpi$(SOEXT)"
713 $(RM) -f "$(DESTDIR)$(incdir)/vpi_user.h"
714 $(RM) -f "$(DESTDIR)$(incdir)/vhpi_user.h"
716 test.$(backend): install.vpi.local
717 install.vpi.local: all.vpi
718 $(MKDIR) -p $(incdirsuffix)/ghdl/
719 $(INSTALL_DATA) -p $(GRTSRCDIR)/vpi_user.h $(incdirsuffix)/ghdl/
720 $(INSTALL_DATA) -p $(GRTSRCDIR)/vhpi_user.h $(incdirsuffix)/ghdl/
722 ################ Libraries ###############################################
724 VHDLLIB_SUBDIRS= \
725 ieee/v87 \
726 ieee/v93 \
727 ieee/v08 \
728 std/v87 \
729 std/v93 \
730 std/v08 \
731 src/ieee \
732 src/ieee/v87 \
733 src/ieee/v93 \
734 src/ieee2008 \
735 src/std \
736 src/std/v87 \
737 src/std/v93 \
738 src/std/v08 \
739 src/synopsys \
740 src/synopsys/v08 \
741 src/upf
743 ifeq ($(enable_gplcompat),false)
744 VHDLLIB_SUBDIRS+=src/vital95 src/vital2000
745 endif
747 install.dirs:
748 # Use -p to create parents and to avoid error if existing.
749 $(MKDIR) -p "$(DESTDIR)$(prefix)"
750 $(MKDIR) -p "$(DESTDIR)$(bindir)"
751 $(MKDIR) -p "$(DESTDIR)$(libdir)"
752 $(MKDIR) -p "$(DESTDIR)$(libghdldir)"
753 $(MKDIR) -p "$(DESTDIR)$(incdir)"
755 install.vhdllib: install.dirs
756 # Libraries (only if not empty)
757 for d in $(VHDLLIB_SUBDIRS); do \
758 $(MKDIR) -p "$(DESTDIR)$(VHDL_LIB_DIR)/$$d"; \
759 $(INSTALL_DATA) -p \
760 $(LIBDST_DIR)/$$d/* "$(DESTDIR)$(VHDL_LIB_DIR)/$$d"; \
761 done
762 # ANSI color
763 $(INSTALL_DATA) -p \
764 $(srcdir)/scripts/ansi_color.sh "$(DESTDIR)$(VHDL_LIB_DIR)/";
765 # Vendors scripts
766 $(MKDIR) -p "$(DESTDIR)$(VHDL_LIB_DIR)/vendors"
767 $(INSTALL_DATA) -p \
768 $(srcdir)/scripts/vendors/* "$(DESTDIR)$(VHDL_LIB_DIR)/vendors/"
769 $(INSTALL_PROGRAM) -p \
770 $(srcdir)/scripts/vendors/*.sh "$(DESTDIR)$(VHDL_LIB_DIR)/vendors/"
772 uninstall.vhdllib:
773 $(RM) -rf $(DESTDIR)$(VHDL_LIB_DIR)
775 ####################### pyGHDL standalone ################################
777 setup-standalone.py: $(srcdir)/setup-standalone.in
779 sed -n -e '1,/^#@__init__/p' < $<; \
780 sed -n -e '/__author__/,/^$$/p' < $(srcdir)/pyGHDL/__init__.py; \
781 echo 'srcdir = "$(srcdir)"' ; \
782 echo 'soext = "$(SOEXT)"'; \
783 sed -n -e '/^#@__init__/,$$p' < $< ; \
784 ) > $@
786 python-wheel: setup-standalone.py lib/$(libghdl_name) libs copy.libghdl.deps$(SOEXT)
787 $(RM) -rf dist-wheel
788 $(MKDIR) dist-wheel
789 # Copy pyGHDL
790 $(CP) -Rp $(srcdir)/pyGHDL dist-wheel/
791 # Copy libraries
792 for d in $(VHDLLIB_SUBDIRS); do \
793 $(MKDIR) -p dist-wheel/pyGHDL/lib/ghdl/$$d; \
794 $(INSTALL_DATA) -p \
795 $(LIBDST_DIR)/$$d/* dist-wheel/pyGHDL/lib/ghdl/$$d; \
796 done
797 # Copy libghdl
798 $(INSTALL_PROGRAM) -p lib/$(libghdl_name) dist-wheel/pyGHDL/lib/
799 # Copy dll
800 if ls bin/lib*.dll 2> /dev/null; then \
801 $(MKDIR) -p dist-wheel/pyGHDL/bin; \
802 $(INSTALL_PROGRAM) -p bin/lib*.dll dist-wheel/pyGHDL/bin; \
805 ####################### clean ############################################
807 clean: force
808 $(RM) -f *.o *.ali b~*.ad? *~ *.d b__*.ad? *.a *.so *.deps *.bexch version.* *.dll *.dylib
809 $(RM) -f ghdl_gcc$(EXEEXT) ghdl_mcode$(EXEEXT) ghdl$(EXEEXT) ghdl_llvm$(EXEEXT) ghdl_llvm_jit$(EXEEXT) ghdl_simul$(EXEEXT)
810 $(RM) -f ghdl1-gcc$(EXEEXT) ghdl1-llvm$(EXEEXT) ghdl1-debug$(EXEEXT)
811 $(RM) -f grt/run-bind.ad? grt.lst grt/grt-files grt/grt-files.in
812 $(RM) -f grt/*.o grt/*.ali
813 $(RM) -rf lib
814 $(MAKE) create-dirs
816 distclean: clean
817 $(RM) -f default_paths.ads ortho_code-x86-flags.ads
818 $(RM) -f elf_arch.ads ghdlsynth_maybe.ads
819 $(RM) -f grt/grt-backtrace-impl.ads
820 $(RM) -f Makefile config.status ghdl.gpr
822 clean-c: force
823 $(RM) -f memsegs_c.o chkstk.o chkstk-x64.o jumps.o times.o
824 $(RM) -f grt-cstdio.o grt-cgnatrts.o grt-modules.o
825 $(RM) -f grt-cvpi.o grt-cvhpi.o grt-cdynload.o
826 $(RM) -f fstapi.o fastlz.o lz4.o
827 $(RM) -f pic/times.o pic/grt-cvpi.o pic/grt-cvhpi.o pic/jumps.o
828 $(RM) -f pic/grt-cstdio.o pic/grt-cgnatrts.o pic/grt-modules.o
829 $(RM) -f pic/grt-cdynload.o
831 create-dirs: force
832 for d in $(VHDLLIB_SUBDIRS); do \
833 $(MKDIR) -p $(LIBDST_DIR)/$$d; \
834 done
836 # Remove non GPL compatible source files
837 clean-pure-gpl:
838 # Vital libraries aren't GPL compatible
839 $(RM) -rf libraries/vital95 libraries/vital2000
840 # The GNA testsuite contains open-source reproducer that may not be GPL.
841 $(RM) -rf testsuite/gna
843 force:
845 .PHONY: force clean distclean clean-c clean-pure-gpl
847 # Most of the compilation is done through gnatmake, so using make -jX it not
848 # very effective.
849 # Hint: for parallel build use: make GNATMAKE="gnatmake -j8"
850 # Parallel builds may fail with the llvm backend as it can start two gnatmake
851 # in parallel: one for ghdl_llvm and the other for ghdl1-llvm. But they
852 # share the same objects.
853 # Any better fix is welcome!
854 .NOTPARALLEL: