-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
46 lines (40 loc) · 1.06 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
# This file is licensed under the Affero General Public License version 3 or
# later. See the LICENSE file.
# Dependencies:
# * make
# * zip: for building the archive
app_name=$(notdir $(CURDIR))
build_tools_directory=$(CURDIR)/build/tools
build_directory=$(CURDIR)/build/artifacts/
package_name=$(build_directory)/$(app_name)
composer=$(shell which composer 2> /dev/null)
all: clean composer
release: composer pack
# a copy is fetched from the web
.PHONY: composer
composer:
ifeq (,$(composer))
@echo "No composer command available, downloading a copy from the web"
mkdir -p $(build_tools_directory)
curl -sS https://getcomposer.org/installer | php
mv composer.phar $(build_tools_directory)
php $(build_tools_directory)/composer.phar install --prefer-dist
else
composer install --prefer-dist
endif
# Cleaning
.PHONY: clean
clean:
rm -rf vendor/
rm -rf build
.PHONY: pack
pack:
rm -rf $(build_directory)
mkdir -p $(build_directory)
composer install --no-dev
zip $(package_name).zip \
-x '/.git/*' \
-x '/composer.*' \
-x '/.gitignore' \
-x '/Makefile' \
-r .