| 1 | # definitions |
| 2 | |
| 3 | VERSION = 0.9.19pre2 |
| 4 | PKG_DIST = diogenes-$(VERSION) |
| 5 | LIB_DIST = libdiogenes-$(VERSION) |
| 6 | |
| 7 | PKG_FILES = AUTHORS ChangeLog COPYING README Makefile \ |
| 8 | cvs.pl style.css |
| 9 | |
| 10 | PKG_DIRS = config htdocs include locale po plugins templates |
| 11 | |
| 12 | LIB_FILES = COPYING |
| 13 | LIB_BASE = include/diogenes |
| 14 | |
| 15 | VCS_FILTER = \( -name .arch-ids -o -name CVS -o -name .svn \) -prune |
| 16 | |
| 17 | # global targets |
| 18 | |
| 19 | build: pkg-build lib-build |
| 20 | |
| 21 | dist: clean pkg-dist lib-dist |
| 22 | |
| 23 | clean: |
| 24 | rm -rf locale include/diogenes.globals.inc.php |
| 25 | for ext in php tpl css po; \ |
| 26 | do \ |
| 27 | find -type f -name *.$$ext~ -exec rm -f {} \; ; \ |
| 28 | done |
| 29 | |
| 30 | %: %.in Makefile |
| 31 | sed -e 's,@VERSION@,$(VERSION),g' $< > $@ |
| 32 | |
| 33 | |
| 34 | # diogenes package targets |
| 35 | |
| 36 | pkg-build: include/diogenes.globals.inc.php |
| 37 | make -C po |
| 38 | |
| 39 | pkg-dist: pkg-build |
| 40 | rm -rf $(PKG_DIST) $(PKG_DIST).tar.gz |
| 41 | mkdir $(PKG_DIST) |
| 42 | cp -a $(PKG_FILES) $(PKG_DIST) |
| 43 | for dir in `find $(PKG_DIRS) $(VCS_FILTER) -o -type d -print`; \ |
| 44 | do \ |
| 45 | mkdir -p $(PKG_DIST)/$$dir; \ |
| 46 | find $$dir -maxdepth 1 -type f -exec cp {} $(PKG_DIST)/$$dir \; ; \ |
| 47 | done |
| 48 | tar czf $(PKG_DIST).tar.gz $(PKG_DIST) |
| 49 | rm -rf $(PKG_DIST) |
| 50 | |
| 51 | |
| 52 | # diogenes library targets |
| 53 | |
| 54 | lib-build: |
| 55 | |
| 56 | lib-dist: lib-build |
| 57 | rm -rf $(LIB_DIST) |
| 58 | mkdir $(LIB_DIST) |
| 59 | cp -a $(LIB_FILES) $(LIB_DIST) |
| 60 | for dir in `cd $(LIB_BASE) && find . $(VCS_FILTER) -o -type d -print`; \ |
| 61 | do \ |
| 62 | mkdir -p $(LIB_DIST)/$$dir; \ |
| 63 | find $(LIB_BASE)/$$dir -maxdepth 1 -type f -exec cp {} $(LIB_DIST)/$$dir \; ; \ |
| 64 | done |
| 65 | tar czf $(LIB_DIST).tar.gz $(LIB_DIST) |
| 66 | rm -rf $(LIB_DIST) |
| 67 | |
| 68 | |
| 69 | .PHONY: build dist clean pkg-build pkg-dist lib-build lib-dist |
| 70 | |