2 # This Makefile may be used to create packages for distributions
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
14 BUILDRESULT=$(CURDIR)/result
18 VER=$(shell LANG=C grep '>software_version' gforge/common/include/FusionForge.class.php | cut -d\' -f2)
19 in_svn_repo:= $(wildcard .svn/)
20 ifeq ($(strip $(in_svn_repo)),)
25 ID=$(shell LANG=C svnversion)
26 URL=$(shell LANG=C svn info | grep 'Root:' | awk '{print $$3}')
27 TAG=$(shell LANG=C svn log $(URL) -r $(ID) -l 1 2>/dev/null | awk '{ if ($$1=="Tag-Release") print $$1}')
30 VERSION_ID=$(VER)-$(ID)
31 VERSION=fusionforge-$(VER)-$(ID)
34 VERSION=fusionforge-$(VER)
38 @echo "=========================================================================="
39 @echo "We have detected that your are running a '$(DIST)' distribution."
40 @echo "Use one of the following targets with "
41 @echo "$$ make -f Makefile.$(DIST) <target>"
42 @echo "=========================================================================="
43 @$(MAKE) -f Makefile.$(DIST)
46 ## To run test in verbose mode :
47 #cd tests ; phpunit --verbose unit; phpunit --verbose code;
48 cd tests ; php AllTests.php
51 rm -fr /tmp/$(VERSION)
52 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 '^./fusionforge.spec' | cpio -pdumB --quiet /tmp/$(VERSION)
53 cd /tmp/$(VERSION); utils/manage-translations.sh build
54 cd /tmp/; tar jcf $(BUILDRESULT)/$(VERSION).tar.bz2 $(VERSION)
55 rm -fr /tmp/$(VERSION)
58 mkdir -p $(BUILDDIR)/reports/coverage
59 cd tests; phpunit --log-junit $(BUILDDIR)/reports/phpunit.xml --coverage-clover $(BUILDDIR)/reports/coverage/clover.xml --coverage-html $(BUILDDIR)/reports/coverage/ AllTests.php
60 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
63 $(DOXYGEN) gforge/docs/fusionforge.doxygen
64 $(DOXYGEN) gforge/plugins/wiki/www/doc/phpwiki.doxygen
67 mkdir -p $(BUILDDIR)/build/packages $(BUILDDIR)/reports/coverage
68 find $(BUILDDIR)/build/packages -type f -exec rm -f {} \;
69 -phpcs --tab-width=4 --standard=PEAR --report=checkstyle gforge/common > $(BUILDDIR)/reports/checkstyle.xml
70 cd tests; phpunit --log-junit $(BUILDDIR)/reports/phpunit.xml --coverage-clover $(BUILDDIR)/reports/coverage/clover.xml --coverage-html $(BUILDDIR)/reports/coverage/ AllFullTests.php
71 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
72 cd tests; phpunit --log-junit $(BUILDDIR)/reports/phpunit-selenium.xml TarCentos52Tests.php
73 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
76 gforge/plugins/mediawiki/mediawiki-skin/FusionForge.php:
77 $(MAKE) -C gforge/plugins/mediawiki/mediawiki-skin
79 %: gforge/plugins/mediawiki/mediawiki-skin/FusionForge.php
80 $(MAKE) -f Makefile.$(DIST) $@