[pycalcal] push by enrico.spinielli - cleaned Makefile on 2010-03-07 14:52 GMT

2 views
Skip to first unread message

pyca...@googlecode.com

unread,
Mar 7, 2010, 9:53:24 AM3/7/10
to pyca...@googlegroups.com
Revision: 01bc7d3471
Author: Enrico Spinielli <enrico.s...@gmail.com>
Date: Sun Mar 7 06:52:32 2010
Log: cleaned Makefile
http://code.google.com/p/pycalcal/source/detail?r=01bc7d3471

Modified:
/pycalcal.nw

=======================================
--- /pycalcal.nw Sun Feb 21 07:11:47 2010
+++ /pycalcal.nw Sun Mar 7 06:52:32 2010
@@ -1,4 +1,3 @@
-%-*- mode: Noweb; noweb-code-mode: python-mode; tab-width: 4 -*-
% draft is convinient to show over/under boxes,
% BUT it does NOT inlude graphics nor create links
%\documentclass[a4paper,draft,pdftex]{report}
@@ -8395,6 +8394,7 @@
<<Makefile: files declarations>>=
NW_MAIN=pycalcal.nw
NW_SRC=
+TOOLS=prefix excerpt premarkup blankexcerpt blankpremarkup sconstruct
PYTHON_SITE_PACKAGES=/Library/Python/2.6/site-packages
UNIT_TEST_FILES=basicCodeUnitTest.py \
egyptianAndArmenianCalendarsUnitTest.py \
@@ -8497,29 +8497,49 @@
.PRECIOUS: %.aux %.bbl

.PHONY : all
-all: figures pycalcal.pdf $(NW_MAIN:.nw=.py) pycalcaltests.py
-
+all: tools code tests doc
+
+.PHONY : tools
+tools:
+ if [[ ! -x "prefix" ]]; \
+ then \
+ $(MAKE) $(TOOLS); \
+ fi;
+
+
+.PHONY : code
+code: pycalcal.py pycalcaltests.py
+
+.PHONY : tests
+tests:
+ $(MAKE) testdata
+ $(MAKE) $(UNIT_TEST_FILES)
+
+
+.PHONY : doc
+doc:
+ -$(MAKE) figures
+ -$(MAKE) index
+ $(MAKE) pycalcal.pdf
+
+
+###############################
.PHONY : index
+index: pycalcal.defs
+
pycalcal.defs: $(NW_MAIN) premarkup
$(NODEFS) - $(CPIF) $*.defs

#all.defs: pycalcal.defs
# cat pycalcal.defs ${CPIF} all.defs
# sort -u $(NW_ALL:.nw=.defs) $(CPIF) all.defs
-
-# TeX (use predefined rule)
-pycalcal.tex: premarkup
-
-# do not depend on target figures (asymptote ones take quale long time)
-pycalcal.pdf: $(NW_MAIN:.nw=.tex)
-
-# Python files (for pycalcal.py use predefined rule +
-# extra dependency on premarkup)
-pycalcal.py: premarkup
-
-# figures
+###############################
+
+
+###############################
.PHONY : figures
figures: fig_ra-dec.pdf fig_ecliptic.pdf fig_alt-az.pdf
+###############################


<<Makefile: distro>>
@@ -8540,6 +8560,7 @@

@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
<<Makefile: distro>>=
+###############################
DISTRO_FILES=$(NW_MAIN) $(NW_MAIN:.nw=.py) $(NW_MAIN:.nw=.pdf) \
README INSTALL STATUS COPYRIGHT_DERSHOWITZ_REINGOLD \
makemake.sh \
@@ -8555,20 +8576,23 @@
.PHONY : distro
distro: all
tar -czf pycalcal_$$(date +"%Y%m%d%H%M").tar.gz $(DISTRO_FILES)
+###############################
+

@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Unit test and target
<<Makefile: unit tests and targets>>=
-pycalcaltests.py: pycalcal.py
+###############################
+pycalcaltests.py:
$(NOTANGLE) -filter btdefn -R$*.py - $(CPIF) $*.py

-.PHONY : test
-test: pycalcaltests.py $(NW_MAIN:.nw=.py) testdata ut
+.PHONY : check
+check: code tests
python pycalcaltests.py 2>&1 | tee testResult.txt

-.PHONY : singletest
-singletest:
- for t in $$(cat Makefile | grep 'UnitTest.py:' | \
+.PHONY : check1by1
+check1by1: code tests
+ for t in $$(cat Makefile | grep -e '^[^ ]*UnitTest.py:' | \
cut -f1 -d':' | grep -v appendix); \
do \
$(MAKE) $$t; \
@@ -8576,8 +8600,11 @@

# create all unit test files
.PHONY : ut
-ut: pycalcaltests.py
- $(MAKE) $(UNIT_TEST_FILES)
+ut:
+ $(MAKE) $$(cat pycalcal.nw | grep -e '^@<<.*UnitTest.py>>=' | \
+ grep -v appendix | sed -e 's/@<<//g' -e 's/>>=//g')
+# $(MAKE) $(UNIT_TEST_FILES)
+

<<Makefile: basics unit tests and target>>
<<Makefile: egyptian and armenian unit tests and target>>
@@ -8605,6 +8632,7 @@
trasformLatexDates2Cvs:
notangle -RtrasformLatexDates2Cvs $(NW_MAIN) $(CPIF)
trasformLatexDates2Cvs
-chmod ug+x trasformLatexDates2Cvs
+###############################


@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -8820,7 +8848,7 @@

@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
<<Makefile: clean>>=
-.PHONY : clean clobber superclean
+.PHONY : clean clobber xclean
clobber: clean

clean:
@@ -8832,9 +8860,10 @@
pycalcal.idx *UnitTest.py *UnitTest_result.txt \
html/ calendrica/ pycalcal*.gz figure.mpx \
$$(ls | grep "figure.[0-9][0-9]*") figure-*.pdf fig_*.pdf \
- *.mps *mpx fig_*.0
-
-superclean: clean
+ *.mps *mpx fig_*.0 SConstruct
+
+# ask to remove all files not recognized by hg
+xclean: clean
for f in $$(hg status | grep -e '^?' | sed -e 's/^? //g'); \
do \
rm -i $$f; \

Reply all
Reply to author
Forward
0 new messages