1+ VERSION =$(shell grep '\- Version ' mysqltuner.pl | awk '{ print $$NF}')
2+ UPDATE_SUB_VERSION =$(shell echo $(VERSION ) | awk -F. '{ print $$1"."$$2"."$$3+1 }')
3+ UPDATE_MINOR_VERSION =$(shell echo $(VERSION ) | awk -F. '{ print $$1"."$$2+1".0" }')
4+ UPDATE_MAJOR_VERSION =$(shell echo $(VERSION ) | awk -F. '{ print $$1+1".0.0" }')
5+
6+ all : generate_cve generate_features generate_usage tidy increment_sub_version
7+
8+ help :
9+ @echo " Usage: make <target>"
10+ @echo " help: Show this help"
11+ @echo " generate_usage: Generate USAGE.md"
12+ @echo " generate_cve: Generate vulnerabilities.csv"
13+ @echo " generate_features: Generate FEATURES.md"
14+ @echo " tidy: Tidy mysqltuner.pl"
15+ @echo " installdep_debian: Install dependencies on Debian"
16+ @echo " increment_sub_version: Increment sub version"
17+ @echo " increment_minor_version: Increment minor version"
18+ @echo " increment_major_version: Increment major version"
19+ @echo " push: Push to GitHub"
20+
21+
22+ installdep_debian :
23+ apt install -y cpanminus libpod-markdown-perl libwww-mechanize-gzip-perl perltidy dos2unix
24+ cpanm File::Util
25+
26+ tidy :
27+ dos2unix ./mysqltuner.pl
28+ perltidy -b ./mysqltuner.pl
29+ git add ./mysqltuner.pl
30+ git commit -m " Indenting mysqltuner at $( shell date --iso=seconds) "
31+
32+ generate_usage :
33+ pod2markdown mysqltuner.pl > USAGE.md
34+ git add ./USAGE.md
35+ git commit -m " Generate USAGE.md at $( shell date --iso=seconds) "
36+
37+ generate_cve :
38+ perl ./build/updateCVElist.pl
39+ git add ./vulnerabilities.csv
40+ git commit -m " Generate CVE list at $( shell date --iso=seconds) "
41+
42+ generate_features :
43+ perl ./build/genFeatures.sh
44+ git add ./FEATURES.md
45+ git commit -m " Generate FEATURES.md at $( shell date --iso=seconds) "
46+
47+ increment_sub_version :
48+ @echo " Incrementing sub version from $( VERSION) to $( UPDATE_SUB_VERSION) "
49+ sed -i " s/$( VERSION) /$( UPDATE_SUB_VERSION) /" mysqltuner.pl * .md
50+ git add ./* .md ./mysqltuner.pl
51+ git commit -m " Generate $( UPDATE_SUB_VERSION) sub version at $( shell date --iso=seconds) "
52+
53+ increment_minor_version :
54+ @echo " Incrementing minor version from $( VERSION) to $( UPDATE_MINOR_VERSION) "
55+ sed -i " s/$( VERSION) /$( UPDATE_MINOR_VERSION) /" mysqltuner.pl * .md
56+ git add ./* .md ./mysqltuner.pl
57+ git commit -m " Generate $( UPDATE_SUB_VERSION) minor version at $( shell date --iso=seconds) "
58+
59+ increment_major_version :
60+ @echo " Incrementing major version from $( VERSION) to $( UPDATE_MAJOR_VERSION) "
61+ sed -i " s/$( VERSION) /$( UPDATE_MAJOR_VERSION) /" mysqltuner.pl * .md
62+ git add ./* .md ./mysqltuner.pl
63+ git commit -m " Generate $( UPDATE_SUB_VERSION) major version at $( shell date --iso=seconds) "
64+
65+ push :
66+ git push
0 commit comments