gthumbimage now accepts [ ... ] arguments
[bse.git] / Makefile
CommitLineData
cb7fd78d 1VERSION=0.19
41b9d8ec
TC
2DISTNAME=bse-$(VERSION)
3DISTBUILD=$(DISTNAME)
4DISTTAR=../$(DISTNAME).tar
5DISTTGZ=$(DISTTAR).gz
957a90ca 6WEBBASE=/home/httpd/html/bse
41b9d8ec 7
75b07edf
TC
8MODULES=$(shell grep cgi-bin/.*\.pm MANIFEST | sed -e '/^\#/d' -e 's/[ \t].*//' )
9
41b9d8ec 10help:
8b0b2f34 11 @echo make dist - build the tar.gz file and copy to distribution directory
12bcb7ac 12 @echo make 'archive - build the tar.gz (in the parent directory)'
41b9d8ec 13 @echo make clean - delete generated files
6e73144d
TC
14 @echo make distdir - build distribution directory
15 @echo make docs - build documentation
a47e539f 16 @echo make testup - upgrade an installation
41b9d8ec
TC
17
18# this target needs to be modified so that the output directory includes
19# the release number
957a90ca 20dist: cleantree $(DISTTGZ)
227b99dc
TC
21 cp $(DISTTGZ) $(WEBBASE)/dists/
22 cp site/docs/bse.html $(WEBBASE)/relnotes/bse-$(VERSION).html
23 cp site/docs/*.html $(WEBBASE)/docs
5af99440 24 svn cp . http://svn.develop-help.com/devsvn/bse/tags/bse-$(VERSION)
957a90ca
TC
25
26# make sure everything is committed
27cleantree:
85802bd5
TC
28 if grep -q 'perl.*-d:ptkdb' site/cgi-bin/*.pl site/cgi-bin/admin/*.pl ; \
29 then echo '***' The debugger is still enabled ; \
30 exit 1; \
31 fi
5af99440 32 test -z "`svn status`" || ( echo "Uncommitted files in the tree"; exit 1 )
41b9d8ec 33
8b0b2f34
TC
34archive: $(DISTTGZ)
35
41b9d8ec
TC
36$(DISTTGZ): distdir
37 if [ -e $(DISTTGZ) ] ; \
38 then echo $(DISTTGZ) already exists ; \
39 exit 1 ; \
40 fi
41 tar cf $(DISTTAR) $(DISTBUILD)
09a131dd 42 -perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
41b9d8ec
TC
43 gzip $(DISTTAR)
44
45# tar czf $(DISTFILE) -C .. bse --exclude '*~' --exclude '*,v' --exclude 'pod2html-*cache'
46
e9c9a2be
TC
47# recent ExtUtils::Manifest don't copy the executable bit, fix that here
48
75b07edf 49distdir: docs dbinfo version modversion
09a131dd 50 -perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
41b9d8ec 51 perl -MExtUtils::Manifest=manicopy,maniread -e "manicopy(maniread(), '$(DISTBUILD)')"
6e73144d
TC
52 mkdir $(DISTBUILD)/site/htdocs/shop
53 find $(DISTBUILD) -type f | xargs chmod u+w
e9c9a2be 54 for i in `cat MANIFEST` ; do if [ -x $$i ] ; then chmod a+x $(DISTBUILD)/$$i ; fi ; done
41b9d8ec
TC
55
56clean:
09a131dd 57 -perl -MExtUtils::Command -e rm_f site/htdocs/index.html site/htdocs/shop/*.html site/htdocs/a/*.html
41b9d8ec
TC
58 -cd site/htdocs/images ; \
59 for i in *.gif ; do \
60 if [ $$i != trans_pixel.gif ] ; then \
61 rm $$i ; \
62 fi ; \
63 done
09a131dd
TC
64 -perl -MExtUtils::Command -e rm_f site/htdocs/images/*.jpg
65 -perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
41b9d8ec 66
6e73144d 67docs: INSTALL.txt INSTALL.html otherdocs
41b9d8ec 68
6e73144d
TC
69INSTALL.txt: INSTALL.pod
70 pod2text <INSTALL.pod >INSTALL.txt
41b9d8ec
TC
71
72INSTALL.html: INSTALL.pod
73 pod2html --infile=INSTALL.pod --outfile=INSTALL.html
74 -rm pod2html-dircache pod2html-itemcache
75
76otherdocs:
77 cd site/docs ; make all
6e73144d 78
b19047a6
TC
79dbinfo: site/util/mysql.str
80
81site/util/mysql.str: schema/bse.sql
82 perl schema/mysql_build.pl >site/util/mysql.str
83
d2730773
TC
84version: site/cgi-bin/modules/BSE/Version.pm
85
86site/cgi-bin/modules/BSE/Version.pm: Makefile
87 echo 'package BSE::Version;' >site/cgi-bin/modules/BSE/Version.pm
88 echo 'use strict;' >>site/cgi-bin/modules/BSE/Version.pm
89 echo >>site/cgi-bin/modules/BSE/Version.pm
75b07edf 90 echo 'our $$VERSION = "$(VERSION)";' >>site/cgi-bin/modules/BSE/Version.pm
d2730773
TC
91 echo >>site/cgi-bin/modules/BSE/Version.pm
92 echo 'sub version { $$VERSION }' >>site/cgi-bin/modules/BSE/Version.pm
93 echo >>site/cgi-bin/modules/BSE/Version.pm
94 echo '1;' >>site/cgi-bin/modules/BSE/Version.pm
95
7057fbc0
TC
96svnversion:
97 perl site/util/bse_mksvnversion.pl $(VERSION) site/cgi-bin/modules/BSE/Version.pm
98
75b07edf
TC
99modversion: site/cgi-bin/modules/BSE/Modules.pm
100
101site/cgi-bin/modules/BSE/Modules.pm: $(MODULES) site/util/make_versions.pl
102 perl site/util/make_versions.pl site/cgi-bin/modules/BSE/Modules.pm
103
6e73144d
TC
104# this is very rough
105testinst: distdir
106 perl localinst.perl $(DISTBUILD)
09a131dd 107 perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
2076966c 108 cd `perl -lne 'do { print $$1; exit; } if /^base_dir\s*=\s*(.*)/' test.cfg`/util ; perl loaddata.pl ../data/db
34bc5961 109
cb7fd78d 110testup: checkver distdir
34bc5961 111 perl localinst.perl $(DISTBUILD) leavedb
09a131dd 112 perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
a47e539f 113 cd `perl -lne 'do { print $$1; exit; } if /^base_dir\s*=\s*(.*)/' test.cfg`/util ; perl upgrade_mysql.pl -b ; perl loaddata.pl ../data/db
09a131dd 114
cb7fd78d 115checkver:
75b07edf 116 if [ -d .svn ] ; then perl site/util/check_versions.pl ; fi
cb7fd78d 117
87b53bfa
TC
118TEST_FILES=t/*.t
119
120test: testup
121 perl -MTest::Harness=runtests -Isite/cgi-bin/modules -It -e 'runtests @ARGV' $(TEST_FILES)
35c0719f
TC
122
123manicheck:
124 perl -MExtUtils::Manifest=manicheck -e 'manicheck()'
125
126filecheck:
127 perl -MExtUtils::Manifest=filecheck -e 'filecheck()'