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+
51+ increment_minor_version :
52+ @echo " Incrementing minor version from $( VERSION) to $( UPDATE_MINOR_VERSION) "
53+ sed -i " s/$( VERSION) /$( UPDATE_MINOR_VERSION) /" mysqltuner.pl * .md
54+
55+ increment_major_version :
56+ @echo " Incrementing major version from $( VERSION) to $( UPDATE_MAJOR_VERSION) "
57+ sed -i " s/$( VERSION) /$( UPDATE_MAJOR_VERSION) /" mysqltuner.pl * .md
58+
59+ push :
60+ git push
0 commit comments