]> git.imager.perl.org - bse.git/blob - Makefile
0.14_36 commit
[bse.git] / Makefile
1 VERSION=0.14_36
2 DISTNAME=bse-$(VERSION)
3 DISTBUILD=$(DISTNAME)
4 DISTTAR=../$(DISTNAME).tar
5 DISTTGZ=$(DISTTAR).gz
6 WEBBASE=/home/httpd/html/bse
7
8 help:
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)
11         @echo make clean - delete generated files
12         @echo make distdir - build distribution directory
13         @echo make docs - build documentation
14
15 # this target needs to be modified so that the output directory includes
16 # the release number
17 dist: cleantree $(DISTTGZ)
18         cp $(DISTTGZ) $(WEBBASE)/dists/
19         cp site/docs/bse.html $(WEBBASE)/relnotes/bse-$(VERSION).html
20         cp site/docs/*.html $(WEBBASE)/docs
21         cvs tag r`echo $(VERSION) | tr . _`
22
23 # make sure everything is committed
24 cleantree:
25         if cvs status 2>/dev/null | grep -q '^\?\|Locally Modified' ; \
26           then echo '***' The tree has modified or unadded files ; \
27           exit 1 ; \
28         fi
29
30 archive: $(DISTTGZ)
31
32 $(DISTTGZ): distdir
33         if [ -e $(DISTTGZ) ] ; \
34           then echo $(DISTTGZ) already exists ; \
35                exit 1 ; \
36         fi
37         tar cf $(DISTTAR) $(DISTBUILD)
38         -perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
39         gzip $(DISTTAR)
40
41 #       tar czf $(DISTFILE) -C .. bse --exclude '*~' --exclude '*,v' --exclude 'pod2html-*cache'
42
43 distdir: docs dbinfo version
44         -perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
45         perl -MExtUtils::Manifest=manicopy,maniread -e "manicopy(maniread(), '$(DISTBUILD)')"
46         mkdir $(DISTBUILD)/site/htdocs/shop
47         find $(DISTBUILD) -type f | xargs chmod u+w
48
49 clean:
50         -perl -MExtUtils::Command -e rm_f site/htdocs/index.html site/htdocs/shop/*.html site/htdocs/a/*.html
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
57         -perl -MExtUtils::Command -e rm_f site/htdocs/images/*.jpg
58         -perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
59
60 docs: INSTALL.txt INSTALL.html otherdocs
61
62 INSTALL.txt: INSTALL.pod
63         pod2text <INSTALL.pod >INSTALL.txt
64
65 INSTALL.html: INSTALL.pod
66         pod2html --infile=INSTALL.pod --outfile=INSTALL.html
67         -rm pod2html-dircache pod2html-itemcache
68
69 otherdocs:
70         cd site/docs ; make all
71
72 dbinfo: site/util/mysql.str
73
74 site/util/mysql.str: schema/bse.sql
75         perl schema/mysql_build.pl >site/util/mysql.str
76
77 version: site/cgi-bin/modules/BSE/Version.pm
78
79 site/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
89 # this is very rough
90 testinst: distdir
91         perl localinst.perl $(DISTBUILD)
92         perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
93
94 testfiles: distdir
95         perl localinst.perl $(DISTBUILD) leavedb
96         perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
97
98 test: testinst
99         perl -MTest::Harness=runtests -Isite/cgi-bin/modules -It -e 'runtests glob q!t/*.t!'
100
101 manicheck:
102         perl -MExtUtils::Manifest=manicheck -e 'manicheck()'
103
104 filecheck:
105         perl -MExtUtils::Manifest=filecheck -e 'filecheck()'