-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (49 loc) · 1.55 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
62
63
64
65
66
67
68
69
# definitions
VERSION = 0.9.22
PKG_DIST = diogenes-$(VERSION)
LIB_DIST = libdiogenes-$(VERSION)
PKG_FILES = AUTHORS ChangeLog COPYING README Makefile \
cvs.pl Doxyfile.in
PKG_DIRS = config htdocs include locale po plugins scripts styles templates
LIB_FILES = COPYING
LIB_BASE = include/diogenes
VCS_FILTER = \( -name .arch-ids -o -name CVS -o -name .svn \) -prune
# global targets
build: pkg-build lib-build
dist: clean pkg-dist lib-dist
clean:
rm -rf locale include/diogenes.globals.inc.php
for ext in php tpl css po; \
do \
find -type f -name *.$$ext~ -exec rm -f {} \; ; \
done
%: %.in Makefile
sed -e 's,@VERSION@,$(VERSION),g' $< > $@
# diogenes package targets
pkg-build: include/diogenes.globals.inc.php Doxyfile
make -C po
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) $(VCS_FILTER) -o -type d -print`; \
do \
mkdir -p $(PKG_DIST)/$$dir; \
find $$dir -maxdepth 1 -type f -exec cp {} $(PKG_DIST)/$$dir \; ; \
done
tar czf $(PKG_DIST).tar.gz $(PKG_DIST)
rm -rf $(PKG_DIST)
# diogenes library targets
lib-build:
lib-dist: lib-build
rm -rf $(LIB_DIST)
mkdir $(LIB_DIST)
cp -a $(LIB_FILES) $(LIB_DIST)
for dir in `cd $(LIB_BASE) && find . $(VCS_FILTER) -o -type d -print`; \
do \
mkdir -p $(LIB_DIST)/$$dir; \
find $(LIB_BASE)/$$dir -maxdepth 1 -type f -exec cp {} $(LIB_DIST)/$$dir \; ; \
done
tar czf $(LIB_DIST).tar.gz $(LIB_DIST)
rm -rf $(LIB_DIST)
.PHONY: build dist clean pkg-build pkg-dist lib-build lib-dist