-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (44 loc) · 1.74 KB
/
Makefile
File metadata and controls
59 lines (44 loc) · 1.74 KB
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
PACKAGE = omp-plugin
VERSION = 0.2.0
ARCHIVE = $(PACKAGE)-$(VERSION)
BUILDDIR = ./BUILD/$(ARCHIVE)/
DESTDIR = /var/www/wp_ompcouk/wp-content/plugins/
.PHONY: test
all: build
##############################################################################
# INSTALL TO DESTDIR AS IF FINAL PRODUCT - This may require sudo
##############################################################################
install:
cp -R $(BUILDDIR) $(DESTDIR)
chown -R www-data:www-data $(DESTDIR)$(ARCHIVE)
distclean:
rm -rf $(DESTDIR)$(ARCHIVE)
##############################################################################
# INSTALL TO DESTDIR WITH -dev PREPENDED - This may require sudo
##############################################################################
devinstall:
cp -R $(BUILDDIR) $(DESTDIR)$(ARCHIVE)-dev/
chown -R www-data:www-data $(DESTDIR)$(ARCHIVE)-dev
devclean:
rm -rf $(DESTDIR)$(ARCHIVE)-dev
##############################################################################
# BUILDING OF THE PLUGIN
##############################################################################
# Build should build the plugin into BUILD asif BUILD was the root of the plugin
build: clean test prep
cp -R src/* $(BUILDDIR)
# Replace {{VERSION}} with the version of the build in all files
find $(BUILDDIR) -type f | xargs perl -pi -e 's/{{VERSION}}/$(VERSION)/g'
find $(BUILDDIR) -type f | xargs perl -pi -e 's/{{ARCHIVE}}/$(ARCHIVE)/g'
dist: build
tar -cjf ./SOURCES/$(ARCHIVE).tar.bz2 -C ./BUILD/ .
cd ./BUILD/ && zip -9 -r ../SOURCES/$(ARCHIVE).zip ${ARCHIVE} && cd -
clean:
rm -rf BUILD SOURCES
prep:
mkdir -p $(BUILDDIR) SOURCES
test:
phpunit -c test/phpunit.xml
release: dist
git tag -a v$(VERSION) -m"Tagging $(VERSION) release of omp-plugin"
git push --tags