Re: [PATCH] BUILD: script to clean the build files


Michael Schonberg <mschonberg@...>
 

On 11/08/2011 12:41 PM, Jacobraj Benet wrote:
A script has been added to clear off all the build related files and this script would be triggered on dist clean command from Makefile.

This script basically clears all the build files, which makes it easy to merge and also check for any difference between the local files and the files in the repository.
Your mail client is not encoding the patch correctly. It is definitely
converting tabs to spaces which breaks the Makefile and has other formatting
issues as well. If you can't get your email client to send the patch
correctly, it is probably best to include a plain text attachment in addition
to the in-line patch. See:
http://kerneltrap.org/Linux/Email_Clients_and_Patches. I have also had good
luck with git-send-email; however, you will likely need a gmail account or
something similar which you can configure to send email as jbenet@nyx.com.

Try to keep the margin for your description at 80 characters.

Signed-off-by: Jacobraj Benet <jbenet@nyx.com <mailto:jbenet@nyx.com>>

----
diff --git a/Makefile b/Makefile
index 24c7555..e2df1e8 100644
--- a/Makefile
+++ b/Makefile
@@ -49,3 +49,6 @@ common-clean:
install: common-install mama-install

clean: common-clean mama-clean
+
+distclean: clean
+ ./clearBuildFiles.sh
This should be:
sh ./clearBuildFiles.sh".
Note that your mailer changed the tab to a space here as well. You could also
add "#!/bin/sh" to the script and make sure that the executable bit is set.

We will also need to provide an alternative to the shell script when we
reintroduce windows support. I suspect that Python might be a good choice since
we already depend on it for regression tests. It also depends on what tools we
choose for windows builds. In any event the shell script is fine for the moment.



----
clearBuildFiles.sh
The patch fails to add this as a new file. We should have something like:

--- /dev/null
+++ b/clearBuildFiles.sh

If you are using git-diff to generate the patch, you need to add the new file,
commit your changes to your local repository and use "git diff HEAD^" to
generate the patch. If you format your checkin comment properly and setup git
with the correct configuration, git-format-patch works very well.

If you use diff you need to pass "-N" for new files to get applied correctly by
git-apply or git-am.

I will try to add some additional instructions to the web site.


cd common/c_cpp
rm -rf autom4te.cache etc
rm -rf config.h config.status etc stamp-h1 aclocal.m4 config.h.in <http://config.h.in> configure doxyconfig-c libtool Makefile.in autom4te.cache config.log Makefile
Your email client did something funky here with config.h.in.

Also, automake provides "distclean" and "maintainer-clean" targets that do a
lot of the work for you. Something like this might provide a good starting
point:

-----
diff --git a/Makefile b/Makefile
index 24c7555..b98dd94 100644
--- a/Makefile
+++ b/Makefile
@@ -49,3 +49,19 @@ common-clean:
install: common-install mama-install

clean: common-clean mama-clean
+
+mama-distclean:
+ cd mama/c_cpp ; make distclean; cd -
+
+common-distclean:
+ cd common/c_cpp ; make distclean -j1 -l80 ; cd -
+
+distclean: common-distclean mama-distclean
+
+cleanclean: distclean
+ cd mama/c_cpp ; make maintainer-clean; cd -
+ cd common/c_cpp ; make maintainer-clean; cd -
+
+
+
+
----

With this your script can be a lot smaller.

Also describe briefly how you verified the fix.

Regards,
-Mike

Join Openmama-dev@lists.openmama.org to automatically receive all group messages.