-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
86 lines (67 loc) · 2.94 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
######################################################
# Start edit here
VENDOR:=DerModPro
MODULE:=BasePrice
ARCHIVE_COLLECTION:=app skin
# End edit here
######################################################
######################################################
# Build script variables
MODULE_KEY:=$(VENDOR)_$(MODULE)
DATE:=$(shell date +%s)
VERSION:=$(shell grep "<version>" app/code/community/$(VENDOR)/$(MODULE)/etc/config.xml | sed -e :a -e 's/<[^>]*>//g;/</N;//ba;s/ //g')
#Paths for tar and zip-file
MODULE_PATH:=$(shell pwd)
TMPPATH:=/tmp/$(MODULE).$(DATE)
ZIPNAME:=$(MODULE)_$(VERSION).zip
TARNAME:=$(MODULE)_$(VERSION).tar
ZIPFILE:=/tmp/$(ZIPNAME)
TARFILE:=/tmp/$(TARNAME)
# Doc folders
DOCPATH:=doc
DOC_PUBLIC_PATH:=$(DOCPATH)/$(MODULE_KEY)
DOC_INTERN_PATH:=$(DOCPATH)/Intern
DOC_SOURCE_PATH:=$(DOCPATH)/src
######################################################
all: clean version doc zip tar
doc: $(DOC_PUBLIC_PATH)/ChangeLog.pdf $(DOC_INTERN_PATH)/Specification.pdf $(DOC_INTERN_PATH)/KnownIssues.pdf $(DOC_INTERN_PATH)/Entwicklerdokumentation.pdf
$(DOC_PUBLIC_PATH)/ChangeLog.pdf: $(DOC_SOURCE_PATH)/ChangeLog.rst $(DOC_SOURCE_PATH)/netresearch.style
rst2pdf -b 1 -o $(DOC_PUBLIC_PATH)/ChangeLog.pdf -s $(DOC_SOURCE_PATH)/netresearch.style $(DOC_SOURCE_PATH)/ChangeLog.rst --real-footnotes
$(DOC_INTERN_PATH)/Specification.pdf: $(DOC_SOURCE_PATH)/Specification.rst $(DOC_SOURCE_PATH)/netresearch.style
rst2pdf -b 1 -o $(DOC_INTERN_PATH)/Specification.pdf -s $(DOC_SOURCE_PATH)/netresearch.style $(DOC_SOURCE_PATH)/Specification.rst --real-footnotes
$(DOC_INTERN_PATH)/KnownIssues.pdf: $(DOC_SOURCE_PATH)/KnownIssues.rst $(DOC_SOURCE_PATH)/netresearch.style
rst2pdf -b 1 -o $(DOC_INTERN_PATH)/KnownIssues.pdf -s $(DOC_SOURCE_PATH)/netresearch.style $(DOC_SOURCE_PATH)/KnownIssues.rst --real-footnotes
$(DOC_INTERN_PATH)/Entwicklerdokumentation.pdf: $(DOC_SOURCE_PATH)/Entwicklerdokumentation.rst $(DOC_SOURCE_PATH)/netresearch.style
rst2pdf -b 1 -o $(DOC_INTERN_PATH)/Entwicklerdokumentation.pdf -s $(DOC_SOURCE_PATH)/netresearch.style $(DOC_SOURCE_PATH)/Entwicklerdokumentation.rst --real-footnotes
clean:
rm -f $(DOC_PUBLIC_PATH)/*.pdf
rm -f $(DOC_INTERN_PATH)/*.pdf
version:
@echo === Making $(MODULE_KEY) version $(VERSION)
zip:
@echo === Creating zip file $(ZIPFILE) from $(TMPPATH)
rm -f $(ZIPFILE)
rm -f $(ZIPNAME)
rm -rf $(TMPPATH)
mkdir -p $(TMPPATH)/doc
cp -r $(ARCHIVE_COLLECTION) $(TMPPATH)
cp -r doc/$(MODULE_KEY) $(TMPPATH)/doc/
cd $(TMPPATH) && zip -rq $(ZIPFILE) *
rm -rf $(TMPPATH)
cd $(MODULE_PATH)
cp -f $(ZIPFILE) $(ZIPNAME)
rm -f $(ZIPFILE)
tar:
@echo === Creating tar file $(TARFILE) from $(TMPPATH)
rm -f $(TARFILE)
rm -f $(TARNAME)
rm -rf $(TMPPATH)
mkdir -p $(TMPPATH)/doc
cp -r $(ARCHIVE_COLLECTION) $(TMPPATH)
cp -r doc/$(MODULE_KEY) $(TMPPATH)/doc/
cd $(TMPPATH) && tar -cf $(TARFILE) *
rm -rf $(TMPPATH)
cd $(MODULE_PATH)
cp -f $(TARFILE) $(TARNAME)
rm -f $(TARFILE)
.PHONY: doc