@@ -101,23 +101,10 @@ 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
@@ -128,28 +115,28 @@ all: help
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 --ignore=" \./vendor/" --standard=psr12 src test
151138
152- # Build a DEB package for Debian-like Linux distributions
139+ # # Build a DEB package for Debian-like Linux distributions
153140.PHONY : deb
154141deb :
155142 rm -rf $(PATHDEBPKG )
@@ -174,28 +161,28 @@ endif
174161 echo "new-package-should-close-itp-bug" > $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/$(PKGNAME).lintian-overrides
175162 cd $(PATHDEBPKG)/$(PKGNAME)-$(VERSION) && debuild -us -uc
176163
177- # Clean all artifacts and download all dependencies
164+ # # Clean all artifacts and download all dependencies
178165.PHONY : deps
179166deps : ensuretarget
180167 rm -rf ./vendor/*
181168 ($( COMPOSER) install -vvv --no-interaction)
182169 curl --silent --show-error --fail --location --output ./vendor/phpstan.phar https://github.com/phpstan/phpstan/releases/download/${PHPSTANVER} /phpstan.phar \
183170 && chmod +x ./vendor/phpstan.phar
184171
185- # Generate source code documentation
172+ # # Generate source code documentation
186173.PHONY : doc
187174doc : ensuretarget
188175 rm -rf $(TARGETDIR ) /doc
189176 $(PHPDOC ) -d ./src -t $(TARGETDIR ) /doc/
190177
191- # Create missing target directories for test and build artifacts
178+ # # Create missing target directories for test and build artifacts
192179.PHONY : ensuretarget
193180ensuretarget :
194181 mkdir -p $(TARGETDIR ) /test
195182 mkdir -p $(TARGETDIR ) /report
196183 mkdir -p $(TARGETDIR ) /doc
197184
198- # Install this application
185+ # # Install this application
199186.PHONY : install
200187install : uninstall
201188 mkdir -p $(PATHINSTBIN )
@@ -217,26 +204,26 @@ ifneq ($(strip $(CONFIGPATH)),)
217204 find $(PATHINSTCFG) -type f -exec chmod 644 {} \;
218205endif
219206
220- # Test source code for coding standard violations
207+ # # Test source code for coding standard violations
221208.PHONY : lint
222209lint :
223210 ./vendor/bin/phpcs --standard=phpcs.xml
224211 ./vendor/bin/phpmd src text codesize,unusedcode,naming,design --exclude * /vendor/*
225212 ./vendor/bin/phpmd test text unusedcode,naming,design --exclude * /vendor/*
226213 php -r ' exit((int)version_compare(PHP_MAJOR_VERSION, "7", ">"));' || ./vendor/phpstan.phar analyse
227214
228- # Run all tests and reports
215+ # # Run all tests and reports
229216.PHONY : qa
230217qa : ensuretarget lint test report
231218
232- # Generate various reports
219+ # # Generate various reports
233220.PHONY : report
234221report : ensuretarget
235222 # ./vendor/bin/phpcpd --exclude vendor --exclude src/Encoding.php src > $(TARGETDIR)/report/phpcpd.txt
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,33 +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
0 commit comments