2 # TODO : document the role of this Makefile
5 DISTDEBIAN=$(shell [ -f /etc/debian_version ] && echo debian)
6 DISTREDHAT=$(shell grep -qi 'Red Hat' /etc/issue && echo rh)
7 DISTSUSE=$(shell grep -qi 'SuSE' /etc/issue && echo rh)
8 DIST=$(DISTDEBIAN)$(DISTREDHAT)$(DISTSUSE)
10 ARCHIVE=$(CURDIR)/depot
11 BUILDRESULT=$(CURDIR)/result
15 VER=$(shell LANG=C grep '>software_version' gforge/common/include/FusionForge.class.php | cut -d\' -f2)
16 in_svn_repo:= $(wildcard .svn/)
17 ifeq ($(strip $(in_svn_repo)),)
22 ID=$(shell LANG=C svnversion)
23 URL=$(shell LANG=C svn info | grep 'Root:' | awk '{print $$3}')
24 TAG=$(shell LANG=C svn log $(URL) -r $(ID) -l 1 2>/dev/null | awk '{ if ($$1=="Tag-Release") print $$1}')
27 VERSION=fusionforge-$(VER)-$(ID)
29 VERSION=fusionforge-$(VER)
33 @echo "=========================================================================="
34 @echo "Use one of the following target with "
35 @echo "make -f Makefile.$(DIST) <target>"
36 @echo "=========================================================================="
37 @$(MAKE) -f Makefile.$(DIST)
40 cd tests ; php AllTests.php
43 rm -fr /tmp/$(VERSION)
44 cd gforge; find . -type f -or -type l | grep -v '/.svn/' | grep -v '^./debian' | grep -v '^./deb-specific' | grep -v '^./rpm-specific' | grep -v '^./contrib' | grep -v '^./gforge.spec' | grep -v '^./README.setup' | grep -v '^./setup' | cpio -pdumB --quiet /tmp/$(VERSION)
45 cd /tmp/$(VERSION); utils/manage-translations.sh build
46 cd /tmp/; tar jcf $(BUILDRESULT)/$(VERSION).tar.bz2 $(VERSION)
47 rm -fr /tmp/$(VERSION)
50 mkdir -p $(BUILDDIR)/reports/coverage
51 cd tests; phpunit --log-xml $(BUILDDIR)/reports/phpunit.xml --log-pmd $(BUILDDIR)/reports/phpunit.pmd.xml --coverage-clover $(BUILDDIR)/reports/coverage/clover.xml --coverage-html $(BUILDDIR)/reports/coverage/ AllTests.php
52 cp $(BUILDDIR)/reports/phpunit.xml $(BUILDDIR)/reports/phpunit.xml.org; xalan -in $(BUILDDIR)/reports/phpunit.xml.org -xsl fix_phpunit.xslt -out $(BUILDDIR)/reports/phpunit.xml
55 $(DOXYGEN) gforge/docs/fusionforge.doxygen
56 $(DOXYGEN) gforge/plugins/wiki/www/doc/phpwiki.doxygen
59 mkdir -p $(BUILDDIR)/build/packages $(BUILDDIR)/reports/coverage
60 find $(BUILDDIR)/build/packages -type f -exec rm -f {} \;
61 -phpcs --tab-width=4 --standard=PEAR --report=checkstyle gforge/common > $(BUILDDIR)/reports/checkstyle.xml
62 cd tests; phpunit --log-xml $(BUILDDIR)/reports/phpunit.xml --log-pmd $(BUILDDIR)/reports/phpunit.pmd.xml --coverage-clover $(BUILDDIR)/reports/coverage/clover.xml --coverage-html $(BUILDDIR)/reports/coverage/ AllFullTests.php
63 cp $(BUILDDIR)/reports/phpunit.xml $(BUILDDIR)/reports/phpunit.xml.org; xalan -in $(BUILDDIR)/reports/phpunit.xml.org -xsl fix_phpunit.xslt -out $(BUILDDIR)/reports/phpunit.xml
64 cd tests; phpunit --log-xml $(BUILDDIR)/reports/phpunit-selenium.xml TarCentos52Tests.php
65 cp $(BUILDDIR)/reports/phpunit-selenium.xml $(BUILDDIR)/reports/phpunit-selenium.xml.org; xalan -in $(BUILDDIR)/reports/phpunit-selenium.xml.org -xsl fix_phpunit.xslt -out $(BUILDDIR)/reports/phpunit-selenium.xml
68 gforge/plugins/mediawiki/mediawiki-skin/FusionForge.php:
69 $(MAKE) -C gforge/plugins/mediawiki/mediawiki-skin
71 %: gforge/plugins/mediawiki/mediawiki-skin/FusionForge.php
72 $(MAKE) -f Makefile.$(DIST) $@