Commit 3e9b29fb authored by spigafi's avatar spigafi

Added make distclean: revert distribution to the original status

git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@11957 c92efa57-630b-4861-b058-cf58834340f0
parent 53cb7413
......@@ -15,7 +15,7 @@ default :
@echo ' '
@echo 'where target identifies one or multiple CORE PACKAGES:'
@echo ' pw basic code for scf, structure optimization, MD'
@echo ' ph phonon code, Gamma-only version and third-order derivatives'
@echo ' ph phonon code, Gamma-only and third-order derivatives'
@echo ' pwcond ballistic conductance'
@echo ' neb code for Nudged Elastic Band method'
@echo ' pp postprocessing programs'
......@@ -49,8 +49,8 @@ default :
@echo ' tar create a tarball of the source tree'
@echo ' tar-gui create a standalone PWgui tarball from the GUI sources'
@echo ' clean remove executables and objects'
@echo ' veryclean revert distribution to the original status'
@echo ' veryclean remove files produced by "configure" as well'
@echo ' distclean revert distribution to the original status'
###########################################################
# Main targets
......@@ -209,7 +209,8 @@ touch-dummy :
inst :
( for exe in */*/*.x */bin/* ; do \
file=`basename $$exe`; if test "$(INSTALLDIR)" != ""; then \
if test ! -L $(PWD)/$$exe; then ln -fs $(PWD)/$$exe $(INSTALLDIR)/qe_$$file ; fi ; \
if test ! -L $(PWD)/$$exe; then \
ln -fs $(PWD)/$$exe $(INSTALLDIR)/qe_$$file ; fi ; \
fi ; \
done )
......@@ -220,11 +221,14 @@ links : bindir
for exe in ../*/*/*.x ../*/bin/* ; do \
if test ! -L $$exe ; then ln -fs $$exe . ; fi \
done ; \
[ -f ../WANT/wannier/dos.x ] && ln -fs ../WANT/wannier/dos.x ../bin/dos_want.x ; \
[ -f ../PP/src/dos.x ] && ln -fs ../PP/src/dos.x ../bin/dos.x ; \
[ -f ../WANT/wannier/bands.x ] && ln -fs ../WANT/wannier/bands.x ../bin/bands_want.x ; \
[ -f ../WANT/wannier/dos.x ] && \
ln -fs ../WANT/wannier/dos.x ../bin/dos_want.x ; \
[ -f ../PP/src/dos.x ] && \
ln -fs ../PP/src/dos.x ../bin/dos.x ; \
[ -f ../WANT/wannier/bands.x ] && \
ln -fs ../WANT/wannier/bands.x ../bin/bands_want.x ; \
[ -f ../PP/src/dos.x ] && ln -fs ../PP/src/bands.x ../bin/bands.x ; \
[ -f ../W90/wannier90.x ] && ln -fs ../W90/wannier90.x ../bin/wannier90.x ; \
[ -f ../W90/wannier90.x ] && ln -fs ../W90/wannier90.x ../bin/wannier90.x ;\
)
#########################################################
......@@ -234,7 +238,8 @@ links : bindir
install : touch-dummy
if test -d bin ; then \
mkdir -p $(PREFIX) ; for x in `find . -name *.x -type f` ; do cp $$x $(PREFIX)/ ; done ; \
mkdir -p $(PREFIX) ; for x in `find . -name *.x -type f` ; do \
cp $$x $(PREFIX)/ ; done ; \
fi
#########################################################
......@@ -270,8 +275,8 @@ clean : doc_clean
- cd PW/tests; /bin/rm -rf CRASH *.out *.out? ; cd -
- cd CPV/tests; /bin/rm -rf CRASH *.out *.out?
# remove configuration files too
distclean veryclean : clean
# remove files produced by "configure" as well
veryclean : clean
- @(cd install ; $(MAKE) -f plugins_makefile veryclean)
- @(cd install ; $(MAKE) -f extlibs_makefile veryclean)
- rm -rf install/patch-plumed
......@@ -284,6 +289,10 @@ distclean veryclean : clean
- rm -f espresso.tar.gz
- rm -rf make.sys
# remove everything not in the original distribution
distclean : veryclean
( cd install ; $(MAKE) -f plugins_makefile $@ || exit 1 )
tar :
@if test -f espresso.tar.gz ; then /bin/rm espresso.tar.gz ; fi
# do not include unneeded stuff
......
......@@ -56,9 +56,9 @@ test -e ./install/configure.msg && rm ./install/configure.msg
#test -e ./install/Makefile && rm ./install/Makefile
# SAFEGUARD: if you run configure without clean everything first there
# are chances that something goes wrong. Forcing distclean then.
# are chances that something goes wrong. Forcing veryclean then.
if [[ (-e make.sys) && (-e Makefile) && !($@ =~ "--help") ]] ; then
make -f Makefile distclean
make -f Makefile veryclean
fi
./install/configure "$@"
......
......@@ -8,7 +8,7 @@
#
# Makefile for plugins
include ../make.sys
sinclude ../make.sys
include plugins_list
# MAIN target
......@@ -411,6 +411,9 @@ ld1_clean:
ld1_veryclean: ld1_clean
# dir is not deleted for compatibility with the repository
ld1_distclean:
rm -f ../archive/$(LD1).tar.gz
xspectra_clean:
if test -d ../XSpectra; then (cd ../XSpectra; \
$(MAKE) clean); fi
......@@ -420,6 +423,9 @@ xspectra_clean:
xspectra_veryclean: xspectra_clean
# dir is not deleted for compatibility with the repository
xspectra_distclean:
rm -f ../archive/$(XSPECTRA).tar.gz
pwcond_clean:
if test -d ../PWCOND; then (cd ../PWCOND; \
$(MAKE) clean); fi
......@@ -429,6 +435,9 @@ pwcond_clean:
pwcond_veryclean: pwcond_clean
# dir is not deleted for compatibility with the repository
pwcond_distclean:
rm -f ../archive/$(PWCOND).tar.gz
neb_clean:
if test -d ../NEB; then (cd ../NEB; \
$(MAKE) clean); fi
......@@ -438,6 +447,9 @@ neb_clean:
neb_veryclean: neb_clean
# dir is not deleted for compatibility with the repository
neb_distclean:
rm -f ../archive/$(NEB).tar.gz
tddfpt_clean:
if test -d ../TDDFPT; then (cd ../TDDFPT; \
$(MAKE) clean); fi
......@@ -448,6 +460,9 @@ tddfpt_clean:
tddfpt_veryclean: tddfpt_clean
# dir is not deleted for compatibility with the repository
tddfpt_distclean:
rm -f ../archive/$(TDDFPT).tar.gz
phonon_clean:
if test -d ../PHonon; then (cd ../PHonon; \
$(MAKE) clean); fi
......@@ -466,6 +481,9 @@ phonon_veryclean: phonon_clean
# dir is not deleted for compatibility with the repository
# exe links to main bin dir are deleted by PHonon Makefile
phonon_distclean:
rm -f ../archive/$(PHONON).tar.gz
gipaw_clean:
if test -d ../GIPAW; then (cd ../GIPAW; $(MAKE) clean); fi
rm -f ../bin/gipaw.x
......@@ -476,6 +494,11 @@ gipaw_veryclean: gipaw_clean
rm -f config.log config.status ); fi
rm -rf ./configure-gipaw
gipaw_distclean:
if test -d ../GIPAW; then (rm -R -f ../GIPAW ); fi
if test -d ../$(GIPAW); then (rm -R -f ../$(GIPAW) ); fi
rm -f ../archive/$(GIPAW).tar.gz
epw_clean:
if test -d ../EPW; then (cd ../EPW; \
$(MAKE) clean); fi
......@@ -484,6 +507,8 @@ epw_clean:
epw_veryclean: epw_clean
epw_distclean: epw_clean
w90_clean:
if test -d ../W90; then (cd ../W90; \
$(MAKE) veryclean); fi
......@@ -496,6 +521,9 @@ w90_veryclean: w90_clean
rm -f ../bin/wannier90.x
rm -rf ./uncompress-w90
w90_distclean:
rm -f ../archive/$(W90).tar.gz
want_clean:
if test -d ../WANT; then (cd ../WANT; \
$(MAKE) clean); fi
......@@ -507,6 +535,9 @@ want_veryclean: want_clean
if test -e ../archive/$(WANT).tar.gz ; then (rm -f ../archive/$(WANT).tar.gz); fi
- rm -rf ./uncompress-want
want_distclean:
rm -f ../archive/$(WANT).tar.gz
yambo_clean:
if test -d ../YAMBO; then (cd ../YAMBO; \
$(MAKE) clean); fi
......@@ -515,9 +546,12 @@ yambo_clean:
yambo_veryclean: yambo_clean
if test -d ../YAMBO; then (rm -R -f ../YAMBO); fi
if test -d ../$(YAMBO); then (rm -R -f ../$(YAMBO)); fi
if test -e ../archive/$(YAMBO).tar.gz ; then (rm -f ../archive/$(YAMBO).tar.gz); fi
- rm -rf ./uncompress-yambo
yambo_distclean:
if test -e ../archive/$(YAMBO).tar.gz ; then \
rm -f ../archive/$(YAMBO).tar.gz; fi
yambo-devel_clean:
if test -d ../YAMBO_DEVEL; then (cd ../YAMBO_DEVEL; \
$(MAKE) clean); fi
......@@ -526,10 +560,13 @@ yambo-devel_clean:
yambo-devel_veryclean: yambo-devel_clean
if test -d ../YAMBO_DEVEL; then (rm -R -f ../YAMBO_DEVEL); fi
if test -d ../$(YAMBO_DEVEL); then (rm -R -f ../$(YAMBO_DEVEL)); fi
if test -e ../archive/$(YAMBO_DEVEL).tar.gz ; then (rm -f ../archive/$(YAMBO_DEVEL).tar.gz); fi
- rm -rf ./uncompress-yambo-devel
plumed_clean:
yambo-devel_distclean:
if test -e ../archive/$(YAMBO_DEVEL).tar.gz ; then \
rm -f ../archive/$(YAMBO_DEVEL).tar.gz; fi
plumed_clean:
if test -d ../PLUMED; then (cd ../PLUMED; \
export plumedir="`pwd`" ; \
cd ../ ; ./plumedpatch_qespresso_5.2.sh -revert); fi
......@@ -541,6 +578,9 @@ plumed_veryclean: plumed_clean
if test -d ../$(PLUMED); then (rm -R -f ../$(PLUMED)); fi
rm -rf ./uncompress-plumed ../plumedpatch_qespresso_5.2.sh
plumed_distclean:
# Nothing to do here
sax_clean:
if test -d ../SaX; then (cd ../SaX; \
$(MAKE) clean); fi
......@@ -551,6 +591,9 @@ sax_veryclean: sax_clean
if test -d ../$(SAX); then (rm -R -f ../$(SAX)); fi
- rm -rf ./uncompress-sax
sax_distclean:
rm -f ../archive/$(SAX).tar.gz
west_clean:
if test -d ../West; then (cd ../West; \
$(MAKE) clean); fi
......@@ -559,30 +602,52 @@ west_clean:
west_veryclean: west_clean
# dir is not deleted for compatibility with the repository
west_distclean:
rm -f ../archive/$(WEST).tar.gz
gui_clean:
rm -rf ./make-gui
gui_veryclean: gui_clean
# dir is not deleted for compatibility with the repository
gui_distclean:
test-suite_clean:
if test -d ../test-suite; then (cd ../test-suite; \
$(MAKE) clean); fi
test-suite_veryclean: test-suite_clean
test-suite_distclean:
rm -f ../archive/$(TESTSUITE).tar.gz
gpu_clean:
rm -f ./make-gpu
gpu_veryclean: gpu_clean
# dir is not deleted for compatibility with the repository
gpu_distclean:
rm -f ../archive/$(GPU).tar.gz
##########################################################
# general cleaning
##########################################################
clean: w90_clean want_clean yambo_clean yambo-devel_clean plumed_clean epw_clean \
gui_clean phonon_clean tddfpt_clean xspectra_clean neb_clean pwcond_clean \
ld1_clean gipaw_clean gpu_clean west_clean test-suite_clean
clean: w90_clean want_clean yambo_clean yambo-devel_clean plumed_clean \
epw_clean gui_clean phonon_clean tddfpt_clean xspectra_clean neb_clean \
pwcond_clean ld1_clean gipaw_clean gpu_clean west_clean test-suite_clean
veryclean: w90_veryclean want_veryclean yambo_veryclean yambo-devel_veryclean \
plumed_veryclean epw_veryclean gui_veryclean phonon_veryclean \
tddfpt_veryclean xspectra_veryclean neb_veryclean pwcond_veryclean \
ld1_veryclean gipaw_veryclean gpu_veryclean west_veryclean \
test-suite_veryclean
#distclean : veryclean
distclean: w90_distclean want_distclean yambo_distclean yambo-devel_distclean \
epw_distclean gui_distclean phonon_distclean test-suite_distclean \
tddfpt_distclean xspectra_distclean neb_distclean pwcond_distclean \
ld1_distclean gipaw_distclean gpu_distclean west_distclean
veryclean: w90_veryclean want_veryclean yambo_veryclean yambo-devel_veryclean plumed_veryclean epw_veryclean \
gui_veryclean phonon_veryclean tddfpt_veryclean xspectra_veryclean neb_veryclean \
pwcond_veryclean ld1_veryclean gipaw_veryclean gpu_veryclean west_veryclean
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment