tools: clean Makefiles
authorJean Privat <jean@pryen.org>
Fri, 17 Feb 2012 22:08:02 +0000 (17:08 -0500)
committerJean Privat <jean@pryen.org>
Fri, 17 Feb 2012 22:08:02 +0000 (17:08 -0500)
* create a Makefile in src
* rule 'docs' makes all the doc (including pdf)
* refresh 'clean' and 'distclean'

Signed-off-by: Jean Privat <jean@pryen.org>

Makefile
c_src/Makefile
doc/Makefile
src/Makefile [new file with mode: 0644]
src/parser/Makefile
tests/Makefile

index 9bbed89..ae0c1d2 100644 (file)
--- a/Makefile
+++ b/Makefile
 
 NITCOPT=
 
-all: bin/nitc bin/nitdoc doc/stdlib/index.html bin/nits
+all: tools doc/stdlib/index.html
 
 docs: doc/stdlib/index.html doc/nitc/index.html
+       cd doc; make
 
+tools:
+       cd src; make
 
-bin/nitc: c_src/nitc src/parser/parser.nit
-       @echo '***************************************************************'
-       @echo '* Compile nitc from NIT source files                          *'
-       @echo '***************************************************************'
-       src/git-gen-version.sh
-       cd src; ../c_src/nitc ${NITCOPT} --clibdir ../c_src/clib -o ../bin/nitc -O -v nitc.nit
-
-bin/nitdoc: bin/nitc
-       @echo '***************************************************************'
-       @echo '* Compile nitdoc from NIT source files                        *'
-       @echo '***************************************************************'
-       src/git-gen-version.sh
-       cd src; ../bin/nitc ${NITCOPT} -o ../bin/nitdoc -O -v nitdoc.nit
-
-bin/nits: bin/nitc
-       @echo '***************************************************************'
-       @echo '* Compile nits from NIT source files                        *'
-       @echo '***************************************************************'
-       bin/nitc ${NITCOPT} -o bin/nits -O -v src/nits.nit
-
-doc/stdlib/index.html: bin/nitdoc
+doc/stdlib/index.html: tools
        @echo '***************************************************************'
        @echo '* Generate doc for NIT standard library                       *'
        @echo '***************************************************************'
        bin/nitdoc lib/*.nit -d doc/stdlib --public --overview-text '<p>Documentation for the standard library of Nit</p>' --footer-text 'Nit standard library. Version '`git describe -- lib`'.'
 
-doc/nitc/index.html: bin/nitdoc
+doc/nitc/index.html: tools
        bin/nitdoc src/nitc.nit src/nitdoc.nit -d doc/nitc --overview-text '<p>Documentation for the nit compiler</p>' --footer-text 'Nit compiler. Version '`git describe`'.'
 
-c_src/nitc: c_src/*.c c_src/*.h c_src/nitc._build.sh c_src/Makefile
-       @echo '***************************************************************'
-       @echo '* Compile nitc from C source files                            *'
-       @echo '***************************************************************'
-       cd c_src; make
-
-src/parser/parser.nit:
-       @echo '***************************************************************'
-       @echo '* Generate nit parser                                         *'
-       @echo '***************************************************************'
-       cd src/parser; make
-
 clean:
        rm -rf -- .nit_compile 2> /dev/null || true
-       cd c_src; make clean 
-       cd src/parser; make clean 
-       cd tests; make clean 
-
-dist-clean: clean
-       cd c_src; make dist-clean
-       cd src/parser; make dist-clean
-       rm -rf -- bin/nitc bin/nitdoc doc/stdlib
-
+       cd c_src; make clean
+       cd src; make clean
+       cd doc; make clean
+       cd tests; make clean
+
+distclean: clean
+       rm -rf -- bin/nitc bin/nitdoc bin/nits doc/stdlib doc/nitc/ 2> /dev/null || true
+       cd c_src; make distclean
+       cd src/parser; make distclean
+       cd doc; make distclean
+       cd tests; make distclean
index 694bb41..a9fa761 100644 (file)
@@ -18,7 +18,7 @@ all:
        sh nitc._build.sh -vv -O -o nitc
 
 clean:
-       rm -f -- *._sav[oi].* *._sav.* || true
+       rm -f -- *._sav[oi].* *._sav.* *.o 2> /dev/null || true
 
-dist-clean: clean
-       rm -f -- nitc || true
+distclean: clean
+       rm -f -- nitc 2> /dev/null || true
index d89ffd0..c37eaa8 100644 (file)
@@ -3,3 +3,10 @@ all:
        rubber --pdf --inplace nitreference/nitreference.tex
        rubber --pdf --inplace developpez/nit.tex
 
+clean:
+       rm nit_version.sty 2> /dev/null || true
+       rubber --clean --inplace nitreference/nitreference.tex
+       rubber --clean --inplace developpez/nit.tex
+
+distclean: clean
+       rm nitreference/nitreference.pdf developpez/nit.pdf 2> /dev/null || true
diff --git a/src/Makefile b/src/Makefile
new file mode 100644 (file)
index 0000000..8440ee7
--- /dev/null
@@ -0,0 +1,59 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Copyright 2008 Jean Privat <jean@pryen.org>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+NITCOPT=
+
+all: ../bin/nitc ../bin/nitdoc ../bin/nits
+
+../bin/nitc: ../c_src/nitc parser/parser.nit
+       @echo '***************************************************************'
+       @echo '* Compile nitc from NIT source files                          *'
+       @echo '***************************************************************'
+       ./git-gen-version.sh
+       ../c_src/nitc ${NITCOPT} --clibdir ../c_src/clib -o ../bin/nitc -O -v nitc.nit
+
+../bin/nitdoc: ../bin/nitc
+       @echo '***************************************************************'
+       @echo '* Compile nitdoc from NIT source files                        *'
+       @echo '***************************************************************'
+       ./git-gen-version.sh
+       ../bin/nitc ${NITCOPT} -o ../bin/nitdoc -O -v nitdoc.nit
+
+../bin/nits: ../bin/nitc
+       @echo '***************************************************************'
+       @echo '* Compile nits from NIT source files                        *'
+       @echo '***************************************************************'
+       ./git-gen-version.sh
+       ../bin/nitc ${NITCOPT} -o ../bin/nits -O -v nits.nit
+
+../c_src/nitc: ../c_src/*.c ../c_src/*.h ../c_src/nitc._build.sh ../c_src/Makefile
+       @echo '***************************************************************'
+       @echo '* Compile nitc from C source files                            *'
+       @echo '***************************************************************'
+       cd ../c_src; make
+
+parser/parser.nit:
+       @echo '***************************************************************'
+       @echo '* Generate nit parser                                         *'
+       @echo '***************************************************************'
+       cd parser; make
+
+clean:
+       rm -rf -- .nit_compile* nit_version.nit 2> /dev/null || true
+       cd parser; make clean
+
+distclean: clean
+       cd parser; make distclean
index 5115297..41dfd8b 100644 (file)
@@ -32,5 +32,9 @@ parser.nit: .nit.sablecc3 xss/*.xss
 clean:
        rm -f -- .nit.sablecc3 .nit.sablecc3.dump .parser-nofact.nit || true
 
-dist-clean: clean
+distclean: clean
+
+maintainer-clean: clean
+       @echo "This command is intended for maintainers to use;"
+       @echo "it deletes files that may require special tools to rebuild."
        rm -f -- parser.nit parser_abs.nit parser_prod.nit lexer.nit || true
index b75c520..673a8cc 100644 (file)
@@ -21,4 +21,6 @@ store:
        ./store_save.sh *.nit
 
 clean:
-       @rm -r -f -- *.bin *.res *.write *.err *.log alt || true
+       rm -r -f -- *.bin *.res *.write *.err *.log alt .nit_compile errlist 2> /dev/null || true
+
+distclean: clean