This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Introduce a 'veryclean' target that is like 'distclean'
[perl5.git] / Makefile.SH
index f7ebb42..4a48ded 100644 (file)
@@ -676,14 +676,18 @@ n_dummy $(nonxs_ext):     miniperl preplibrary $(DYNALOADER) FORCE
 
 clean:         _tidy _mopup
 
-realclean:     _cleaner _mopup
+realclean:     _realcleaner _mopup
        @echo "Note that make realclean does not delete config.sh or Policy.sh"
 
-clobber:       _cleaner _mopup
+clobber:       _realcleaner _mopup
        rm -f config.sh cppstdin Policy.sh
+       -@rm -f Obsolete Wanted
 
 distclean:     clobber
 
+# Like distclean but also removes emacs backups and *.orig.
+veryclean:     _verycleaner _mopup
+
 # Do not 'make _mopup' directly.
 _mopup:
        rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c
@@ -704,15 +708,16 @@ _tidy:
        done
        rm -f testcompile compilelog
 
-# Do not 'make _cleaner' directly.
-_cleaner:
+_cleaner1:
        -cd os2; rm -f Makefile
-       -cd pod; $(LDLIBPTH) $(MAKE) realclean
-       -cd utils; $(LDLIBPTH) $(MAKE) realclean
-       -cd x2p; $(LDLIBPTH) $(MAKE) realclean
+       -cd pod; $(LDLIBPTH) $(MAKE) $(CLEAN)
+       -cd utils; $(LDLIBPTH) $(MAKE) $(CLEAN)
+       -cd x2p; $(LDLIBPTH) $(MAKE) $(CLEAN)
        -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
-       $(LDLIBPTH) sh ext/util/make_ext realclean $$x MAKE=$(MAKE) ; \
+       $(LDLIBPTH) sh ext/util/make_ext $(CLEAN) $$x MAKE=$(MAKE) ; \
        done
+
+_cleaner2:
        rm -f core core.*perl.*.? *perl.core t/core t/core.perl.*.? t/*perl.core t/misctmp* t/forktmp* t/tmp* t/c t/perl .?*.c so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR)
        rm -rf $(addedbyconf)
        rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old
@@ -724,6 +729,15 @@ _cleaner:
        rm -f testcompile compilelog
        -rmdir lib/B lib/Data lib/IO/Socket lib/IO lib/Sys
 
+_realcleaner: 
+       @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=realclean
+       @$(LDLIBPTH) $(MAKE) _cleaner2
+
+_verycleaner: 
+       @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=veryclean
+       @$(LDLIBPTH) $(MAKE) _cleaner2
+       -rm -f *~ *.orig */*~ */*.orig
+
 # The following lint has practically everything turned on.  Unfortunately,
 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message