chiark / gitweb /
Chain build rules for guile and python bindings to avoid race conditions in parallel...
authorSam Creasey <sam.creasey@tri.global>
Tue, 12 Apr 2016 18:37:30 +0000 (14:37 -0400)
committerSam Creasey <sam.creasey@tri.global>
Tue, 12 Apr 2016 18:39:53 +0000 (14:39 -0400)
swig/Makefile.am

index 5ccbfe1ad3e881c884840319f07836ffadaf9bf4..0800b7b46c2ddbc5392d1e4f3a52b98deafa0638 100644 (file)
@@ -1,4 +1,4 @@
-SWIG_SRC = nlopt.i nlopt-exceptions.i nlopt-enum-renames.i 
+SWIG_SRC = nlopt.i nlopt-exceptions.i nlopt-enum-renames.i
 EXTRA_DIST = $(SWIG_SRC) nlopt-guile.i nlopt-python.i nlopt.scm.in nlopt.py numpy.i
 
 BUILT_SOURCES = nlopt-guile.cpp nlopt-python.cpp nlopt-enum-renames.i nlopt.scm.in
@@ -42,14 +42,18 @@ lib_LTLIBRARIES = $(guilelib)
 
 if MAINTAINER_MODE
 
-nlopt-guile.cpp nlopt.scm.in: $(SWIG_SRC) nlopt-guile.i $(HDR)
+nlopt-guile.cpp: $(SWIG_SRC) nlopt-guile.i $(HDR)
        swig -I$(top_srcdir)/api -outdir $(builddir) -c++ -guile -scmstub -o $@ $(srcdir)/nlopt.i
        rm -f nlopt.scm.in
        mv nlopt.scm nlopt.scm.in
 
-nlopt-python.cpp nlopt.py: $(SWIG_SRC) nlopt-python.i numpy.i $(HDR)
+nlopt.scm.in: nlopt-guile.cpp
+
+nlopt-python.cpp: $(SWIG_SRC) nlopt-python.i numpy.i $(HDR)
        swig -I$(top_srcdir)/api -outdir $(builddir) -c++ -python -o $@ $(srcdir)/nlopt.i
 
+nlopt.py: nlopt-python.cpp
+
 nlopt-enum-renames.i: $(top_srcdir)/api/nlopt.h
        (echo "// AUTOMATICALLY GENERATED -- DO NOT EDIT"; egrep 'NLOPT_[LG][DN]|NLOPT_AUGLAG|NLOPT_G_MLSL|NLOPT_NUM_ALGORITHMS' $(top_srcdir)/api/nlopt.h | sed 's/NLOPT_//g' |tr -d ' ' |tr '/' ',' |tr '=' ',' |cut -d, -f1 |while read name; do echo "%rename(NLOPT_$$name) nlopt::$$name;"; done; egrep 'NLOPT_[A-Z_]* =' $(top_srcdir)/api/nlopt.h | egrep -v 'NLOPT_[LG][DN]|NLOPT_AUGLAG|NLOPT_G_MLSL' | sed 's/NLOPT_//g' |tr -d ' ' |cut -d'=' -f1 | while read name; do echo "%rename(NLOPT_$$name) nlopt::$$name;"; done) > $@