rework makefile
[platal.git] / Makefile
1 # $Id: Makefile,v 1.5 2004/11/25 20:18:39 x99laine Exp $
2 ################################################################################
3 # definitions
4
5 VERSION := $(shell grep VERSION ChangeLog | head -1 | sed -e "s/VERSION //;s/\t.*//;s/ .*//")
6
7 PKG_NAME = platal
8 PKG_DIST = $(PKG_NAME)-$(VERSION)
9 PKG_FILES = AUTHORS ChangeLog COPYING README Makefile
10 PKG_DIRS = configs htdocs include install.d plugins po scripts templates upgrade
11
12 VCS_FILTER = ! -name .arch-ids ! -name CVS
13
14 ################################################################################
15 # global targets
16
17 all: build
18
19 build: core banana wiki
20
21 %: %.in Makefile
22 sed -e 's,@VERSION@,$(VERSION),g' $< > $@
23
24 ################################################################################
25 # targets
26
27 ##
28 ## core
29 ##
30
31 core: spool/templates_c include/platal/globals.inc.php
32
33 spool/templates_c spool/uploads:
34 mkdir -p $@
35 chmod o+w $@
36
37
38 ##
39 ## wiki
40 ##
41
42 WIKI_NEEDS = \
43 wiki/local/farmconfig.php \
44 wiki/pub/skins/empty \
45 wiki/cookbook/e-protect.php \
46 spool/wiki.d \
47 htdocs/uploads \
48 htdocs/wiki \
49
50 wiki: get-wiki build-wiki
51
52 build-wiki: $(WIKI_NEEDS) | get-wiki
53
54 htdocs/uploads: spool/uploads
55 cd htdocs && ln -sf ../spool/uploads
56
57 htdocs/wiki:
58 cd htdocs && ln -sf ../wiki/pub wiki
59
60
61 spool/wiki.d:
62 mkdir -p $@
63 chmod o+w $@
64 cd $@ && ln -sf ../../install.d/wiki/wiki.d/* .
65
66
67 wiki/cookbook/e-protect.php:
68 cd wiki/cookbook && ln -sf ../../install.d/wiki/e-protect.php
69
70 wiki/local/farmconfig.php:
71 cd wiki/local/ && ln -sf ../../plugins/pmwiki.config.php farmconfig.php
72
73 wiki/pub/skins/empty:
74 cd wiki/pub/skins/ && ln -sf ../../../install.d/wiki/empty
75
76
77 get-wiki:
78 @if ! test -d wiki; then \
79 wget http://www.pmwiki.org/pub/pmwiki/pmwiki-latest.tgz; \
80 tar -xzvf pmwiki-latest.tgz; \
81 rm pmwiki-latest.tgz; \
82 mv pmwiki-* wiki; \
83 fi
84
85 ##
86 ## banana
87 ##
88
89 banana: htdocs/images/banana htdocs/css/banana.css
90 htdocs/images/banana:
91 cd $(@D) && ln -sf /usr/share/banana/img $(@F)
92
93 htdocs/css/banana.css:
94 cd $(@D) && ln -sf /usr/share/banana/css/style.css $(@F)
95
96 ################################################################################
97
98 .PHONY: build dist clean wiki build-wiki banana
99