diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2023-02-01 23:53:47 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2023-02-03 03:47:01 -0300 |
commit | f48886f2544f73033bebf88406066635355ea0d9 (patch) | |
tree | 4f8235eac9ac9dbd8ada90a629359814d3ac0dd6 /Makefile | |
parent | testing (diff) | |
download | firejail-f48886f2544f73033bebf88406066635355ea0d9.tar.gz firejail-f48886f2544f73033bebf88406066635355ea0d9.tar.zst firejail-f48886f2544f73033bebf88406066635355ea0d9.zip |
build: mark most phony targets as such
To improve clarity and to prevent unnecessary filesystem lookups.
Overall, this appears to reduce the amount of implicit rule searches by
~4% for the default build and by ~12% for the "man" target (as an
example):
$ git checkout master >/dev/null 2>&1
$ git show --pretty='%h %ai %s' -s
b55cb6a80 2023-01-31 18:56:42 -0500 testing
$ ./configure >/dev/null
$ make clean >/dev/null && make --debug=i -j 4 | grep -F 'Trying implicit' | wc -l
7101
$ make clean >/dev/null && make --debug=i -j 4 man | grep -F 'Trying implicit' | wc -l
1239
# (with this commit applied)
$ make clean >/dev/null && make --debug=i -j 4 | grep -F 'Trying implicit' | wc -l
6793
$ make clean >/dev/null && make --debug=i -j 4 man | grep -F 'Trying implicit' | wc -l
1085
Environment: GNU make 4.4-1 on Artix Linux.
Note: The amount lines printed is the same on non-parallel builds (that
is, without `-j 4`).
See commit 2465f9248 ("makefiles: make all, clean and distclean PHONY",
2021-02-12) / PR #4024 for details.
Note: By "most phony targets" I mean all non-path targets except for the
testing targets, which were being changed recently (for example, the
"test-github" target) and so might still be under development.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -58,6 +58,7 @@ mydirs: $(MYDIRS) | |||
58 | $(MYDIRS): | 58 | $(MYDIRS): |
59 | $(MAKE) -C $@ | 59 | $(MAKE) -C $@ |
60 | 60 | ||
61 | .PHONY: filters | ||
61 | filters: $(SECCOMP_FILTERS) $(SBOX_APPS_NON_DUMPABLE) | 62 | filters: $(SECCOMP_FILTERS) $(SBOX_APPS_NON_DUMPABLE) |
62 | seccomp: src/fseccomp/fseccomp src/fsec-optimize/fsec-optimize | 63 | seccomp: src/fseccomp/fseccomp src/fsec-optimize/fsec-optimize |
63 | src/fseccomp/fseccomp default seccomp | 64 | src/fseccomp/fseccomp default seccomp |
@@ -83,6 +84,7 @@ seccomp.mdwx.32: src/fseccomp/fseccomp | |||
83 | $(MANPAGES): src/man config.mk | 84 | $(MANPAGES): src/man config.mk |
84 | ./mkman.sh $(VERSION) src/man/$(basename $@).man $@ | 85 | ./mkman.sh $(VERSION) src/man/$(basename $@).man $@ |
85 | 86 | ||
87 | .PHONY: man | ||
86 | man: $(MANPAGES) | 88 | man: $(MANPAGES) |
87 | 89 | ||
88 | # Makes all targets in contrib/ | 90 | # Makes all targets in contrib/ |
@@ -178,6 +180,7 @@ distclean: clean | |||
178 | $(MAKE) -C test distclean | 180 | $(MAKE) -C test distclean |
179 | rm -fr autom4te.cache config.log config.mk config.sh config.status | 181 | rm -fr autom4te.cache config.log config.mk config.sh config.status |
180 | 182 | ||
183 | .PHONY: realinstall | ||
181 | realinstall: config.mk | 184 | realinstall: config.mk |
182 | # firejail executable | 185 | # firejail executable |
183 | install -m 0755 -d $(DESTDIR)$(bindir) | 186 | install -m 0755 -d $(DESTDIR)$(bindir) |
@@ -261,13 +264,16 @@ endif | |||
261 | install -m 0755 -d $(DESTDIR)$(datarootdir)/zsh/site-functions | 264 | install -m 0755 -d $(DESTDIR)$(datarootdir)/zsh/site-functions |
262 | install -m 0644 src/zsh_completion/_firejail $(DESTDIR)$(datarootdir)/zsh/site-functions/ | 265 | install -m 0644 src/zsh_completion/_firejail $(DESTDIR)$(datarootdir)/zsh/site-functions/ |
263 | 266 | ||
267 | .PHONY: install | ||
264 | install: all | 268 | install: all |
265 | $(MAKE) realinstall | 269 | $(MAKE) realinstall |
266 | 270 | ||
271 | .PHONY: install-strip | ||
267 | install-strip: all | 272 | install-strip: all |
268 | strip $(ALL_ITEMS) | 273 | strip $(ALL_ITEMS) |
269 | $(MAKE) realinstall | 274 | $(MAKE) realinstall |
270 | 275 | ||
276 | .PHONY: uninstall | ||
271 | uninstall: config.mk | 277 | uninstall: config.mk |
272 | rm -f $(DESTDIR)$(bindir)/firejail | 278 | rm -f $(DESTDIR)$(bindir)/firejail |
273 | rm -f $(DESTDIR)$(bindir)/firemon | 279 | rm -f $(DESTDIR)$(bindir)/firemon |
@@ -309,6 +315,7 @@ src | |||
309 | 315 | ||
310 | DISTFILES_TEST = test/Makefile test/apps test/apps-x11 test/apps-x11-xorg test/root test/private-lib test/fnetfilter test/fcopy test/environment test/profiles test/utils test/compile test/filters test/network test/fs test/sysutils test/chroot | 316 | DISTFILES_TEST = test/Makefile test/apps test/apps-x11 test/apps-x11-xorg test/root test/private-lib test/fnetfilter test/fcopy test/environment test/profiles test/utils test/compile test/filters test/network test/fs test/sysutils test/chroot |
311 | 317 | ||
318 | .PHONY: dist | ||
312 | dist: config.mk | 319 | dist: config.mk |
313 | mv config.sh config.sh.old | 320 | mv config.sh config.sh.old |
314 | mv config.status config.status.old | 321 | mv config.status config.status.old |
@@ -324,15 +331,19 @@ dist: config.mk | |||
324 | tar -cJvf $(TARNAME)-$(VERSION).tar.xz $(TARNAME)-$(VERSION) | 331 | tar -cJvf $(TARNAME)-$(VERSION).tar.xz $(TARNAME)-$(VERSION) |
325 | rm -fr $(TARNAME)-$(VERSION) | 332 | rm -fr $(TARNAME)-$(VERSION) |
326 | 333 | ||
334 | .PHONY: asc | ||
327 | asc: config.mk | 335 | asc: config.mk |
328 | ./mkasc.sh $(VERSION) | 336 | ./mkasc.sh $(VERSION) |
329 | 337 | ||
338 | .PHONY: deb | ||
330 | deb: dist config.sh | 339 | deb: dist config.sh |
331 | ./mkdeb.sh | 340 | ./mkdeb.sh |
332 | 341 | ||
342 | .PHONY: deb-apparmor | ||
333 | deb-apparmor: dist config.sh | 343 | deb-apparmor: dist config.sh |
334 | ./mkdeb.sh -apparmor --enable-apparmor | 344 | ./mkdeb.sh -apparmor --enable-apparmor |
335 | 345 | ||
346 | .PHONY: test-compile | ||
336 | test-compile: dist config.mk | 347 | test-compile: dist config.mk |
337 | cd test/compile; ./compile.sh $(TARNAME)-$(VERSION) | 348 | cd test/compile; ./compile.sh $(TARNAME)-$(VERSION) |
338 | 349 | ||
@@ -340,12 +351,15 @@ test-compile: dist config.mk | |||
340 | rpms: src/man config.mk | 351 | rpms: src/man config.mk |
341 | ./platform/rpm/mkrpm.sh $(TARNAME) $(VERSION) | 352 | ./platform/rpm/mkrpm.sh $(TARNAME) $(VERSION) |
342 | 353 | ||
354 | .PHONY: extras | ||
343 | extras: all | 355 | extras: all |
344 | $(MAKE) -C extras/firetools | 356 | $(MAKE) -C extras/firetools |
345 | 357 | ||
358 | .PHONY: cppcheck | ||
346 | cppcheck: clean | 359 | cppcheck: clean |
347 | cppcheck --force --error-exitcode=1 --enable=warning,performance . | 360 | cppcheck --force --error-exitcode=1 --enable=warning,performance . |
348 | 361 | ||
362 | .PHONY: scan-build | ||
349 | scan-build: clean | 363 | scan-build: clean |
350 | NO_EXTRA_CFLAGS="yes" scan-build make | 364 | NO_EXTRA_CFLAGS="yes" scan-build make |
351 | 365 | ||