-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (42 loc) · 1.28 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# definitions
VERSION=$(shell grep VERSION Changelog | head -1 | sed -e "s/VERSION //;s/\t.*//")
PKG_DIST = banana-$(VERSION)
PKG_FILES = AUTHORS Changelog COPYING README Makefile TODO
PKG_DIRS = banana po css examples img javascript
VCS_FILTER = ! -name .svn
# global targets
all: build
# build for development (prepare spool
devel: spool spool/templates_c
q:
@echo -e "Code statistics\n"
@sloccount $(filter-out spool/ po/ debian/, $(wildcard */)) 2> /dev/null | egrep '^[a-z]*:'
build: pkg-build
dist: clean pkg-dist
clean:
rm -rf locale banana/banana.inc.php
make -C po clean
make -C mbox-helper clean
%: %.in Makefile
-rm $@
sed -e 's,@VERSION@,$(VERSION) The Bearded Release,g' $< > $@
spool spool/templates_c:
mkdir -p $@
chmod o+w $@
# banana package targets
pkg-build: banana/banana.inc.php
make -C po
make -C po clean
make -C mbox-helper
pkg-dist: pkg-build
rm -rf $(PKG_DIST) $(PKG_DIST).tar.gz
mkdir $(PKG_DIST)
cp -a $(PKG_FILES) $(PKG_DIST)
for dir in `find $(PKG_DIRS) -type d $(VCS_FILTER)`; \
do \
mkdir -p $(PKG_DIST)/$$dir; \
find $$dir -type f $(VCS_FILTER) -maxdepth 1 -exec cp {} $(PKG_DIST)/$$dir \; ; \
done
tar czf $(PKG_DIST).tar.gz $(PKG_DIST)
rm -rf $(PKG_DIST)
.PHONY: build dist clean pkg-build pkg-dist lib-build lib-dist