From dcff01faa00fcc1d5d7b9e71424b7d555ce2878e Mon Sep 17 00:00:00 2001
From: Stefano Miccoli <mocme@icloud.com>
Date: Thu, 10 Jul 2014 18:25:34 +0200
Subject: [PATCH 2/4] corrections to some Makefile.am

mostly correct for files included in DISTFILES but actually built by configure

enusure that all built files are deleted by 'make distclean'

correct for some files built by swig but included in DISTFILES
---
 module/owcapi/src/Makefile.am  |  4 +++-
 module/ownet/c/src/Makefile.am |  4 +++-
 module/ownet/php/Makefile.am   |  4 +++-
 module/swig/perl5/Makefile.am  |  9 +++++++--
 module/swig/php/Makefile.am    | 12 ++++--------
 module/swig/python/Makefile.am |  2 +-
 src/include/Makefile.am        |  1 -
 7 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/module/owcapi/src/Makefile.am b/module/owcapi/src/Makefile.am
index 9eb1642..afa4a4b 100644
--- a/module/owcapi/src/Makefile.am
+++ b/module/owcapi/src/Makefile.am
@@ -1,7 +1,9 @@
 SUBDIRS = c include
 
 # don't want to add the example as a subdirectory right now...
-EXTRA_DIST = example++/owcapiexample.cpp example++/Makefile.example example++/Makefile example++/Makefile.in example/owcapiexample.c example/Makefile.example example/Makefile example/Makefile.in
+EXTRA_DIST = example++/owcapiexample.cpp example++/Makefile.example example++/Makefile.in example/owcapiexample.c example/Makefile.example example/Makefile.in
+
+DISTCLEANFILES = example++/Makefile example/Makefile
 
 clean-generic:
 
diff --git a/module/ownet/c/src/Makefile.am b/module/ownet/c/src/Makefile.am
index f3da68b..0d87c58 100644
--- a/module/ownet/c/src/Makefile.am
+++ b/module/ownet/c/src/Makefile.am
@@ -1,7 +1,9 @@
 SUBDIRS = c include
 
 # don't want to add the example as a subdirectory right now...
-EXTRA_DIST = example/ownetexample.c example/Makefile.example example/Makefile example/Makefile.in
+EXTRA_DIST = example/ownetexample.c example/Makefile.example example/Makefile.in
+
+DISTCLEANFILES = example/Makefile
 
 clean-generic:
 
diff --git a/module/ownet/php/Makefile.am b/module/ownet/php/Makefile.am
index fce12c8..efafca3 100644
--- a/module/ownet/php/Makefile.am
+++ b/module/ownet/php/Makefile.am
@@ -1,6 +1,8 @@
 ## $Id$
 
-EXTRA_DIST = ownet.php examples/bcadd.php examples/ownet_example.php.in examples/ownet_example.php
+EXTRA_DIST = ownet.php examples/bcadd.php examples/ownet_example.php.in
+
+DISTCLEANFILES = examples/ownet_example.php
 
 phpdir=${datadir}/php/OWNet
 
diff --git a/module/swig/perl5/Makefile.am b/module/swig/perl5/Makefile.am
index aabe319..8d47b69 100644
--- a/module/swig/perl5/Makefile.am
+++ b/module/swig/perl5/Makefile.am
@@ -2,6 +2,8 @@
 
 EXTRA_DIST = perl5.m4 OW/META.yml OW/README OW/MANIFEST OW/Changes OW/Makefile.linux.in OW/Makefile.osx.in OW/t/OW.t example/owdir.pl example/tree.pl
 
+DISTCLEANFILES = OW/Makefile.linux OW/Makefile.osx
+
 #all: OW/Makefile
 all: OW/blib/lib/OW.pm
 
@@ -40,8 +42,11 @@ OW/blib/lib/OW.pm: OW/ow_wrap.c
 install-data-local: OW/Makefile OW/ow_wrap.c OW/blib/lib/OW.pm
 	$(MAKE) -C OW install DESTDIR="$(DESTDIR)"
 
-clean-generic:
-	@RM@ -f *~ .*~
+clean-local:
 	if test -f OW/Makefile; then cd OW; $(MAKE) clean; fi
 	@RM@ -f OW/Makefile.old OW/Makefile OW/Makefile.PL OW/OW.pm OW/OW.bs OW/ow_wrap.c
 
+clean-generic:
+
+	@RM@ -f *~ .*~
+
diff --git a/module/swig/php/Makefile.am b/module/swig/php/Makefile.am
index 22be230..ca18d48 100644
--- a/module/swig/php/Makefile.am
+++ b/module/swig/php/Makefile.am
@@ -1,8 +1,8 @@
 # $Id$
 
 
-EXTRA_DIST = php.m4 example/owdir.php example/load_php_OW.php.in example/load_php_OW.php
-#noinst_DATA = ow_wrap.c php_OW.h
+EXTRA_DIST = php.m4 example/owdir.php example/load_php_OW.php.in
+DISTCLEANFILES = example/load_php_OW.php
 
 #use libtool to build the php extension
 lib_LTLIBRARIES = libowphp.la
@@ -29,14 +29,11 @@ AM_CFLAGS = -fexceptions \
 
 LDADD = -L../../owlib/src/c -low ${PTHREAD_LIBS} ${LD_EXTRALIBS} ${OSLIBS}
 
-libowphp_la_SOURCES = ow_wrap.c php_OW.h
+nodist_libowphp_la_SOURCES = ow_wrap.c php_OW.h
 
 ow_wrap.c: ../ow.i
 if ENABLE_OWPHP
-# avoid problem when "make dist" and there are no swig available
 	$(SWIG) -php -o $@ ../ow.i
-else
-	touch ow_wrap.c php_OW.h
 endif
 
 #install-data-local:
@@ -46,8 +43,7 @@ endif
 #	ln -sf ../../../lib/libowphp.so $(DESTDIR)$(EXTENSION_DIR)/php_OW.so
 
 clean-local:
-	@RM@ -f *~ .*~ *.o OW.* ow_wrap.c php_OW.h
+	@RM@ -f OW.* ow_wrap.c php_OW.h
 
 clean-generic:
-
 	@RM@ -f *~ .*~
diff --git a/module/swig/python/Makefile.am b/module/swig/python/Makefile.am
index e7ee6a2..3a3bef4 100644
--- a/module/swig/python/Makefile.am
+++ b/module/swig/python/Makefile.am
@@ -22,7 +22,7 @@ install-data-local:
 # Other options are (but not needed): --install-data="/$(DESTDIR)$(PYSITEDIR)" --install-script="/$(DESTDIR)$(PYSITEDIR)" --install-header=
 
 clean-local:
-	@RM@ -f *~ .*~ *.o configuration.log
+	@RM@ -f configuration.log
 	@RM@ -rf build OW.py ow_wrap.c
 
 clean-generic:
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index c4c3332..a704318 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -1,5 +1,4 @@
 owfsincludedir = ${prefix}/include
-owfsinclude_HEADERS = owfs_config.h
 
 clean-generic:
 
-- 
1.8.5.2 (Apple Git-48)

