diff --git a/Makefile b/Makefile index 12d0d57a58..575c3882ba 100644 --- a/Makefile +++ b/Makefile @@ -2,12 +2,19 @@ ROOT = . -include config.mk -# Default programs +# Default programs (in configure.ac). CC ?= cc CODESPELL ?= codespell CPPCHECK ?= cppcheck GAWK ?= gawk +GZIP ?= gzip SCAN_BUILD ?= scan-build +STRIP ?= strip +TAR ?= tar + +# Default programs (not in configure.ac). +INSTALL ?= install +RM ?= rm -f ifneq ($(HAVE_MAN),no) MAN_TARGET = man @@ -71,7 +78,7 @@ $(MYDIRS): .PHONY: strip strip: all - strip $(ALL_ITEMS) + $(STRIP) $(ALL_ITEMS) .PHONY: filters filters: $(SECCOMP_FILTERS) @@ -183,115 +190,115 @@ clean: done $(MAKE) -C src/man clean $(MAKE) -C test clean - rm -f $(SECCOMP_FILTERS) - rm -f $(SYNTAX_FILES) - rm -fr ./$(TARNAME)-$(VERSION) ./$(TARNAME)-$(VERSION).tar.xz - rm -f ./$(TARNAME)*.deb - rm -f ./$(TARNAME)*.rpm + $(RM) $(SECCOMP_FILTERS) + $(RM) $(SYNTAX_FILES) + $(RM) -r ./$(TARNAME)-$(VERSION) ./$(TARNAME)-$(VERSION).tar.xz + $(RM) ./$(TARNAME)*.deb + $(RM) ./$(TARNAME)*.rpm .PHONY: distclean distclean: clean - rm -fr autom4te.cache config.log config.mk config.sh config.status + $(RM) -r autom4te.cache config.log config.mk config.sh config.status .PHONY: install install: all config.mk # firejail executable - install -m 0755 -d $(DESTDIR)$(bindir) - install -m 0755 src/firejail/firejail $(DESTDIR)$(bindir) + $(INSTALL) -m 0755 -d $(DESTDIR)$(bindir) + $(INSTALL) -m 0755 src/firejail/firejail $(DESTDIR)$(bindir) ifeq ($(HAVE_SUID),-DHAVE_SUID) chmod u+s $(DESTDIR)$(bindir)/firejail endif # firemon executable - install -m 0755 src/firemon/firemon $(DESTDIR)$(bindir) + $(INSTALL) -m 0755 src/firemon/firemon $(DESTDIR)$(bindir) # firecfg executable - install -m 0755 src/firecfg/firecfg $(DESTDIR)$(bindir) + $(INSTALL) -m 0755 src/firecfg/firecfg $(DESTDIR)$(bindir) # jailcheck executable - install -m 0755 src/jailcheck/jailcheck $(DESTDIR)$(bindir) + $(INSTALL) -m 0755 src/jailcheck/jailcheck $(DESTDIR)$(bindir) # libraries and plugins - install -m 0755 -d $(DESTDIR)$(libdir)/firejail - install -m 0755 -t $(DESTDIR)$(libdir)/firejail src/firecfg/firejail-welcome.sh - install -m 0644 -t $(DESTDIR)$(libdir)/firejail $(MYLIBS) $(SECCOMP_FILTERS) - install -m 0755 -t $(DESTDIR)$(libdir)/firejail $(SBOX_APPS) - install -m 0755 -t $(DESTDIR)$(libdir)/firejail src/profstats/profstats - install -m 0755 -t $(DESTDIR)$(libdir)/firejail src/etc-cleanup/etc-cleanup + $(INSTALL) -m 0755 -d $(DESTDIR)$(libdir)/firejail + $(INSTALL) -m 0755 -t $(DESTDIR)$(libdir)/firejail src/firecfg/firejail-welcome.sh + $(INSTALL) -m 0644 -t $(DESTDIR)$(libdir)/firejail $(MYLIBS) $(SECCOMP_FILTERS) + $(INSTALL) -m 0755 -t $(DESTDIR)$(libdir)/firejail $(SBOX_APPS) + $(INSTALL) -m 0755 -t $(DESTDIR)$(libdir)/firejail src/profstats/profstats + $(INSTALL) -m 0755 -t $(DESTDIR)$(libdir)/firejail src/etc-cleanup/etc-cleanup # plugins w/o read permission (non-dumpable) - install -m 0711 -t $(DESTDIR)$(libdir)/firejail $(SBOX_APPS_NON_DUMPABLE) - install -m 0711 -t $(DESTDIR)$(libdir)/firejail src/fshaper/fshaper.sh - install -m 0644 -t $(DESTDIR)$(libdir)/firejail src/fnettrace/static-ip-map + $(INSTALL) -m 0711 -t $(DESTDIR)$(libdir)/firejail $(SBOX_APPS_NON_DUMPABLE) + $(INSTALL) -m 0711 -t $(DESTDIR)$(libdir)/firejail src/fshaper/fshaper.sh + $(INSTALL) -m 0644 -t $(DESTDIR)$(libdir)/firejail src/fnettrace/static-ip-map ifeq ($(HAVE_CONTRIB_INSTALL),yes) # contrib scripts - install -m 0755 -t $(DESTDIR)$(libdir)/firejail contrib/*.py contrib/*.sh + $(INSTALL) -m 0755 -t $(DESTDIR)$(libdir)/firejail contrib/*.py contrib/*.sh # vim syntax - install -m 0755 -d $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect - install -m 0755 -d $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax - install -m 0644 contrib/vim/ftdetect/firejail.vim $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect - install -m 0644 contrib/syntax/files/firejail.vim $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax + $(INSTALL) -m 0755 -d $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect + $(INSTALL) -m 0755 -d $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax + $(INSTALL) -m 0644 contrib/vim/ftdetect/firejail.vim $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect + $(INSTALL) -m 0644 contrib/syntax/files/firejail.vim $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax # gtksourceview language-specs - install -m 0755 -d $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs - install -m 0644 contrib/syntax/files/firejail-profile.lang $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs + $(INSTALL) -m 0755 -d $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs + $(INSTALL) -m 0644 contrib/syntax/files/firejail-profile.lang $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs endif # documents - install -m 0755 -d $(DESTDIR)$(docdir) - install -m 0644 -t $(DESTDIR)$(docdir) COPYING README RELNOTES etc/templates/* + $(INSTALL) -m 0755 -d $(DESTDIR)$(docdir) + $(INSTALL) -m 0644 -t $(DESTDIR)$(docdir) COPYING README RELNOTES etc/templates/* # profiles and settings - install -m 0755 -d $(DESTDIR)$(sysconfdir)/firejail - install -m 0755 -d $(DESTDIR)$(sysconfdir)/firejail/firecfg.d - install -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail src/firecfg/firecfg.config - install -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail etc/profile-a-l/*.profile etc/profile-m-z/*.profile etc/inc/*.inc etc/net/*.net etc/firejail.config - sh -c "if [ ! -f $(DESTDIR)/$(sysconfdir)/firejail/login.users ]; then install -c -m 0644 etc/login.users $(DESTDIR)/$(sysconfdir)/firejail/.; fi;" + $(INSTALL) -m 0755 -d $(DESTDIR)$(sysconfdir)/firejail + $(INSTALL) -m 0755 -d $(DESTDIR)$(sysconfdir)/firejail/firecfg.d + $(INSTALL) -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail src/firecfg/firecfg.config + $(INSTALL) -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail etc/profile-a-l/*.profile etc/profile-m-z/*.profile etc/inc/*.inc etc/net/*.net etc/firejail.config + sh -c "if [ ! -f $(DESTDIR)/$(sysconfdir)/firejail/login.users ]; then $(INSTALL) -c -m 0644 etc/login.users $(DESTDIR)/$(sysconfdir)/firejail/.; fi;" ifeq ($(HAVE_IDS),-DHAVE_IDS) - install -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail etc/ids.config + $(INSTALL) -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail etc/ids.config endif ifeq ($(BUSYBOX_WORKAROUND),yes) ./mketc.sh $(DESTDIR)$(sysconfdir)/firejail/disable-common.inc endif ifeq ($(HAVE_APPARMOR),-DHAVE_APPARMOR) # install apparmor profile - sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d ]; then install -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d; fi;" - install -m 0644 etc/apparmor/firejail-default $(DESTDIR)$(sysconfdir)/apparmor.d + sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d ]; then $(INSTALL) -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d; fi;" + $(INSTALL) -m 0644 etc/apparmor/firejail-default $(DESTDIR)$(sysconfdir)/apparmor.d # install apparmor profile customization file - sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d/local ]; then install -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d/local; fi;" - sh -c "if [ ! -f $(DESTDIR)/$(sysconfdir)/apparmor.d/local/firejail-default ]; then install -c -m 0644 etc/apparmor/firejail-local $(DESTDIR)/$(sysconfdir)/apparmor.d/local/firejail-default; fi;" + sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d/local ]; then $(INSTALL) -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d/local; fi;" + sh -c "if [ ! -f $(DESTDIR)/$(sysconfdir)/apparmor.d/local/firejail-default ]; then $(INSTALL) -c -m 0644 etc/apparmor/firejail-local $(DESTDIR)/$(sysconfdir)/apparmor.d/local/firejail-default; fi;" # install apparmor base abstraction drop-in - sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions ]; then install -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions; fi;" - sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions/base.d ]; then install -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions/base.d; fi;" - install -m 0644 etc/apparmor/firejail-base $(DESTDIR)$(sysconfdir)/apparmor.d/abstractions/base.d + sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions ]; then $(INSTALL) -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions; fi;" + sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions/base.d ]; then $(INSTALL) -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d/abstractions/base.d; fi;" + $(INSTALL) -m 0644 etc/apparmor/firejail-base $(DESTDIR)$(sysconfdir)/apparmor.d/abstractions/base.d endif ifneq ($(HAVE_MAN),no) # man pages - install -m 0755 -d $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 - install -m 0644 $(MANPAGES1_GZ) $(DESTDIR)$(mandir)/man1/ - install -m 0644 $(MANPAGES5_GZ) $(DESTDIR)$(mandir)/man5/ + $(INSTALL) -m 0755 -d $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 + $(INSTALL) -m 0644 $(MANPAGES1_GZ) $(DESTDIR)$(mandir)/man1/ + $(INSTALL) -m 0644 $(MANPAGES5_GZ) $(DESTDIR)$(mandir)/man5/ endif # bash completion - install -m 0755 -d $(DESTDIR)$(datarootdir)/bash-completion/completions - install -m 0644 src/bash_completion/firejail.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firejail - install -m 0644 src/bash_completion/firemon.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firemon - install -m 0644 src/bash_completion/firecfg.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firecfg + $(INSTALL) -m 0755 -d $(DESTDIR)$(datarootdir)/bash-completion/completions + $(INSTALL) -m 0644 src/bash_completion/firejail.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firejail + $(INSTALL) -m 0644 src/bash_completion/firemon.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firemon + $(INSTALL) -m 0644 src/bash_completion/firecfg.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firecfg # zsh completion - install -m 0755 -d $(DESTDIR)$(datarootdir)/zsh/site-functions - install -m 0644 src/zsh_completion/_firejail $(DESTDIR)$(datarootdir)/zsh/site-functions/ + $(INSTALL) -m 0755 -d $(DESTDIR)$(datarootdir)/zsh/site-functions + $(INSTALL) -m 0644 src/zsh_completion/_firejail $(DESTDIR)$(datarootdir)/zsh/site-functions/ .PHONY: install-strip install-strip: strip install .PHONY: uninstall uninstall: config.mk - rm -f $(DESTDIR)$(bindir)/firejail - rm -f $(DESTDIR)$(bindir)/firemon - rm -f $(DESTDIR)$(bindir)/firecfg - rm -f $(DESTDIR)$(bindir)/jailcheck - rm -fr $(DESTDIR)$(libdir)/firejail - rm -fr $(DESTDIR)$(datarootdir)/doc/firejail - rm -f $(addprefix $(DESTDIR)$(mandir)/man1/,$(notdir $(MANPAGES1_GZ))) - rm -f $(addprefix $(DESTDIR)$(mandir)/man5/,$(notdir $(MANPAGES5_GZ))) - rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/firejail - rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/firemon - rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/firecfg - rm -f $(DESTDIR)$(datarootdir)/zsh/site-functions/_firejail - rm -f $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect/firejail.vim - rm -f $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax/firejail.vim - rm -f $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs/firejail-profile.lang + $(RM) $(DESTDIR)$(bindir)/firejail + $(RM) $(DESTDIR)$(bindir)/firemon + $(RM) $(DESTDIR)$(bindir)/firecfg + $(RM) $(DESTDIR)$(bindir)/jailcheck + $(RM) -r $(DESTDIR)$(libdir)/firejail + $(RM) -r $(DESTDIR)$(datarootdir)/doc/firejail + $(RM) $(addprefix $(DESTDIR)$(mandir)/man1/,$(notdir $(MANPAGES1_GZ))) + $(RM) $(addprefix $(DESTDIR)$(mandir)/man5/,$(notdir $(MANPAGES5_GZ))) + $(RM) $(DESTDIR)$(datarootdir)/bash-completion/completions/firejail + $(RM) $(DESTDIR)$(datarootdir)/bash-completion/completions/firemon + $(RM) $(DESTDIR)$(datarootdir)/bash-completion/completions/firecfg + $(RM) $(DESTDIR)$(datarootdir)/zsh/site-functions/_firejail + $(RM) $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect/firejail.vim + $(RM) $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax/firejail.vim + $(RM) $(DESTDIR)$(datarootdir)/gtksourceview-5/language-specs/firejail-profile.lang @echo "If you want to install a different version of firejail, you might also need to run 'rm -fr $(DESTDIR)$(sysconfdir)/firejail', see #2038." # Note: Keep this list in sync with `paths` in .github/workflows/build.yml. @@ -336,9 +343,9 @@ dist: clean config.mk mkdir -p $(TARNAME)-$(VERSION)/test cp -a $(DISTFILES) $(TARNAME)-$(VERSION) cp -a $(DISTFILES_TEST) $(TARNAME)-$(VERSION)/test - rm -rf $(TARNAME)-$(VERSION)/src/tools - tar -cJvf $(TARNAME)-$(VERSION).tar.xz $(TARNAME)-$(VERSION) - rm -fr $(TARNAME)-$(VERSION) + $(RM) -r $(TARNAME)-$(VERSION)/src/tools + $(TAR) -cJvf $(TARNAME)-$(VERSION).tar.xz $(TARNAME)-$(VERSION) + $(RM) -r $(TARNAME)-$(VERSION) .PHONY: asc asc: config.sh diff --git a/config.mk.in b/config.mk.in index a7f66fbb52..812573a148 100644 --- a/config.mk.in +++ b/config.mk.in @@ -78,7 +78,10 @@ CC=@CC@ CODESPELL=@CODESPELL@ CPPCHECK=@CPPCHECK@ GAWK=@GAWK@ +GZIP=@GZIP@ SCAN_BUILD=@SCAN_BUILD@ +STRIP=@STRIP@ +TAR=@TAR@ CFLAGS=@CFLAGS@ CPPFLAGS=@CPPFLAGS@ diff --git a/configure b/configure index 348c02cbbb..00c1a89bf5 100755 --- a/configure +++ b/configure @@ -682,7 +682,10 @@ PKG_CONFIG HAVE_APPARMOR HAVE_IDS DEPS_CFLAGS +TAR +STRIP SCAN_BUILD +GZIP GAWK CPPCHECK CODESPELL @@ -3414,6 +3417,53 @@ fi test -n "$GAWK" && break done +for ac_prog in gzip +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_GZIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$GZIP"; then + ac_cv_prog_GZIP="$GZIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_GZIP="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GZIP=$ac_cv_prog_GZIP +if test -n "$GZIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GZIP" >&5 +printf "%s\n" "$GZIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$GZIP" && break +done + for ac_prog in scan-build do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -3461,6 +3511,100 @@ fi test -n "$SCAN_BUILD" && break done +for ac_prog in strip +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$STRIP" && break +done + +for ac_prog in tar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_TAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$TAR"; then + ac_cv_prog_TAR="$TAR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_TAR="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +TAR=$ac_cv_prog_TAR +if test -n "$TAR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5 +printf "%s\n" "$TAR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$TAR" && break +done + DEPS_CFLAGS="" diff --git a/configure.ac b/configure.ac index 73bd334f8f..3701b7b4cf 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,10 @@ AC_PROG_CC AC_CHECK_PROGS([CODESPELL], [codespell]) AC_CHECK_PROGS([CPPCHECK], [cppcheck]) AC_CHECK_PROGS([GAWK], [gawk]) +AC_CHECK_PROGS([GZIP], [gzip]) AC_CHECK_PROGS([SCAN_BUILD], [scan-build]) +AC_CHECK_PROGS([STRIP], [strip]) +AC_CHECK_PROGS([TAR], [tar]) DEPS_CFLAGS="" AC_SUBST([DEPS_CFLAGS]) diff --git a/src/bash_completion/Makefile b/src/bash_completion/Makefile index 91a1be0bc0..c06323f64e 100644 --- a/src/bash_completion/Makefile +++ b/src/bash_completion/Makefile @@ -3,6 +3,7 @@ ROOT = ../.. -include $(ROOT)/config.mk GAWK ?= gawk +RM ?= rm -f .PHONY: all all: firejail.bash_completion @@ -10,8 +11,8 @@ all: firejail.bash_completion firejail.bash_completion: firejail.bash_completion.in $(ROOT)/config.mk $(GAWK) -f ../man/preproc.awk -- $(MANFLAGS) < $< > $@.tmp sed "s|_SYSCONFDIR_|$(sysconfdir)|" < $@.tmp > $@ - rm $@.tmp + $(RM) $@.tmp .PHONY: clean clean: - rm -fr firejail.bash_completion + $(RM) -r firejail.bash_completion diff --git a/src/man/Makefile b/src/man/Makefile index 682aadaad0..767920e2be 100644 --- a/src/man/Makefile +++ b/src/man/Makefile @@ -3,6 +3,8 @@ ROOT = ../.. -include $(ROOT)/config.mk GAWK ?= gawk +GZIP ?= gzip +RM ?= rm -f MOD_DIR := $(ROOT)/src/man MANPAGES_IN := $(sort $(wildcard $(MOD_DIR)/*.in)) @@ -21,8 +23,8 @@ $(MOD_DIR)/%: $(MOD_DIR)/%.in $(ROOT)/config.mk # foo.1.gz: foo.1 $(MOD_DIR)/%.gz: $(MOD_DIR)/% @printf 'Generating %s from %s\n' $@ $< - @rm -f $@ - @gzip -n9 $< + @$(RM) $@ + @$(GZIP) -n9 $< .PHONY: clean -clean:; rm -f *.1 *.5 *.gz +clean:; $(RM) *.1 *.5 *.gz diff --git a/src/prog.mk b/src/prog.mk index 4f9309d8ca..3e89a6ba80 100644 --- a/src/prog.mk +++ b/src/prog.mk @@ -6,6 +6,7 @@ # define EXTRA_OBJS and extend CLEANFILES. CC ?= cc +RM ?= rm -f HDRS := SRCS := $(sort $(wildcard $(MOD_DIR)/*.c)) @@ -27,4 +28,4 @@ $(PROG): $(OBJS) $(EXTRA_OBJS) $(ROOT)/config.mk $(CC) $(PROG_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRA_OBJS) $(LIBS) .PHONY: clean -clean:; rm -fr $(PROG) $(CLEANFILES) +clean:; $(RM) -r $(PROG) $(CLEANFILES) diff --git a/src/so.mk b/src/so.mk index cb1f08b08b..63a0da7ce3 100644 --- a/src/so.mk +++ b/src/so.mk @@ -6,6 +6,7 @@ # EXTRA_OBJS and extend CLEANFILES. CC ?= cc +RM ?= rm -f HDRS := SRCS := $(sort $(wildcard $(MOD_DIR)/*.c)) @@ -27,4 +28,4 @@ $(SO): $(OBJS) $(EXTRA_OBJS) $(ROOT)/config.mk $(CC) $(SO_LDFLAGS) -shared $(LDFLAGS) -o $@ $(OBJS) $(EXTRA_OBJS) -ldl .PHONY: clean -clean:; rm -fr $(SO) $(CLEANFILES) +clean:; $(RM) -r $(SO) $(CLEANFILES) diff --git a/src/zsh_completion/Makefile b/src/zsh_completion/Makefile index 80c8b1608d..29da58236c 100644 --- a/src/zsh_completion/Makefile +++ b/src/zsh_completion/Makefile @@ -3,6 +3,7 @@ ROOT = ../.. -include $(ROOT)/config.mk GAWK ?= gawk +RM ?= rm -f .PHONY: all all: _firejail @@ -10,8 +11,8 @@ all: _firejail _firejail: _firejail.in $(ROOT)/config.mk $(GAWK) -f ../man/preproc.awk -- $(MANFLAGS) < $< > $@.tmp sed "s|_SYSCONFDIR_|$(sysconfdir)|" < $@.tmp > $@ - rm $@.tmp + $(RM) $@.tmp .PHONY: clean clean: - rm -fr _firejail + $(RM) -r firejail.bash_completion diff --git a/test/Makefile b/test/Makefile index 52fada86c4..89855d0829 100644 --- a/test/Makefile +++ b/test/Makefile @@ -2,6 +2,8 @@ ROOT = .. -include $(ROOT)/config.mk +RM ?= rm -f + TESTS=$(patsubst %/,%,$(wildcard */)) .PHONY: $(TESTS) @@ -11,14 +13,14 @@ $(TESTS): .PHONY: clean clean: - for test in $(TESTS); do rm -f "$$test/$$test.log"; done - rm -fr environment/-testdir - rm -f environment/index.html* - rm -f environment/logfile* - rm -f environment/wget-log* - rm -f sysutils/firejail_t* - rm -f utils/firejail-test-file* - rm -f utils/index.html* - rm -f utils/lstesting - rm -f utils/wget-log + for test in $(TESTS); do $(RM) "$$test/$$test.log"; done + $(RM) -r environment/-testdir + $(RM) environment/index.html* + $(RM) environment/logfile* + $(RM) environment/wget-log* + $(RM) sysutils/firejail_t* + $(RM) utils/firejail-test-file* + $(RM) utils/index.html* + $(RM) utils/lstesting + $(RM) utils/wget-log cd compile && (./compile.sh --clean || true)