aboutsummaryrefslogtreecommitdiffstats
path: root/manual/PRESENTATION_Prog
diff options
context:
space:
mode:
authorXiretza <xiretza@xiretza.xyz>2020-05-30 11:21:40 +0200
committerXiretza <xiretza@xiretza.xyz>2020-05-30 11:21:40 +0200
commit8b0ec3c3a24108d7d3bf42e05effd561d10a918b (patch)
tree362f6ef771954359a442b52036d8c0e428ff6992 /manual/PRESENTATION_Prog
parent0a14e1e837ad0aeae6944a9eafe1a14b79c12cb3 (diff)
downloadyosys-8b0ec3c3a24108d7d3bf42e05effd561d10a918b.tar.gz
yosys-8b0ec3c3a24108d7d3bf42e05effd561d10a918b.tar.bz2
yosys-8b0ec3c3a24108d7d3bf42e05effd561d10a918b.zip
Use in-tree include directory in manual build
This is basically the same issue as in tests/various/plugin.sh, which uses yosys-config to compile a plugin. `yosys-config --cxxflags` points to `$PREFIX/share/` (/usr/local/share by default), which might not exist yet or might be out of date. Building directly from the headers in ./share/ avoids this.
Diffstat (limited to 'manual/PRESENTATION_Prog')
-rw-r--r--manual/PRESENTATION_Prog/Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/manual/PRESENTATION_Prog/Makefile b/manual/PRESENTATION_Prog/Makefile
index 794f5c12c..7e3cf814b 100644
--- a/manual/PRESENTATION_Prog/Makefile
+++ b/manual/PRESENTATION_Prog/Makefile
@@ -1,8 +1,11 @@
all: test0.log test1.log test2.log
+CXXFLAGS=$(shell ../../yosys-config --cxxflags)
+DATDIR=$(shell ../../yosys-config --datdir)
+
my_cmd.so: my_cmd.cc
- ../../yosys-config --exec --cxx --cxxflags --ldflags -o my_cmd.so -shared my_cmd.cc --ldlibs
+ ../../yosys-config --exec --cxx $(subst $(DATDIR),../../share,$(CXXFLAGS)) --ldflags -o my_cmd.so -shared my_cmd.cc --ldlibs
test0.log: my_cmd.so
../../yosys -Ql test0.log_new -m ./my_cmd.so -p 'my_cmd foo bar' absval_ref.v