@@ -101,56 +101,43 @@ help:
101101 @echo " $( PROJECT) Makefile."
102102 @echo " The following commands are available:"
103103 @echo " "
104- @echo " make buildall : Build and test everything from scratch"
105- @echo " make bz2 : Package the library in a compressed bz2 archive"
106- @echo " make clean : Delete the vendor and target directories"
107- @echo " make codefix : Fix code style violations"
108- @echo " make deb : Build a DEB package for Debian-like Linux distributions"
109- @echo " make deps : Download all dependencies"
110- @echo " make doc : Generate source code documentation"
111- @echo " make lint : Test source code for coding standard violations"
112- @echo " make qa : Run all tests and reports"
113- @echo " make report : Generate various reports"
114- @echo " make rpm : Build an RPM package for RedHat-like Linux distributions"
115- @echo " make server : Start the development server"
116- @echo " make test : Run unit tests"
117- @echo " make versionup: Increase the version patch number"
104+ @awk ' /^## /{desc=substr($$0,4)} /^\.PHONY:/{if(NF>1) {target=$$2; if(desc) printf " make %-15s: %s\n",target,desc; desc=""}}' Makefile
118105 @echo " "
119- @echo " To test and build everything from scratch:"
120- @echo " make buildall "
106+ @echo " To test and build everything from scratch, use the shortcut :"
107+ @echo " make x "
121108 @echo " "
122109
123110# alias for help target
124111.PHONY : all
125112all : help
126113
127- # Full build and test sequence
114+ # # Full build and test sequence
128115.PHONY : x
129116x : buildall
130117
131- # Full build and test sequence
118+ # # Full build and test sequence
132119.PHONY : buildall
133120buildall : deps codefix qa bz2 rpm deb
134121
135- # Package the library in a compressed bz2 archive
122+ # # Package the library in a compressed bz2 archive
136123.PHONY : bz2
137124bz2 :
138125 rm -rf $(PATHBZ2PKG )
139126 make install DESTDIR=$(PATHBZ2PKG )
140127 tar -jcvf $(PATHBZ2PKG ) /$(PKGNAME ) -$(VERSION ) -$(RELEASE ) .tbz2 -C $(PATHBZ2PKG ) $(DATADIR )
141128
142- # Delete the vendor and target directories
129+ # # Delete the vendor and target directories
143130.PHONY : clean
144131clean :
145132 rm -rf ./vendor $(TARGETDIR )
146133
147- # Fix code style violations
134+ # # Fix code style violations
148135.PHONY : codefix
149136codefix :
150137 ./vendor/bin/phpcbf --config-set ignore_non_auto_fixable_on_exit 1
151138 ./vendor/bin/phpcbf --ignore=" \./vendor/" --standard=psr12 src test
152139
153- # Build a DEB package for Debian-like Linux distributions
140+ # # Build a DEB package for Debian-like Linux distributions
154141.PHONY : deb
155142deb :
156143 rm -rf $(PATHDEBPKG )
@@ -175,28 +162,28 @@ endif
175162 echo "new-package-should-close-itp-bug" > $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/$(PKGNAME).lintian-overrides
176163 cd $(PATHDEBPKG)/$(PKGNAME)-$(VERSION) && debuild -us -uc
177164
178- # Clean all artifacts and download all dependencies
165+ # # Clean all artifacts and download all dependencies
179166.PHONY : deps
180167deps : ensuretarget
181168 rm -rf ./vendor/*
182169 ($( COMPOSER) install -vvv --no-interaction)
183170 curl --silent --show-error --fail --location --output ./vendor/phpstan.phar https://github.com/phpstan/phpstan/releases/download/${PHPSTANVER} /phpstan.phar \
184171 && chmod +x ./vendor/phpstan.phar
185172
186- # Generate source code documentation
173+ # # Generate source code documentation
187174.PHONY : doc
188175doc : ensuretarget
189176 rm -rf $(TARGETDIR ) /doc
190177 $(PHPDOC ) -d ./src -t $(TARGETDIR ) /doc/
191178
192- # Create missing target directories for test and build artifacts
179+ # # Create missing target directories for test and build artifacts
193180.PHONY : ensuretarget
194181ensuretarget :
195182 mkdir -p $(TARGETDIR ) /test
196183 mkdir -p $(TARGETDIR ) /report
197184 mkdir -p $(TARGETDIR ) /doc
198185
199- # Install this application
186+ # # Install this application
200187.PHONY : install
201188install : uninstall
202189 mkdir -p $(PATHINSTBIN )
@@ -218,25 +205,25 @@ ifneq ($(strip $(CONFIGPATH)),)
218205 find $(PATHINSTCFG) -type f -exec chmod 644 {} \;
219206endif
220207
221- # Test source code for coding standard violations
208+ # # Test source code for coding standard violations
222209.PHONY : lint
223210lint :
224211 ./vendor/bin/phpcs --standard=phpcs.xml
225212 ./vendor/bin/phpmd src text codesize,unusedcode,naming,design --exclude * /vendor/*
226213 ./vendor/bin/phpmd test text unusedcode,naming,design --exclude * /vendor/*
227214 php -r ' exit((int)version_compare(PHP_MAJOR_VERSION, "7", ">"));' || ./vendor/phpstan.phar analyse
228215
229- # Run all tests and reports
216+ # # Run all tests and reports
230217.PHONY : qa
231218qa : ensuretarget lint test report
232219
233- # Generate various reports
220+ # # Generate various reports
234221.PHONY : report
235222report : ensuretarget
236223 ./vendor/bin/pdepend --jdepend-xml=$(TARGETDIR ) /report/dependencies.xml --summary-xml=$(TARGETDIR ) /report/metrics.xml --jdepend-chart=$(TARGETDIR ) /report/dependecies.svg --overview-pyramid=$(TARGETDIR ) /report/overview-pyramid.svg --ignore=vendor ./src
237224 # ./vendor/bartlett/php-compatinfo/bin/phpcompatinfo --no-ansi analyser:run src/ > $(TARGETDIR)/report/phpcompatinfo.txt
238225
239- # Build the RPM package for RedHat-like Linux distributions
226+ # # Build the RPM package for RedHat-like Linux distributions
240227.PHONY : rpm
241228rpm :
242229 rm -rf $(PATHRPMPKG )
@@ -254,34 +241,33 @@ rpm:
254241 --define " _configpath /$( CONFIGPATH) " \
255242 -bb resources/rpm/rpm.spec
256243
257- # Start the development server
244+ # # Start the development server
258245.PHONY : server
259246server :
260247 $(PHP ) -t example -S localhost:$(PORT )
261248
262- # Tag this GIT version
249+ # # Tag this GIT version
263250.PHONY : tag
264251tag :
265252 git checkout main && \
266253 git tag -a ${VERSION} -m " Release ${VERSION} " && \
267254 git push origin --tags && \
268255 git pull
269256
270- # Run unit tests
257+ # # Run unit tests
271258.PHONY : test
272259test :
273260 cp phpunit.xml.dist phpunit.xml
274261 # ./vendor/bin/phpunit --migrate-configuration || true
275262 XDEBUG_MODE=coverage ./vendor/bin/phpunit --stderr test
276263
277- # Remove all installed files
264+ # # Remove all installed files
278265.PHONY : uninstall
279266uninstall :
280267 rm -rf $(PATHINSTBIN )
281268 rm -rf $(PATHINSTDOC )
282269
283- # Increase the version patch number
270+ # # Increase the version patch number
284271.PHONY : versionup
285272versionup :
286273 echo ${VERSION} | gawk -F. ' {printf("%d.%d.%d\n",$$1,$$2,(($$3+1)));}' > VERSION
287-
0 commit comments