-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
32 lines (24 loc) · 792 Bytes
/
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
VERSION:=$$(head -n20 catalog/controller/payment/trustly.php | grep -w _module_version | cut -f2 -d\')
PACKAGE=trustly-opencart
ROOT=$(PWD)
FILES=$$(find admin/ catalog/ system/ trustly-notification.php -type f \! -name \*.git \! -name README.md \! -name LICENCE)
DESTDIR?=$(HOME)/opencart-1.5.6.4/upload
BUILDDIR:=$(PACKAGE)-$(VERSION)-build
TARGET:=$(PACKAGE)-$(VERSION).zip
all: zip
.PHONY: install
install:
for file in $(FILES); do \
mkdir -p "$(DESTDIR)/$$(dirname $$file)"; \
ln -sf "$(ROOT)/$$file" "$(DESTDIR)/$$(dirname $$file)"; \
done
.PHONY: clean
clean:
rm -rf "$(BUILDDIR)"
.PHONY: zip
zip: clean
mkdir -p "$(BUILDDIR)"
tar -cf - $(FILES) | (cd "$(BUILDDIR)"; tar -xf -)
(cd "$(BUILDDIR)"; zip -r ../"$(TARGET)" *)
@unzip -v "$(TARGET)"
@ls -la "$(TARGET)"