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