Fix #473
[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 q:
22 @echo -e "Code statistics\n"
23 @sloccount $(filter-out wiki/ spool/, $(wildcard */)) 2> /dev/null | egrep '^[a-z]*:'
24
25 %: %.in Makefile ChangeLog
26 sed -e 's,@VERSION@,$(VERSION),g' $< > $@
27
28 ################################################################################
29 # targets
30
31 ##
32 ## core
33 ##
34
35 core: spool/templates_c include/globals.inc.php
36
37 spool/templates_c spool/uploads:
38 mkdir -p $@
39 chmod o+w $@
40
41
42 ##
43 ## wiki
44 ##
45
46 WIKI_NEEDS = \
47 wiki/local/farmconfig.php \
48 wiki/pub/skins/empty \
49 wiki/cookbook/e-protect.php \
50 spool/wiki.d \
51 htdocs/uploads \
52 htdocs/wiki \
53
54 wiki: get-wiki build-wiki
55
56 build-wiki: $(WIKI_NEEDS) | get-wiki
57
58 htdocs/uploads: spool/uploads
59 cd htdocs && ln -sf ../spool/uploads
60
61 htdocs/wiki:
62 cd htdocs && ln -sf ../wiki/pub wiki
63
64
65 spool/wiki.d:
66 mkdir -p $@
67 chmod o+w $@
68 cd $@ && ln -sf ../../include/wiki/wiki.d/* .
69
70
71 wiki/cookbook/e-protect.php:
72 cd wiki/cookbook && ln -sf ../../include/wiki/e-protect.php
73
74 wiki/local/farmconfig.php:
75 cd wiki/local/ && ln -sf ../../include/wiki/farmconfig.php
76
77 wiki/pub/skins/empty:
78 cd wiki/pub/skins/ && ln -sf ../../../include/wiki/empty
79
80
81 get-wiki:
82 @if ! test -d wiki; then \
83 wget http://www.pmwiki.org/pub/pmwiki/pmwiki-latest.tgz; \
84 tar -xzvf pmwiki-latest.tgz; \
85 rm pmwiki-latest.tgz; \
86 mv pmwiki-* wiki; \
87 fi
88
89 ##
90 ## banana
91 ##
92
93 banana: htdocs/images/banana htdocs/css/banana.css
94 htdocs/images/banana:
95 cd $(@D) && ln -sf /usr/share/banana/img $(@F)
96
97 htdocs/css/banana.css:
98 cd $(@D) && ln -sf /usr/share/banana/css/style.css $(@F)
99
100 ################################################################################
101
102 .PHONY: build dist clean wiki build-wiki banana
103