fiddling with cleantree
[bse.git] / Makefile
CommitLineData
957a90ca 1VERSION=0.11_14
41b9d8ec
TC
2DISTNAME=bse-$(VERSION)
3DISTBUILD=$(DISTNAME)
4DISTTAR=../$(DISTNAME).tar
5DISTTGZ=$(DISTTAR).gz
957a90ca 6WEBBASE=/home/httpd/html/bse
41b9d8ec
TC
7
8help:
9 @echo make dist - build the tar.gz file
10 @echo make clean - delete generated files
6e73144d
TC
11 @echo make distdir - build distribution directory
12 @echo make docs - build documentation
41b9d8ec
TC
13
14# this target needs to be modified so that the output directory includes
15# the release number
957a90ca
TC
16dist: cleantree $(DISTTGZ)
17 echo cp $(DISTTGZ) $(WEBBASE)/dists/
18 echo cp site/docs/bse.html $(WEBBASE)/relnotes/bse-$(VERSION).html
19 echo cp site/docs/*.html $(WEBBASE)/docs
20
21# make sure everything is committed
22cleantree:
84cb877f 23 if cvs status 2>/dev/null | grep -q '^\?\|Locally Modified' ; \
f6a52649 24 then echo '***' The tree has modified or unadded files ; \
957a90ca
TC
25 exit 1 ; \
26 fi
41b9d8ec
TC
27
28$(DISTTGZ): distdir
29 if [ -e $(DISTTGZ) ] ; \
30 then echo $(DISTTGZ) already exists ; \
31 exit 1 ; \
32 fi
33 tar cf $(DISTTAR) $(DISTBUILD)
09a131dd 34 -perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
41b9d8ec
TC
35 gzip $(DISTTAR)
36
37# tar czf $(DISTFILE) -C .. bse --exclude '*~' --exclude '*,v' --exclude 'pod2html-*cache'
38
b19047a6 39distdir: docs dbinfo
09a131dd 40 -perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
41b9d8ec 41 perl -MExtUtils::Manifest=manicopy,maniread -e "manicopy(maniread(), '$(DISTBUILD)')"
6e73144d
TC
42 mkdir $(DISTBUILD)/site/htdocs/shop
43 find $(DISTBUILD) -type f | xargs chmod u+w
41b9d8ec
TC
44
45clean:
09a131dd 46 -perl -MExtUtils::Command -e rm_f site/htdocs/index.html site/htdocs/shop/*.html site/htdocs/a/*.html
41b9d8ec
TC
47 -cd site/htdocs/images ; \
48 for i in *.gif ; do \
49 if [ $$i != trans_pixel.gif ] ; then \
50 rm $$i ; \
51 fi ; \
52 done
09a131dd
TC
53 -perl -MExtUtils::Command -e rm_f site/htdocs/images/*.jpg
54 -perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
41b9d8ec 55
6e73144d 56docs: INSTALL.txt INSTALL.html otherdocs
41b9d8ec 57
6e73144d
TC
58INSTALL.txt: INSTALL.pod
59 pod2text <INSTALL.pod >INSTALL.txt
41b9d8ec
TC
60
61INSTALL.html: INSTALL.pod
62 pod2html --infile=INSTALL.pod --outfile=INSTALL.html
63 -rm pod2html-dircache pod2html-itemcache
64
65otherdocs:
66 cd site/docs ; make all
6e73144d 67
b19047a6
TC
68dbinfo: site/util/mysql.str
69
70site/util/mysql.str: schema/bse.sql
71 perl schema/mysql_build.pl >site/util/mysql.str
72
6e73144d
TC
73# this is very rough
74testinst: distdir
75 perl localinst.perl $(DISTBUILD)
09a131dd 76 perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
34bc5961
TC
77
78testfiles: distdir
79 perl localinst.perl $(DISTBUILD) leavedb
09a131dd
TC
80 perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
81
41fd1a57
TC
82test: testinst
83 perl -MTest::Harness=runtests -It -e 'runtests glob q!t/*.t!'