forked from neymanna/fusionforge
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
98 lines (80 loc) · 4.03 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#
# This Makefile may be used to create packages for distributions
#
DISTDEBIAN=$(shell [ -f /etc/debian_version ] && echo debian)
DISTREDHAT=$(shell grep -qi 'Red Hat' /etc/issue && echo rh)
DISTSUSE=$(shell grep -qi 'SuSE' /etc/issue && echo rh)
DIST=$(DISTDEBIAN)$(DISTREDHAT)$(DISTSUSE)
ARCHIVE=$(CURDIR)/depot
#ifeq ($(BUILDDIR),)
# BUILDDIR=builddir
#endif
BUILDRESULT=$(CURDIR)/result
DOXYGEN=doxygen
VER=$(shell LANG=C grep '>software_version' src/common/include/FusionForge.class.php | cut -d\' -f2)
in_svn_repo:= $(wildcard .svn/)
ifeq ($(strip $(in_svn_repo)),)
ID=unknown
URL=unknown
TAG=unknown
else
ID=$(shell LANG=C svnversion)
URL=$(shell LANG=C svn info | grep 'Root:' | awk '{print $$3}')
TAG=$(shell LANG=C svn log $(URL) -r $(ID) -l 1 2>/dev/null | awk '{ if ($$1=="Tag-Release") print $$1}')
endif
ifeq ($(TAG),)
VERSION_ID=$(VER)-$(ID)
VERSION=fusionforge-$(VER)-$(ID)
else
VERSION_ID=$(VER)
VERSION=fusionforge-$(VER)
endif
switch:
@echo "=========================================================================="
@echo "We have detected that your are running a '$(DIST)' distribution."
@echo "Use one of the following targets with "
@echo "$$ make -f Makefile.$(DIST) <target>"
@echo "=========================================================================="
@$(MAKE) -f Makefile.$(DIST)
check:
## To run test in verbose mode :
#cd tests ; phpunit --verbose unit; phpunit --verbose code;
cd tests ; php AllTests.php | perl -p -e '$$e=1 if /FAILURE/ ; END { exit 1 if $$e }'
checkfull:
## To run test in verbose mode :
#cd tests ; phpunit --verbose unit; phpunit --verbose code; phpunit --verbose build
cd tests ; php AllFullTests.php
checkdebtools:
sudo apt-get install php5-cli phpunit php-htmlpurifier pcregrep moreutils createrepo xalan #ubuntu-keyring
buildtar: $(BUILDRESULT)
rm -fr /tmp/$(VERSION)
cd src; 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)
cd /tmp/$(VERSION); utils/manage-translations.sh build
cd /tmp/; tar jcf $(BUILDRESULT)/$(VERSION).tar.bz2 $(VERSION)
rm -fr /tmp/$(VERSION)
$(BUILDRESULT):
mkdir $(BUILDRESULT)
build-unit-tests:
mkdir -p $(BUILDDIR)/reports/coverage
cd tests; phpunit --log-junit $(BUILDDIR)/reports/phpunit.xml --coverage-clover $(BUILDDIR)/reports/coverage/clover.xml --coverage-html $(BUILDDIR)/reports/coverage/ AllTests.php
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
build-doc:
$(DOXYGEN) src/docs/fusionforge.doxygen
$(DOXYGEN) src/plugins/wiki/www/doc/phpwiki.doxygen
build-full-tests:
mkdir -p $(BUILDDIR)/build/packages $(BUILDDIR)/reports/coverage
find $(BUILDDIR)/build/packages -type f -exec rm -f {} \;
-phpcs --tab-width=4 --standard=PEAR --report=checkstyle src/common > $(BUILDDIR)/reports/checkstyle.xml
cd tests; phpunit --log-junit $(BUILDDIR)/reports/phpunit.xml --coverage-clover $(BUILDDIR)/reports/coverage/clover.xml --coverage-html $(BUILDDIR)/reports/coverage/ AllFullTests.php
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
cd tests; phpunit --log-junit $(BUILDDIR)/reports/phpunit-selenium.xml TarCentos52Tests.php
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
src/plugins/mediawiki/mediawiki-skin/FusionForge.php:
$(MAKE) -C src/plugins/mediawiki/mediawiki-skin
%: src/plugins/mediawiki/mediawiki-skin/FusionForge.php
$(MAKE) -f Makefile.$(DIST) $@
wslink: /etc/apache2/mods-enabled/userdir.load
[ -d ~/public_html ] || mkdir ~/public_html
[ -L ~/public_html/ws ] || ln -s $(CURDIR) ~/public_html/ws
/etc/apache2/mods-enabled/userdir.load:
sudo a2enmod userdir