Skip to content

Commit

Permalink
makefiles: stop failing when config.mk does not exist
Browse files Browse the repository at this point in the history
This allows running `make clean` and `make distclean` (and possibly
others) without having to run ./configure beforehand.

Note that some packaging-related targets still depend on the existence
of generated files.  For example:

* dist: config.mk
* deb: config.sh

Commands used to search and replace:

    $ git grep -Elz 'include *([^ ]*/)?config.mk' | xargs -0 -I '{}' \
      sh -c "printf '%s\n' \
      \"\$(sed -E 's|^include *(([^ ]*/)?config.mk)|-include \1|' '{}')\" >'{}'"

Relates to netblue30#5140.
  • Loading branch information
kmk3 committed Jun 25, 2022
1 parent d8a3fd7 commit 8fc2c6d
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include config.mk
-include config.mk

ifneq ($(HAVE_MAN),no)
MAN_TARGET = man
Expand Down
2 changes: 1 addition & 1 deletion src/bash_completion/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
all: firejail.bash_completion

ROOT = ../..
include $(ROOT)/config.mk
-include $(ROOT)/config.mk

firejail.bash_completion: firejail.bash_completion.in
gawk -f ../man/preproc.awk -- $(MANFLAGS) < $< > $@.tmp
Expand Down
2 changes: 1 addition & 1 deletion src/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Note: "ROOT" must be defined before including this file.

include $(ROOT)/config.mk
-include $(ROOT)/config.mk

H_FILE_LIST = $(sort $(wildcard *.h))
C_FILE_LIST = $(sort $(wildcard *.c))
Expand Down
2 changes: 1 addition & 1 deletion src/libpostexecseccomp/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ROOT = ../..
include $(ROOT)/config.mk
-include $(ROOT)/config.mk

H_FILE_LIST = $(sort $(wildcard *.h))
C_FILE_LIST = $(sort $(wildcard *.c))
Expand Down
2 changes: 1 addition & 1 deletion src/libtrace/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ROOT = ../..
include $(ROOT)/config.mk
-include $(ROOT)/config.mk

H_FILE_LIST = $(sort $(wildcard *.h))
C_FILE_LIST = $(sort $(wildcard *.c))
Expand Down
2 changes: 1 addition & 1 deletion src/libtracelog/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ROOT = ../..
include $(ROOT)/config.mk
-include $(ROOT)/config.mk

H_FILE_LIST = $(sort $(wildcard *.h))
C_FILE_LIST = $(sort $(wildcard *.c))
Expand Down
2 changes: 1 addition & 1 deletion src/man/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
all: firecfg.man firejail.man firejail-login.man firejail-users.man firejail-profile.man firemon.man jailcheck.man

ROOT = ../..
include $(ROOT)/config.mk
-include $(ROOT)/config.mk

%.man: %.txt
gawk -f ./preproc.awk -- $(MANFLAGS) < $< > $@
Expand Down
2 changes: 1 addition & 1 deletion src/zsh_completion/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
all: _firejail

ROOT = ../..
include $(ROOT)/config.mk
-include $(ROOT)/config.mk

_firejail: _firejail.in
gawk -f ../man/preproc.awk -- $(MANFLAGS) < $< > $@.tmp
Expand Down

0 comments on commit 8fc2c6d

Please sign in to comment.