chiark / gitweb /
Fixed out-of-source build
authorxantares <xantares09@hotmail.com>
Thu, 29 Aug 2013 09:20:55 +0000 (11:20 +0200)
committerxantares <xantares09@hotmail.com>
Thu, 29 Aug 2013 09:20:55 +0000 (11:20 +0200)
Makefile.am
api/Makefile.am
swig/Makefile.am

index f1d9bd3436963bc86241470aac9b3a9fad129c42..ad699ee03a285c56788f36ac6466863ea2f1d0ef 100644 (file)
@@ -31,6 +31,6 @@ pkgconfig_DATA = nlopt.pc
 if MAINTAINER_MODE
 
 README: README.md
-       cp -f README.md $@
+       cp -f $(srcdir)/README.md $@
 
 endif
index 7605f8fe05b7a586f82248057ab482d2fe2f4c70..d4d08d2945d01ac0ed03190116095ec525254ae4 100644 (file)
@@ -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
index 180dd1a5639b72bd36a2c2f395aa7f56e1c7f335..5ccbfe1ad3e881c884840319f07836ffadaf9bf4 100644 (file)
@@ -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) > $@