aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.in
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-07-02 19:01:27 +0200
committerTristan Gingold <tgingold@free.fr>2019-07-02 19:01:27 +0200
commit53dc06a6087ee41cbf75b0f5731ee16078876ec0 (patch)
tree1983a6778390fd30e6077643e1dfb4f2a8f6774a /Makefile.in
parentcef6f89a83ee96075b19b7fc5ceb06f727444ad0 (diff)
downloadghdl-53dc06a6087ee41cbf75b0f5731ee16078876ec0.tar.gz
ghdl-53dc06a6087ee41cbf75b0f5731ee16078876ec0.tar.bz2
ghdl-53dc06a6087ee41cbf75b0f5731ee16078876ec0.zip
Makefile: automatically rebuild ghdlsynth_gates.h.
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in19
1 files changed, 13 insertions, 6 deletions
diff --git a/Makefile.in b/Makefile.in
index 15af42141..71420dd95 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -406,23 +406,30 @@ libghdl-py.tgz:
################ ghdlsynth library ######################################
-GHDL_SYNTHLIB_INCFLAGS=$(GHDL_COMMON_INCFLAGS) -aI$(srcdir)/src/synth -aI$(srcdir)/src/ghdldrv -aI$(srcdir)/src/vhdl/simulate
+GHDL_SYNTHLIB_INCFLAGS=$(GHDL_COMMON_INCFLAGS) -aI$(srcdir)/src/synth -aI$(srcdir)/src/ghdldrv
-libghdlsynth.a: $(GRT_ADD_OBJS) $(GRT_SRC_DEPS) version.ads force
+libghdlsynth.a: $(GRT_SRC_DEPS) version.ads force
$(GNATMAKE) -c libghdlsynth $(GNATFLAGS) -gnat12 $(GHDL_SYNTHLIB_INCFLAGS)
gnatbind -Llibghdlsynth_ libghdlsynth.ali -O > ghdlsynth.files
# Extract link options, be sure to link statically with libgnat
gnatbind -Llibghdlsynth_ libghdlsynth.ali -K -Z | sed -e '\@adalib/$$@s/-L//' -e '\@adalib/@s@adalib/@adalib/libgnat.a@' -e '/-lgnat/d' > ghdlsynth.link
$(GNATMAKE) -c b~libghdlsynth.adb
$(RM) -f $@
- ar rc $@ b~libghdlsynth.o `cat ghdlsynth.files` $(GRT_ADD_OBJS)
+ ar rc $@ b~libghdlsynth.o `cat ghdlsynth.files`
-libghdlsynth$(SOEXT): $(GRT_ADD_SHOBJS) $(GRT_SRC_DEPS) version.ads force
- $(GNATMAKE) -I- -aI. -D pic -z libghdlsynth -o $@ $(GNATFLAGS) $(PIC_FLAGS) -gnat12 $(GHDL_SYNTHLIB_INCFLAGS) -bargs -shared -Llibghdlsynth_ -largs -shared $(GRT_ADD_SHOBJS) $(SHLIB_FLAGS)
+libghdlsynth$(SOEXT): $(GRT_SRC_DEPS) version.ads force
+ $(GNATMAKE) -I- -aI. -D pic -z libghdlsynth -o $@ $(GNATFLAGS) $(PIC_FLAGS) -gnat12 $(GHDL_SYNTHLIB_INCFLAGS) -bargs -shared -Llibghdlsynth_ -largs -shared $(SHLIB_FLAGS)
+
+$(srcdir)/src/synth/ghdlsynth_gates.h: $(srcdir)/src/synth/netlists.ads $(srcdir)/src/synth/netlists-gates.ads
+ echo "/* DO NOT MODIFY" > $@
+ echo " This file is automatically generated by Makefile. */" >> $@
+ echo "enum Module_Id {" >> $@
+ grep -h "constant Module_Id :=" $^ | sed -e '/constant Module_Id :=/s/:.*://' -e 's/;/,/' -e 's/ *--.*//' >> $@
+ echo "};" >> $@
install.libghdlsynth: install.libghdlsynth.include install.libghdlsynth.static install.libghdlsynth.shared
-install.libghdlsynth.include: install.dirs
+install.libghdlsynth.include: install.dirs $(srcdir)/src/synth/ghdlsynth_gates.h
$(INSTALL_DATA) -p $(srcdir)/src/synth/ghdlsynth.h $(DESTDIR)$(incdir)/
$(INSTALL_DATA) -p $(srcdir)/src/synth/ghdlsynth_gates.h $(DESTDIR)$(incdir)/