Simplify the clean targets
authorKyle Guinn <elyk03@gmail.com>
Mon, 6 Feb 2017 07:07:10 +0000 (01:07 -0600)
committerKyle Guinn <elyk03@gmail.com>
Mon, 6 Feb 2017 07:07:10 +0000 (01:07 -0600)
cleanobj:  Remove object files
cleanlib:  Remove libraries
cleanexe:  Remove test and example executables
cleantest: Remove test output and core dumps
clean:     All of the above

20 files changed:
BLAS/Makefile [new file with mode: 0644]
BLAS/SRC/Makefile
BLAS/TESTING/Makefile
CBLAS/Makefile
CBLAS/examples/Makefile
CBLAS/src/Makefile
CBLAS/testing/Makefile
DOCS/lawn81.tex
INSTALL/Makefile
LAPACKE/Makefile
LAPACKE/example/Makefile
LAPACKE/src/Makefile
LAPACKE/utils/Makefile
Makefile
SRC/Makefile
SRC/VARIANTS/Makefile
TESTING/EIG/Makefile
TESTING/LIN/Makefile
TESTING/MATGEN/Makefile
TESTING/Makefile

diff --git a/BLAS/Makefile b/BLAS/Makefile
new file mode 100644 (file)
index 0000000..f9c4b53
--- /dev/null
@@ -0,0 +1,22 @@
+include ../make.inc
+
+all: blas
+
+blas:
+       $(MAKE) -C SRC
+
+blas_testing: blas
+       $(MAKE) -C TESTING run
+
+clean:
+       $(MAKE) -C SRC clean
+       $(MAKE) -C TESTING clean
+cleanobj:
+       $(MAKE) -C SRC cleanobj
+       $(MAKE) -C TESTING cleanobj
+cleanlib:
+       $(MAKE) -C SRC cleanlib
+cleanexe:
+       $(MAKE) -C TESTING cleanexe
+cleantest:
+       $(MAKE) -C TESTING cleantest
index f9de3c6..a436365 100644 (file)
@@ -42,7 +42,7 @@ include ../../make.inc
 #  top-level make.inc
 #
 #  To remove the object files after the library is created, enter
-#       make clean
+#       make cleanobj
 #  To force the source files to be recompiled, enter, for example,
 #       make single FRC=FRC
 #
@@ -160,8 +160,11 @@ complex16: $(ZBLAS1) $(ZB1AUX) $(ALLBLAS) $(ZBLAS2) $(ZBLAS3)
 FRC:
        @FRC=$(FRC)
 
-clean:
+clean: cleanobj cleanlib
+cleanobj:
        rm -f *.o
+cleanlib:
+       #rm -f $(BLASLIB)  # May point to a system lib, e.g. -lblas
 
 .f.o:
        $(FORTRAN) $(OPTS) -c -o $@ $<
index 7fa4c48..97150b1 100644 (file)
@@ -47,8 +47,13 @@ run: all
        ./xblat3c < cblat3.in
        ./xblat3z < zblat3.in
 
-clean:
-       rm -f *.o xblat* *.out
+clean: cleanobj cleanexe cleantest
+cleanobj:
+       rm -f *.o
+cleanexe:
+       rm -f xblat*
+cleantest:
+       rm -f *.out core
 
 .f.o:
        $(FORTRAN) $(OPTS) -c -o $@ $<
index 2511f9e..513e8fc 100644 (file)
@@ -14,14 +14,18 @@ cblas_testing: cblas
 cblas_example: cblas
        $(MAKE) -C examples
 
-clean: cleanlib
-
-cleanlib:
+clean:
        $(MAKE) -C src clean
-
+       $(MAKE) -C testing clean
+       $(MAKE) -C examples clean
+cleanobj:
+       $(MAKE) -C src cleanobj
+       $(MAKE) -C testing cleanobj
+       $(MAKE) -C examples cleanobj
+cleanlib:
+       $(MAKE) -C src cleanlib
 cleanexe:
        $(MAKE) -C testing cleanexe
-
-cleanall: clean cleanexe
-       $(MAKE) -C src cleanall
-       $(MAKE) -C examples cleanall
+       $(MAKE) -C examples cleanexe
+cleantest:
+       $(MAKE) -C testing cleantest
index 2d6a8c7..664b8bc 100644 (file)
@@ -7,8 +7,11 @@ cblas_ex1: cblas_example1.o $(CBLASLIB) $(BLASLIB)
 cblas_ex2: cblas_example2.o $(CBLASLIB) $(BLASLIB)
        $(LOADER) $(LOADOPTS) -o $@ $^
 
-cleanall:
-       rm -f *.o cblas_ex1 cblas_ex2
+clean: cleanobj cleanexe
+cleanobj:
+       rm -f *.o
+cleanexe:
+       rm -f cblas_ex1 cblas_ex2
 
 .c.o:
        $(CC) $(CFLAGS) -I../include -c -o $@ $<
index 1a9a9c3..6c0518a 100644 (file)
@@ -189,13 +189,13 @@ $(CBLASLIB): $(alev1) $(alev2) $(alev3) $(errhand)
 FRC:
        @FRC=$(FRC)
 
-clean:
-       rm -f *.o a.out core
-cleanall:
+clean: cleanobj cleanlib
+cleanobj:
+       rm -f *.o
+cleanlib:
        rm -f $(CBLASLIB)
 
 .c.o:
        $(CC) $(CFLAGS) -I../include -c -o $@ $<
-
 .f.o:
        $(FORTRAN) $(OPTS) -c -o $@ $<
index 2ef499c..0182c3e 100644 (file)
@@ -32,13 +32,6 @@ all1: xscblat1 xdcblat1 xccblat1 xzcblat1
 all2: xscblat2 xdcblat2 xccblat2 xzcblat2
 all3: xscblat3 xdcblat3 xccblat3 xzcblat3
 
-clean:
-       rm -f core *.o *.out x*
-cleanobj:
-       rm -f core *.o a.out
-cleanexe:
-       rm -f x*
-
 #
 # Compile each precision
 #
@@ -102,10 +95,16 @@ run: all
        @echo "--> TESTING CBLAS 3 - DOUBLE PRECISION COMPLEX <--"
        @./xzcblat3 < zin3 > ztest3.out
 
-.SUFFIXES: .o .f .c
+clean: cleanobj cleanexe cleantest
+cleanobj:
+       rm -f *.o
+cleanexe:
+       rm -f x*
+cleantest:
+       rm -f *.out core
 
+.SUFFIXES: .o .f .c
 .c.o:
        $(CC) $(CFLAGS) -I../include -c -o $@ $<
-
 .f.o:
        $(FORTRAN) $(OPTS) -c -o $@ $<
index 73a4437..2917352 100644 (file)
@@ -507,7 +507,7 @@ LAPACK library, you would modify the \texttt{lapacklib} definition to be:
 
 \begin{verbatim}
 lapacklib:
-        ( cd SRC; $(MAKE) single )
+        $(MAKE) -C SRC single
 \end{verbatim}
 
 Likewise, you could specify \texttt{double, complex, or complex16} to
@@ -560,7 +560,7 @@ can be accomplished by the following:
 
 \begin{list}{}{}
 \item \texttt{cd LAPACK}
-\item \texttt{make clean}
+\item \texttt{make cleanobj}
 \end{list}
 
 \section{Further Details of the Installation Process}\label{furtherdetails}
index 901d0b5..150a061 100644 (file)
@@ -2,11 +2,6 @@ include ../make.inc
 
 all: testlsame testslamch testdlamch testsecond testdsecnd testieee testversion
 
-clean:
-       rm -f *.o
-cleanall:
-       rm -f test*
-
 testlsame: lsame.o lsametst.o
        $(LOADER) $(LOADOPTS) -o $@ $^
 
@@ -39,6 +34,14 @@ run: all
        ./testieee
        ./testversion
 
+clean: cleanobj cleanexe cleantest
+cleanobj:
+       rm -f *.o
+cleanexe:
+       rm -f test*
+cleantest:
+       rm -f core
+
 .SUFFIXES: .o .f
 .f.o:
        $(FORTRAN) $(OPTS) -c -o $@ $<
index ffad0a6..64e6ae1 100644 (file)
@@ -35,7 +35,7 @@
 # To generate lapacke library type 'make lapacke'
 # To make both just type 'make'
 #
-# To remove lapacke object files type 'make cleanlib'
+# To remove lapacke object files type 'make cleanobj'
 # To clean all above type 'make clean'
 # To clean everything including lapacke library type
 # 'make cleanall'
@@ -55,11 +55,14 @@ lapacke_example: lapacke
        $(MAKE) -C example
 
 clean: cleanlib
-
-cleanlib:
        $(MAKE) -C src clean
        $(MAKE) -C utils clean
-
-cleanall: clean
-       rm -f $(LAPACKE)
        $(MAKE) -C example clean
+cleanobj:
+       $(MAKE) -C src cleanobj
+       $(MAKE) -C utils cleanobj
+       $(MAKE) -C example cleanobj
+cleanlib:
+       rm -f ../$(LAPACKELIB)
+cleanexe:
+       $(MAKE) -C example cleanexe
index 1212089..f959a2b 100644 (file)
@@ -24,8 +24,11 @@ xexample_DGELS_colmajor: example_DGELS_colmajor.o lapacke_example_aux.o $(LIBRAR
        $(LOADER) $(LOADOPTS) -o $@ $^
        ./$@
 
+clean: cleanobj cleanexe
+cleanobj:
+       rm -f *.o
+cleanexe:
+       rm -f x*
+
 .c.o:
        $(CC) $(CFLAGS) -I. -I../include -c -o $@ $<
-
-clean:
-       rm -f *.o x*
index 8297546..5669e76 100644 (file)
@@ -2409,8 +2409,9 @@ all: ../../$(LAPACKELIB)
        $(ARCH) $(ARCHFLAGS) $@ $(MATGEN)
        $(RANLIB) $@
 
+clean: cleanobj
+cleanobj:
+       rm -f *.o
+
 .c.o:
        $(CC) $(CFLAGS) -I../include -c -o $@ $<
-
-clean:
-       rm -f *.o
index e3c4f5a..1f639c6 100644 (file)
@@ -189,8 +189,9 @@ lib: $(OBJ)
        $(ARCH) $(ARCHFLAGS) ../../$(LAPACKELIB) $^
        $(RANLIB) ../../$(LAPACKELIB)
 
+clean: cleanobj
+cleanobj:
+       rm -f *.o
+
 .c.o:
        $(CC) $(CFLAGS) -I../include -c -o $@ $<
-
-clean:
-       rm -f *.o
index ea514b8..1d7e82c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -11,10 +11,8 @@ all: lapack_install lib blas_testing lapack_testing
 lib: lapacklib tmglib
 #lib: blaslib variants lapacklib tmglib
 
-clean: cleanlib cleantesting cleanblas_testing cleancblas_testing
-
 blaslib:
-       $(MAKE) -C BLAS/SRC
+       $(MAKE) -C BLAS
 
 cblaslib:
        $(MAKE) -C CBLAS
@@ -35,48 +33,48 @@ lapack_install:
        $(MAKE) -C INSTALL run
 
 blas_testing: blaslib
-       $(MAKE) -C BLAS/TESTING run
+       $(MAKE) -C BLAS blas_testing
 
 cblas_testing: cblaslib blaslib
        $(MAKE) -C CBLAS cblas_testing
 
 lapack_testing: tmglib lapacklib blaslib
-       rm -f TESTING/LIN/xlintst*
+       $(MAKE) -C TESTING/LIN cleanexe
        $(MAKE) -C TESTING
        ./lapack_testing.py
 
 variants_testing: tmglib variants lapacklib blaslib
-       rm -f TESTING/LIN/xlintst*
+       $(MAKE) -C TESTING/LIN cleanexe
        $(MAKE) -C TESTING/LIN VARLIB='SRC/VARIANTS/cholrl.a'
        $(MAKE) -C TESTING stest.out && mv TESTING/stest.out TESTING/stest_cholrl.out
        $(MAKE) -C TESTING dtest.out && mv TESTING/dtest.out TESTING/dtest_cholrl.out
        $(MAKE) -C TESTING ctest.out && mv TESTING/ctest.out TESTING/ctest_cholrl.out
        $(MAKE) -C TESTING ztest.out && mv TESTING/ztest.out TESTING/ztest_cholrl.out
-       rm -f TESTING/LIN/xlintst*
+       $(MAKE) -C TESTING/LIN cleanexe
        $(MAKE) -C TESTING/LIN VARLIB='SRC/VARIANTS/choltop.a'
        $(MAKE) -C TESTING stest.out && mv TESTING/stest.out TESTING/stest_choltop.out
        $(MAKE) -C TESTING dtest.out && mv TESTING/dtest.out TESTING/dtest_choltop.out
        $(MAKE) -C TESTING ctest.out && mv TESTING/ctest.out TESTING/ctest_choltop.out
        $(MAKE) -C TESTING ztest.out && mv TESTING/ztest.out TESTING/ztest_choltop.out
-       rm -f TESTING/LIN/xlintst*
+       $(MAKE) -C TESTING/LIN cleanexe
        $(MAKE) -C TESTING/LIN VARLIB='SRC/VARIANTS/lucr.a'
        $(MAKE) -C TESTING stest.out && mv TESTING/stest.out TESTING/stest_lucr.out
        $(MAKE) -C TESTING dtest.out && mv TESTING/dtest.out TESTING/dtest_lucr.out
        $(MAKE) -C TESTING ctest.out && mv TESTING/ctest.out TESTING/ctest_lucr.out
        $(MAKE) -C TESTING ztest.out && mv TESTING/ztest.out TESTING/ztest_lucr.out
-       rm -f TESTING/LIN/xlintst*
+       $(MAKE) -C TESTING/LIN cleanexe
        $(MAKE) -C TESTING/LIN VARLIB='SRC/VARIANTS/lull.a'
        $(MAKE) -C TESTING stest.out && mv TESTING/stest.out TESTING/stest_lull.out
        $(MAKE) -C TESTING dtest.out && mv TESTING/dtest.out TESTING/dtest_lull.out
        $(MAKE) -C TESTING ctest.out && mv TESTING/ctest.out TESTING/ctest_lull.out
        $(MAKE) -C TESTING ztest.out && mv TESTING/ztest.out TESTING/ztest_lull.out
-       rm -f TESTING/LIN/xlintst*
+       $(MAKE) -C TESTING/LIN cleanexe
        $(MAKE) -C TESTING/LIN VARLIB='SRC/VARIANTS/lurec.a'
        $(MAKE) -C TESTING stest.out && mv TESTING/stest.out TESTING/stest_lurec.out
        $(MAKE) -C TESTING dtest.out && mv TESTING/dtest.out TESTING/dtest_lurec.out
        $(MAKE) -C TESTING ctest.out && mv TESTING/ctest.out TESTING/ctest_lurec.out
        $(MAKE) -C TESTING ztest.out && mv TESTING/ztest.out TESTING/ztest_lurec.out
-       rm -f TESTING/LIN/xlintst*
+       $(MAKE) -C TESTING/LIN cleanexe
        $(MAKE) -C TESTING/LIN VARLIB='SRC/VARIANTS/qrll.a'
        $(MAKE) -C TESTING stest.out && mv TESTING/stest.out TESTING/stest_qrll.out
        $(MAKE) -C TESTING dtest.out && mv TESTING/dtest.out TESTING/dtest_qrll.out
@@ -107,26 +105,45 @@ man:
        @echo "Usage: man dgetrf.f"
        @echo "=================="
 
-cleanlib:
+clean:
        $(MAKE) -C INSTALL clean
-       $(MAKE) -C BLAS/SRC clean
+       $(MAKE) -C BLAS clean
        $(MAKE) -C CBLAS clean
        $(MAKE) -C SRC clean
        $(MAKE) -C SRC/VARIANTS clean
+       $(MAKE) -C TESTING clean
        $(MAKE) -C TESTING/MATGEN clean
-       $(MAKE) -C LAPACKE clean
-
-
-cleanblas_testing:
-       $(MAKE) -C BLAS/TESTING clean
-
-cleancblas_testing:
-       $(MAKE) -C CBLAS/testing clean
-
-cleantesting:
        $(MAKE) -C TESTING/LIN clean
        $(MAKE) -C TESTING/EIG clean
-
-cleanall: cleanlib cleanblas_testing cleancblas_testing cleantesting
-       $(MAKE) -C INSTALL cleanall
-       rm -f *.a TESTING/*.out
+       $(MAKE) -C LAPACKE clean
+       rm -f *.a
+cleanobj:
+       $(MAKE) -C INSTALL cleanobj
+       $(MAKE) -C BLAS cleanobj
+       $(MAKE) -C CBLAS cleanobj
+       $(MAKE) -C SRC cleanobj
+       $(MAKE) -C SRC/VARIANTS cleanobj
+       $(MAKE) -C TESTING/MATGEN cleanobj
+       $(MAKE) -C TESTING/LIN cleanobj
+       $(MAKE) -C TESTING/EIG cleanobj
+       $(MAKE) -C LAPACKE cleanobj
+cleanlib:
+       $(MAKE) -C BLAS cleanlib
+       $(MAKE) -C CBLAS cleanlib
+       $(MAKE) -C SRC cleanlib
+       $(MAKE) -C SRC/VARIANTS cleanlib
+       $(MAKE) -C TESTING/MATGEN cleanlib
+       $(MAKE) -C LAPACKE cleanlib
+       rm -f *.a
+cleanexe:
+       $(MAKE) -C INSTALL cleanexe
+       $(MAKE) -C BLAS cleanexe
+       $(MAKE) -C CBLAS cleanexe
+       $(MAKE) -C TESTING/LIN cleanexe
+       $(MAKE) -C TESTING/EIG cleanexe
+       $(MAKE) -C LAPACKE cleanexe
+cleantest:
+       $(MAKE) -C INSTALL cleantest
+       $(MAKE) -C BLAS cleantest
+       $(MAKE) -C CBLAS cleantest
+       $(MAKE) -C TESTING cleantest
index 62c95fd..5d6fe72 100644 (file)
@@ -44,7 +44,7 @@ include ../make.inc
 #  and is created at the next higher directory level.
 #
 #  To remove the object files after the library is created, enter
-#       make clean
+#       make cleanobj
 #  On some systems, you can force the source files to be recompiled by
 #  entering (for example)
 #       make single FRC=FRC
@@ -546,12 +546,14 @@ endif
 FRC:
        @FRC=$(FRC)
 
-clean:
+clean: cleanobj cleanlib
+cleanobj:
        rm -f *.o DEPRECATED/*.o
+cleanlib:
+       rm -f ../$(LAPACKLIB)
 
 .f.o:
        $(FORTRAN) $(OPTS) -c -o $@ $<
-
 .F.o:
        $(FORTRAN) $(OPTS) -c -o $@ $<
 
index c278af8..9f14107 100644 (file)
@@ -56,9 +56,11 @@ qrll.a: $(QRLL)
        $(ARCH) $(ARCHFLAGS) $@ $^
        $(RANLIB) $@
 
+clean: cleanobj cleanlib
+cleanobj:
+       rm -f $(CHOLRL) $(CHOLTOP) $(LUCR) $(LULL) $(LUREC) $(QRLL)
+cleanlib:
+       rm -f *.a
 
 .f.o:
        $(FORTRAN) $(OPTS) -c -o $@ $<
-
-clean:
-       rm -f $(CHOLRL) $(CHOLTOP) $(LUCR) $(LULL) $(LUREC) $(QRLL) *.a
index a614ee0..7804612 100644 (file)
@@ -26,7 +26,7 @@ include ../../make.inc
 #
 #  To remove the object files after the executable files have been
 #  created, enter
-#       make clean
+#       make cleanobj
 #  On some systems, you can force the source files to be recompiled by
 #  entering (for example)
 #       make single FRC=FRC
@@ -147,8 +147,11 @@ $(ZEIGTST): $(FRC)
 FRC:
        @FRC=$(FRC)
 
-clean:
-       rm -f *.o xeigtst*
+clean: cleanobj cleanexe
+cleanobj:
+       rm -f *.o
+cleanexe:
+       rm -f xeigtst*
 
 schkee.o: schkee.f
        $(FORTRAN) $(DRVOPTS) -c -o $@ $<
index 4dc891c..f554bea 100644 (file)
@@ -26,7 +26,7 @@ include ../../make.inc
 #
 #  To remove the object files after the executable files have been
 #  created, enter
-#       make clean
+#       make cleanobj
 #  On some systems, you can force the source files to be recompiled by
 #  entering (for example)
 #       make single FRC=FRC
@@ -298,8 +298,11 @@ $(ZLINTST): $(FRC)
 FRC:
        @FRC=$(FRC)
 
-clean:
-       rm -f *.o xlintst*
+clean: cleanobj cleanexe
+cleanobj:
+       rm -f *.o
+cleanexe:
+       rm -f xlintst*
 
 schkaa.o: schkaa.f
        $(FORTRAN) $(DRVOPTS) -c -o $@ $<
index c364bb6..06f09de 100644 (file)
@@ -25,7 +25,7 @@ include ../../make.inc
 #  and is created at the LAPACK directory level.
 #
 #  To remove the object files after the library is created, enter
-#       make clean
+#       make cleanobj
 #  On some systems, you can force the source files to be recompiled by
 #  entering (for example)
 #       make single FRC=FRC
@@ -87,8 +87,11 @@ $(ZMATGEN): $(FRC)
 FRC:
        @FRC=$(FRC)
 
-clean:
+clean: cleanobj cleanlib
+cleanobj:
        rm -f *.o
+cleanlib:
+       rm -f ../../$(TMGLIB)
 
 .f.o:
        $(FORTRAN) $(OPTS) -c -o $@ $<
index a447b56..8b883c0 100644 (file)
@@ -23,7 +23,7 @@
 #       xeigtsts, xeigtstd, xeigtstc, and xeigtstz for EIG
 #
 #  To remove the output files after the tests have been run, enter
-#       make clean
+#       make cleantest
 #
 #  To re-run specific tests after a make, enter (for example):
 #       'rm ssvd.out; make'  or:
@@ -582,7 +582,8 @@ EIG/xeigtstd: $(FRCEIG) $(FRC)
 EIG/xeigtstz: $(FRCEIG) $(FRC)
        $(MAKE) -C EIG xeigtstz
 
-clean:
+clean: cleantest
+cleantest:
        rm -f *.out core
 
 FRCLIN: