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=fusionforge-$(VER)-$(ID)
32 VERSION=fusionforge-$(VER)
36 @echo "=========================================================================="
37 @echo "We have detected that your are running a '$(DIST)' distribution."
38 @echo "Use one of the following targets with "
39 @echo "$$ make -f Makefile.$(DIST) <target>"
40 @echo "=========================================================================="
41 @$(MAKE) -f Makefile.$(DIST)
44 ## To run test in verbose mode :
45 #cd tests ; phpunit --verbose unit; phpunit --verbose code;
46 cd tests ; php AllTests.php
49 rm -fr /tmp/$(VERSION)
50 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)
51 cd /tmp/$(VERSION); utils/manage-translations.sh build
52 cd /tmp/; tar jcf $(BUILDRESULT)/$(VERSION).tar.bz2 $(VERSION)
53 rm -fr /tmp/$(VERSION)
56 mkdir -p $(BUILDDIR)/reports/coverage
57 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
58 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
61 $(DOXYGEN) gforge/docs/fusionforge.doxygen
62 $(DOXYGEN) gforge/plugins/wiki/www/doc/phpwiki.doxygen
65 mkdir -p $(BUILDDIR)/build/packages $(BUILDDIR)/reports/coverage
66 find $(BUILDDIR)/build/packages -type f -exec rm -f {} \;
67 -phpcs --tab-width=4 --standard=PEAR --report=checkstyle gforge/common > $(BUILDDIR)/reports/checkstyle.xml
68 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
69 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
70 cd tests; phpunit --log-xml $(BUILDDIR)/reports/phpunit-selenium.xml TarCentos52Tests.php
71 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
74 gforge/plugins/mediawiki/mediawiki-skin/FusionForge.php:
75 $(MAKE) -C gforge/plugins/mediawiki/mediawiki-skin
77 %: gforge/plugins/mediawiki/mediawiki-skin/FusionForge.php
78 $(MAKE) -f Makefile.$(DIST) $@