Topics

[PATCH] BUILD: script to clean the build files


Jacobraj Benet <JBenet@...>
 

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.

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

----
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

----
clearBuildFiles.sh

cd common/c_cpp
rm -rf autom4te.cache etc
rm -rf config.h config.status etc stamp-h1 aclocal.m4 config.h.in configure doxyconfig-c libtool Makefile.in autom4te.cache config.log Makefile 
cd - ; cd common/c_cpp/src
rm -rf Makefile Makefile.in
cd - ; cd common/c_cpp/src/c
rm -rf Makefile Makefile.in .deps properties.c version.h
cd -;

cd mama/c_cpp
rm -rf autom4te.cache etc
rm -rf config.h config.status etc stamp-h1 aclocal.m4 config.h.in configure doxyconfig-c libtool Makefile.in autom4te.cache config.log Makefile
cd -; cd mama/c_cpp/src
rm -rf Makefile Makefile.in .deps

cd -; cd mama/c_cpp/src/c
rm -rf Makefile Makefile.in .deps version.c

cd -; cd mama/c_cpp/src/c/mama
rm -rf version.h

cd -; cd mama/c_cpp/src/examples
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/examples/c
rm -rf Makefile Makefile.in .deps
cd common/c_cpp
rm -rf autom4te.cache etc
rm -rf config.h config.status etc stamp-h1 aclocal.m4 config.h.in configure doxyconfig-c libtool Makefile.in autom4te.cache config.log Makefile 
cd - ; cd common/c_cpp/src
rm -rf Makefile Makefile.in
cd - ; cd common/c_cpp/src/c
rm -rf Makefile Makefile.in .deps properties.c version.h
cd -;

cd mama/c_cpp
rm -rf autom4te.cache etc
rm -rf config.h config.status etc stamp-h1 aclocal.m4 config.h.in configure doxyconfig-c libtool Makefile.in autom4te.cache config.log Makefile
cd -; cd mama/c_cpp/src
rm -rf Makefile Makefile.in .deps

cd -; cd mama/c_cpp/src/c
rm -rf Makefile Makefile.in .deps version.c

cd -; cd mama/c_cpp/src/c/mama
rm -rf version.h

cd -; cd mama/c_cpp/src/examples
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/examples/c
rm -rf Makefile Makefile.in .deps

cd -; cd mama/c_cpp/src/testtools
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/testtools/load/c
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/testtools/load
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/testtools/performance/c
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/testtools/performance
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/testtools/capturereplay/c
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/testtools/capturereplay
rm -rf Makefile Makefile.in .deps

cd -; cd mama/c_cpp/src/regression
rm -rf Makefile Makefile.in .deps

cd -; cd mama/c_cpp/src/gunittest
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/gunittest/c
rm -rf Makefile Makefile.in .deps

cd -; cd mama/c_cpp/src/c/payload
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/c/payload/avismsg
rm -rf Makefile Makefile.in .deps

cd -; cd mama/c_cpp/src/c/bridge
rm -rf Makefile Makefile.in .deps

cd -; cd mama/c_cpp/src/c/bridge/avis
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/testtools
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/testtools/load/c
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/testtools/load
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/testtools/performance/c
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/testtools/performance
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/testtools/capturereplay/c
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/testtools/capturereplay
rm -rf Makefile Makefile.in .deps

cd -; cd mama/c_cpp/src/regression
rm -rf Makefile Makefile.in .deps

cd -; cd mama/c_cpp/src/gunittest
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/gunittest/c
rm -rf Makefile Makefile.in .deps

cd -; cd mama/c_cpp/src/c/payload
rm -rf Makefile Makefile.in .deps
cd -; cd mama/c_cpp/src/c/payload/avismsg
rm -rf Makefile Makefile.in .deps

cd -; cd mama/c_cpp/src/c/bridge
rm -rf Makefile Makefile.in .deps

cd -; cd mama/c_cpp/src/c/bridge/avis
rm -rf Makefile Makefile.in .deps

 

Jacobraj Benet

NYSE Technologies

+1 312 442 7956

 




Please consider the environment before printing this email.

Visit our website at http://www.nyse.com
*****************************************************************************
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.


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