From b5f9c86eaa91385a827ec7e965db88b982fb9eb5 Mon Sep 17 00:00:00 2001 From: xantares Date: Thu, 29 Aug 2013 11:20:55 +0200 Subject: [PATCH] Fixed out-of-source build --- Makefile.am | 2 +- api/Makefile.am | 4 ++-- swig/Makefile.am | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index f1d9bd3..ad699ee 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,6 +31,6 @@ pkgconfig_DATA = nlopt.pc if MAINTAINER_MODE README: README.md - cp -f README.md $@ + cp -f $(srcdir)/README.md $@ endif diff --git a/api/Makefile.am b/api/Makefile.am index 7605f8f..d4d08d2 100644 --- a/api/Makefile.am +++ b/api/Makefile.am @@ -15,10 +15,10 @@ if MAINTAINER_MODE nlopt.f: nlopt.h rm -f $@ - (i=0; egrep 'NLOPT_[LG][DN]|NLOPT_AUGLAG|NLOPT_G_MLSL' $(srcdir)/nlopt.h | tr -d ' =0,' | while read n; do echo " integer $$n"; echo " parameter ($$n=$$i)"; i=`expr $$i + 1`; done; tail -n +`grep -n enum $(srcdir)/nlopt.h |cut -d: -f1 |tail -n 1` $(srcdir)/nlopt.h | grep NLOPT | egrep -v 'EXTERN|DEPRECATED|MINF_MAX' | cut -d, -f1 | tr -d ' ' | perl -pe 's/([A-Za-z0-9_]+)=([-+0-9]+)/ integer \1\n parameter (\1=\2)/') > $@ + (i=0; egrep 'NLOPT_[LG][DN]|NLOPT_AUGLAG|NLOPT_G_MLSL' $(srcdir)/nlopt.h | tr -d ' =0,' | while read n; do echo " integer $$n"; echo " parameter ($$n=$$i)"; i=`expr $$i + 1`; done; tail -n +`grep -n enum $(srcdir)/nlopt.h |cut -d: -f1 |tail -n 1` $(srcdir)/nlopt.h | grep NLOPT | egrep -v 'EXTERN|DEPRECATED|MINF_MAX' | cut -d, -f1 | tr -d ' ' | perl -pe 's/([A-Za-z0-9_]+)=([-+0-9]+)/ integer \1\n parameter (\1=\2)/') > $(srcdir)/$@ nlopt.hpp: nlopt.h nlopt-in.hpp rm -f $@ - (n=`grep -n GEN_ENUMS_HERE nlopt-in.hpp | cut -d: -f1`; head -n $$n $(srcdir)/nlopt-in.hpp; echo " enum algorithm {"; egrep 'NLOPT_[LG][DN]|NLOPT_AUGLAG|NLOPT_G_MLSL|NLOPT_NUM_ALGORITHMS' $(srcdir)/nlopt.h | sed 's/NLOPT_//g'; echo " };"; echo " enum result {"; egrep 'NLOPT_[A-Z_]* =' $(srcdir)/nlopt.h | egrep -v 'NLOPT_[LG][DN]' | sed 's/NLOPT_//g'; echo " };"; tail -n +$$n $(srcdir)/nlopt-in.hpp) > $@ + (n=`grep -n GEN_ENUMS_HERE $(srcdir)/nlopt-in.hpp | cut -d: -f1`; head -n $$n $(srcdir)/nlopt-in.hpp; echo " enum algorithm {"; egrep 'NLOPT_[LG][DN]|NLOPT_AUGLAG|NLOPT_G_MLSL|NLOPT_NUM_ALGORITHMS' $(srcdir)/nlopt.h | sed 's/NLOPT_//g'; echo " };"; echo " enum result {"; egrep 'NLOPT_[A-Z_]* =' $(srcdir)/nlopt.h | egrep -v 'NLOPT_[LG][DN]' | sed 's/NLOPT_//g'; echo " };"; tail -n +$$n $(srcdir)/nlopt-in.hpp) > $(srcdir)/$@ endif diff --git a/swig/Makefile.am b/swig/Makefile.am index 180dd1a..5ccbfe1 100644 --- a/swig/Makefile.am +++ b/swig/Makefile.am @@ -43,12 +43,12 @@ lib_LTLIBRARIES = $(guilelib) if MAINTAINER_MODE nlopt-guile.cpp nlopt.scm.in: $(SWIG_SRC) nlopt-guile.i $(HDR) - swig -I$(top_srcdir)/api -outdir $(builddir) -c++ -guile -scmstub -o $@ nlopt.i + 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) - swig -I$(top_srcdir)/api -outdir $(builddir) -c++ -python -o $@ nlopt.i + swig -I$(top_srcdir)/api -outdir $(builddir) -c++ -python -o $@ $(srcdir)/nlopt.i 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) > $@ -- 2.30.2