diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | config.mk.in | 7 | ||||
-rwxr-xr-x | configure | 47 | ||||
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | src/etc-cleanup/Makefile | 2 | ||||
-rw-r--r-- | src/fbuilder/Makefile | 2 | ||||
-rw-r--r-- | src/fcopy/Makefile | 1 | ||||
-rw-r--r-- | src/fids/Makefile | 2 | ||||
-rw-r--r-- | src/firecfg/Makefile | 7 | ||||
-rw-r--r-- | src/firejail/Makefile | 13 | ||||
-rw-r--r-- | src/firemon/Makefile | 1 | ||||
-rw-r--r-- | src/fldd/Makefile | 1 | ||||
-rw-r--r-- | src/fnet/Makefile | 1 | ||||
-rw-r--r-- | src/fnetfilter/Makefile | 1 | ||||
-rw-r--r-- | src/fsec-optimize/Makefile | 1 | ||||
-rw-r--r-- | src/fsec-print/Makefile | 1 | ||||
-rw-r--r-- | src/fseccomp/Makefile | 1 | ||||
-rw-r--r-- | src/fzenity/Makefile | 2 | ||||
-rw-r--r-- | src/jailcheck/Makefile | 1 | ||||
-rw-r--r-- | src/libpostexecseccomp/Makefile | 2 | ||||
-rw-r--r-- | src/libtracelog/Makefile | 2 | ||||
-rw-r--r-- | src/profstats/Makefile | 2 | ||||
-rw-r--r-- | src/prog.mk | 16 | ||||
-rw-r--r-- | src/so.mk | 16 |
24 files changed, 81 insertions, 56 deletions
diff --git a/.gitignore b/.gitignore index fd35dde40..3413abd55 100644 --- a/.gitignore +++ b/.gitignore | |||
@@ -1,3 +1,4 @@ | |||
1 | *.d | ||
1 | *.o | 2 | *.o |
2 | *.so | 3 | *.so |
3 | *~ | 4 | *~ |
diff --git a/config.mk.in b/config.mk.in index 63d7fb981..1521a2633 100644 --- a/config.mk.in +++ b/config.mk.in | |||
@@ -81,6 +81,7 @@ LDFLAGS=@LDFLAGS@ | |||
81 | 81 | ||
82 | # Project variables | 82 | # Project variables |
83 | EXTRA_CFLAGS =@EXTRA_CFLAGS@ | 83 | EXTRA_CFLAGS =@EXTRA_CFLAGS@ |
84 | DEPS_CFLAGS =@DEPS_CFLAGS@ | ||
84 | COMMON_CFLAGS = \ | 85 | COMMON_CFLAGS = \ |
85 | -ggdb -O2 -DVERSION='"$(VERSION)"' \ | 86 | -ggdb -O2 -DVERSION='"$(VERSION)"' \ |
86 | -Wall -Wextra $(HAVE_FATAL_WARNINGS) \ | 87 | -Wall -Wextra $(HAVE_FATAL_WARNINGS) \ |
@@ -88,16 +89,18 @@ COMMON_CFLAGS = \ | |||
88 | -fstack-protector-all -D_FORTIFY_SOURCE=2 \ | 89 | -fstack-protector-all -D_FORTIFY_SOURCE=2 \ |
89 | -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' \ | 90 | -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' \ |
90 | -DLIBDIR='"$(libdir)"' -DBINDIR='"$(bindir)"' \ | 91 | -DLIBDIR='"$(libdir)"' -DBINDIR='"$(bindir)"' \ |
91 | -DVARDIR='"/var/lib/firejail"' \ | 92 | -DVARDIR='"/var/lib/firejail"' |
92 | 93 | ||
93 | PROG_CFLAGS = \ | 94 | PROG_CFLAGS = \ |
94 | $(COMMON_CFLAGS) \ | 95 | $(COMMON_CFLAGS) \ |
95 | $(HAVE_GCOV) $(MANFLAGS) \ | 96 | $(HAVE_GCOV) $(MANFLAGS) \ |
96 | $(EXTRA_CFLAGS) \ | 97 | $(EXTRA_CFLAGS) \ |
98 | $(DEPS_CFLAGS) \ | ||
97 | -fPIE | 99 | -fPIE |
98 | 100 | ||
99 | SO_CFLAGS = \ | 101 | SO_CFLAGS = \ |
100 | $(COMMON_CFLAGS) \ | 102 | $(COMMON_CFLAGS) \ |
103 | $(DEPS_CFLAGS) \ | ||
101 | -fPIC | 104 | -fPIC |
102 | 105 | ||
103 | EXTRA_LDFLAGS =@EXTRA_LDFLAGS@ | 106 | EXTRA_LDFLAGS =@EXTRA_LDFLAGS@ |
@@ -105,4 +108,4 @@ PROG_LDFLAGS = -Wl,-z,relro -Wl,-z,now -fPIE -pie $(EXTRA_LDFLAGS) | |||
105 | SO_LDFLAGS = -Wl,-z,relro -Wl,-z,now -fPIC | 108 | SO_LDFLAGS = -Wl,-z,relro -Wl,-z,now -fPIC |
106 | LIBS =@LIBS@ | 109 | LIBS =@LIBS@ |
107 | 110 | ||
108 | CLEANFILES = *.o *.gcov *.gcda *.gcno *.plist | 111 | CLEANFILES = *.d *.o *.gcov *.gcda *.gcno *.plist |
@@ -682,6 +682,7 @@ PKG_CONFIG_PATH | |||
682 | PKG_CONFIG | 682 | PKG_CONFIG |
683 | HAVE_APPARMOR | 683 | HAVE_APPARMOR |
684 | HAVE_IDS | 684 | HAVE_IDS |
685 | DEPS_CFLAGS | ||
685 | OBJEXT | 686 | OBJEXT |
686 | EXEEXT | 687 | EXEEXT |
687 | ac_ct_CC | 688 | ac_ct_CC |
@@ -3270,8 +3271,51 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ | |||
3270 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | 3271 | ac_compiler_gnu=$ac_cv_c_compiler_gnu |
3271 | 3272 | ||
3272 | 3273 | ||
3273 | HAVE_SPECTRE="no" | 3274 | DEPS_CFLAGS="" |
3275 | |||
3276 | |||
3277 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -MMD -MP" >&5 | ||
3278 | printf %s "checking whether C compiler accepts -MMD -MP... " >&6; } | ||
3279 | if test ${ax_cv_check_cflags___MMD__MP+y} | ||
3280 | then : | ||
3281 | printf %s "(cached) " >&6 | ||
3282 | else $as_nop | ||
3283 | |||
3284 | ax_check_save_flags=$CFLAGS | ||
3285 | CFLAGS="$CFLAGS -MMD -MP" | ||
3286 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||
3287 | /* end confdefs.h. */ | ||
3288 | |||
3289 | int | ||
3290 | main (void) | ||
3291 | { | ||
3292 | |||
3293 | ; | ||
3294 | return 0; | ||
3295 | } | ||
3296 | _ACEOF | ||
3297 | if ac_fn_c_try_compile "$LINENO" | ||
3298 | then : | ||
3299 | ax_cv_check_cflags___MMD__MP=yes | ||
3300 | else $as_nop | ||
3301 | ax_cv_check_cflags___MMD__MP=no | ||
3302 | fi | ||
3303 | rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext | ||
3304 | CFLAGS=$ax_check_save_flags | ||
3305 | fi | ||
3306 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___MMD__MP" >&5 | ||
3307 | printf "%s\n" "$ax_cv_check_cflags___MMD__MP" >&6; } | ||
3308 | if test "x$ax_cv_check_cflags___MMD__MP" = xyes | ||
3309 | then : | ||
3310 | |||
3311 | DEPS_CFLAGS="$DEPS_CFLAGS -MMD -MP" | ||
3312 | |||
3313 | else $as_nop | ||
3314 | : | ||
3315 | fi | ||
3274 | 3316 | ||
3317 | |||
3318 | HAVE_SPECTRE="no" | ||
3275 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mindirect-branch=thunk" >&5 | 3319 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mindirect-branch=thunk" >&5 |
3276 | printf %s "checking whether C compiler accepts -mindirect-branch=thunk... " >&6; } | 3320 | printf %s "checking whether C compiler accepts -mindirect-branch=thunk... " >&6; } |
3277 | if test ${ax_cv_check_cflags___mindirect_branch_thunk+y} | 3321 | if test ${ax_cv_check_cflags___mindirect_branch_thunk+y} |
@@ -5311,6 +5355,7 @@ Compile options: | |||
5311 | CPPFLAGS: $CPPFLAGS | 5355 | CPPFLAGS: $CPPFLAGS |
5312 | LDFLAGS: $LDFLAGS | 5356 | LDFLAGS: $LDFLAGS |
5313 | EXTRA_CFLAGS: $EXTRA_CFLAGS | 5357 | EXTRA_CFLAGS: $EXTRA_CFLAGS |
5358 | DEPS_CFLAGS: $DEPS_CFLAGS | ||
5314 | EXTRA_LDFLAGS: $EXTRA_LDFLAGS | 5359 | EXTRA_LDFLAGS: $EXTRA_LDFLAGS |
5315 | LIBS: $LIBS | 5360 | LIBS: $LIBS |
5316 | fatal warnings: $HAVE_FATAL_WARNINGS | 5361 | fatal warnings: $HAVE_FATAL_WARNINGS |
diff --git a/configure.ac b/configure.ac index d3b05d839..7a2c379fe 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -20,6 +20,12 @@ AC_CONFIG_MACRO_DIR([m4]) | |||
20 | 20 | ||
21 | AC_PROG_CC | 21 | AC_PROG_CC |
22 | 22 | ||
23 | DEPS_CFLAGS="" | ||
24 | AC_SUBST([DEPS_CFLAGS]) | ||
25 | AX_CHECK_COMPILE_FLAG([-MMD -MP], [ | ||
26 | DEPS_CFLAGS="$DEPS_CFLAGS -MMD -MP" | ||
27 | ]) | ||
28 | |||
23 | HAVE_SPECTRE="no" | 29 | HAVE_SPECTRE="no" |
24 | AX_CHECK_COMPILE_FLAG([-mindirect-branch=thunk], [ | 30 | AX_CHECK_COMPILE_FLAG([-mindirect-branch=thunk], [ |
25 | HAVE_SPECTRE="yes" | 31 | HAVE_SPECTRE="yes" |
@@ -279,6 +285,7 @@ Compile options: | |||
279 | CPPFLAGS: $CPPFLAGS | 285 | CPPFLAGS: $CPPFLAGS |
280 | LDFLAGS: $LDFLAGS | 286 | LDFLAGS: $LDFLAGS |
281 | EXTRA_CFLAGS: $EXTRA_CFLAGS | 287 | EXTRA_CFLAGS: $EXTRA_CFLAGS |
288 | DEPS_CFLAGS: $DEPS_CFLAGS | ||
282 | EXTRA_LDFLAGS: $EXTRA_LDFLAGS | 289 | EXTRA_LDFLAGS: $EXTRA_LDFLAGS |
283 | LIBS: $LIBS | 290 | LIBS: $LIBS |
284 | fatal warnings: $HAVE_FATAL_WARNINGS | 291 | fatal warnings: $HAVE_FATAL_WARNINGS |
diff --git a/src/etc-cleanup/Makefile b/src/etc-cleanup/Makefile index 23121c521..d9dcdbea8 100644 --- a/src/etc-cleanup/Makefile +++ b/src/etc-cleanup/Makefile | |||
@@ -7,6 +7,4 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | PROG = $(MOD_DIR)/$(MOD) | 7 | PROG = $(MOD_DIR)/$(MOD) |
8 | TARGET = $(PROG) | 8 | TARGET = $(PROG) |
9 | 9 | ||
10 | EXTRA_HDRS = ../include/etc_groups.h | ||
11 | |||
12 | include $(ROOT)/src/prog.mk | 10 | include $(ROOT)/src/prog.mk |
diff --git a/src/fbuilder/Makefile b/src/fbuilder/Makefile index f0e374a52..70c5fb008 100644 --- a/src/fbuilder/Makefile +++ b/src/fbuilder/Makefile | |||
@@ -7,6 +7,4 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | PROG = $(MOD_DIR)/$(MOD) | 7 | PROG = $(MOD_DIR)/$(MOD) |
8 | TARGET = $(PROG) | 8 | TARGET = $(PROG) |
9 | 9 | ||
10 | EXTRA_HDRS = ../include/common.h ../include/syscall.h | ||
11 | |||
12 | include $(ROOT)/src/prog.mk | 10 | include $(ROOT)/src/prog.mk |
diff --git a/src/fcopy/Makefile b/src/fcopy/Makefile index a9f706eb8..4897980e7 100644 --- a/src/fcopy/Makefile +++ b/src/fcopy/Makefile | |||
@@ -7,7 +7,6 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | PROG = $(MOD_DIR)/$(MOD) | 7 | PROG = $(MOD_DIR)/$(MOD) |
8 | TARGET = $(PROG) | 8 | TARGET = $(PROG) |
9 | 9 | ||
10 | EXTRA_HDRS = ../include/common.h ../include/syscall.h | ||
11 | EXTRA_OBJS = ../lib/common.o | 10 | EXTRA_OBJS = ../lib/common.o |
12 | 11 | ||
13 | include $(ROOT)/src/prog.mk | 12 | include $(ROOT)/src/prog.mk |
diff --git a/src/fids/Makefile b/src/fids/Makefile index 7bdbe0590..dadb17a1b 100644 --- a/src/fids/Makefile +++ b/src/fids/Makefile | |||
@@ -7,6 +7,4 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | PROG = $(MOD_DIR)/$(MOD) | 7 | PROG = $(MOD_DIR)/$(MOD) |
8 | TARGET = $(PROG) | 8 | TARGET = $(PROG) |
9 | 9 | ||
10 | EXTRA_HDRS = ../include/common.h | ||
11 | |||
12 | include $(ROOT)/src/prog.mk | 10 | include $(ROOT)/src/prog.mk |
diff --git a/src/firecfg/Makefile b/src/firecfg/Makefile index cc7a27c52..6cbd1b5ba 100644 --- a/src/firecfg/Makefile +++ b/src/firecfg/Makefile | |||
@@ -7,13 +7,6 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | PROG = $(MOD_DIR)/$(MOD) | 7 | PROG = $(MOD_DIR)/$(MOD) |
8 | TARGET = $(PROG) | 8 | TARGET = $(PROG) |
9 | 9 | ||
10 | EXTRA_HDRS = \ | ||
11 | ../include/common.h \ | ||
12 | ../include/euid_common.h \ | ||
13 | ../include/libnetlink.h \ | ||
14 | ../include/firejail_user.h \ | ||
15 | ../include/pid.h | ||
16 | |||
17 | EXTRA_OBJS = ../lib/common.o ../lib/firejail_user.o | 10 | EXTRA_OBJS = ../lib/common.o ../lib/firejail_user.o |
18 | 11 | ||
19 | include $(ROOT)/src/prog.mk | 12 | include $(ROOT)/src/prog.mk |
diff --git a/src/firejail/Makefile b/src/firejail/Makefile index 1c4b1b5c2..e7b334cd8 100644 --- a/src/firejail/Makefile +++ b/src/firejail/Makefile | |||
@@ -7,19 +7,6 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | PROG = $(MOD_DIR)/$(MOD) | 7 | PROG = $(MOD_DIR)/$(MOD) |
8 | TARGET = $(PROG) | 8 | TARGET = $(PROG) |
9 | 9 | ||
10 | EXTRA_HDRS = \ | ||
11 | ../include/rundefs.h \ | ||
12 | ../include/common.h \ | ||
13 | ../include/ldd_utils.h \ | ||
14 | ../include/euid_common.h \ | ||
15 | ../include/pid.h \ | ||
16 | ../include/seccomp.h \ | ||
17 | ../include/syscall_i386.h \ | ||
18 | ../include/syscall_x86_64.h \ | ||
19 | ../include/firejail_user.h \ | ||
20 | ../include/etc_groups.h | ||
21 | |||
22 | |||
23 | EXTRA_OBJS = \ | 10 | EXTRA_OBJS = \ |
24 | ../lib/common.o \ | 11 | ../lib/common.o \ |
25 | ../lib/ldd_utils.o \ | 12 | ../lib/ldd_utils.o \ |
diff --git a/src/firemon/Makefile b/src/firemon/Makefile index 0e39f8b01..02e3b6eed 100644 --- a/src/firemon/Makefile +++ b/src/firemon/Makefile | |||
@@ -7,7 +7,6 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | PROG = $(MOD_DIR)/$(MOD) | 7 | PROG = $(MOD_DIR)/$(MOD) |
8 | TARGET = $(PROG) | 8 | TARGET = $(PROG) |
9 | 9 | ||
10 | EXTRA_HDRS = ../include/common.h ../include/pid.h | ||
11 | EXTRA_OBJS = ../lib/common.o ../lib/pid.o | 10 | EXTRA_OBJS = ../lib/common.o ../lib/pid.o |
12 | 11 | ||
13 | include $(ROOT)/src/prog.mk | 12 | include $(ROOT)/src/prog.mk |
diff --git a/src/fldd/Makefile b/src/fldd/Makefile index 246cbc183..3e48b43ab 100644 --- a/src/fldd/Makefile +++ b/src/fldd/Makefile | |||
@@ -7,7 +7,6 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | PROG = $(MOD_DIR)/$(MOD) | 7 | PROG = $(MOD_DIR)/$(MOD) |
8 | TARGET = $(PROG) | 8 | TARGET = $(PROG) |
9 | 9 | ||
10 | EXTRA_HDRS = ../include/common.h ../include/syscall.h ../include/ldd_utils.h | ||
11 | EXTRA_OBJS = ../lib/common.o ../lib/ldd_utils.o | 10 | EXTRA_OBJS = ../lib/common.o ../lib/ldd_utils.o |
12 | 11 | ||
13 | include $(ROOT)/src/prog.mk | 12 | include $(ROOT)/src/prog.mk |
diff --git a/src/fnet/Makefile b/src/fnet/Makefile index c98326dc4..dfeefdc47 100644 --- a/src/fnet/Makefile +++ b/src/fnet/Makefile | |||
@@ -7,7 +7,6 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | PROG = $(MOD_DIR)/$(MOD) | 7 | PROG = $(MOD_DIR)/$(MOD) |
8 | TARGET = $(PROG) | 8 | TARGET = $(PROG) |
9 | 9 | ||
10 | EXTRA_HDRS = ../include/common.h ../include/libnetlink.h | ||
11 | EXTRA_OBJS = ../lib/common.o ../lib/libnetlink.o | 10 | EXTRA_OBJS = ../lib/common.o ../lib/libnetlink.o |
12 | 11 | ||
13 | include $(ROOT)/src/prog.mk | 12 | include $(ROOT)/src/prog.mk |
diff --git a/src/fnetfilter/Makefile b/src/fnetfilter/Makefile index c8992c3d6..778de3a8b 100644 --- a/src/fnetfilter/Makefile +++ b/src/fnetfilter/Makefile | |||
@@ -7,7 +7,6 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | PROG = $(MOD_DIR)/$(MOD) | 7 | PROG = $(MOD_DIR)/$(MOD) |
8 | TARGET = $(PROG) | 8 | TARGET = $(PROG) |
9 | 9 | ||
10 | EXTRA_HDRS = ../include/common.h ../include/syscall.h | ||
11 | EXTRA_OBJS = ../lib/common.o | 10 | EXTRA_OBJS = ../lib/common.o |
12 | 11 | ||
13 | include $(ROOT)/src/prog.mk | 12 | include $(ROOT)/src/prog.mk |
diff --git a/src/fsec-optimize/Makefile b/src/fsec-optimize/Makefile index caead9d54..babed1fdb 100644 --- a/src/fsec-optimize/Makefile +++ b/src/fsec-optimize/Makefile | |||
@@ -7,7 +7,6 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | PROG = $(MOD_DIR)/$(MOD) | 7 | PROG = $(MOD_DIR)/$(MOD) |
8 | TARGET = $(PROG) | 8 | TARGET = $(PROG) |
9 | 9 | ||
10 | EXTRA_HDRS = ../include/common.h ../include/seccomp.h ../include/syscall.h | ||
11 | EXTRA_OBJS = ../lib/common.o ../lib/errno.o | 10 | EXTRA_OBJS = ../lib/common.o ../lib/errno.o |
12 | 11 | ||
13 | include $(ROOT)/src/prog.mk | 12 | include $(ROOT)/src/prog.mk |
diff --git a/src/fsec-print/Makefile b/src/fsec-print/Makefile index 43cc42fed..bf383d2d0 100644 --- a/src/fsec-print/Makefile +++ b/src/fsec-print/Makefile | |||
@@ -7,7 +7,6 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | PROG = $(MOD_DIR)/$(MOD) | 7 | PROG = $(MOD_DIR)/$(MOD) |
8 | TARGET = $(PROG) | 8 | TARGET = $(PROG) |
9 | 9 | ||
10 | EXTRA_HDRS = ../include/common.h ../include/seccomp.h ../include/syscall.h | ||
11 | EXTRA_OBJS = ../lib/common.o ../lib/errno.o ../lib/syscall.o | 10 | EXTRA_OBJS = ../lib/common.o ../lib/errno.o ../lib/syscall.o |
12 | 11 | ||
13 | include $(ROOT)/src/prog.mk | 12 | include $(ROOT)/src/prog.mk |
diff --git a/src/fseccomp/Makefile b/src/fseccomp/Makefile index 89b12f629..66bb58444 100644 --- a/src/fseccomp/Makefile +++ b/src/fseccomp/Makefile | |||
@@ -7,7 +7,6 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | PROG = $(MOD_DIR)/$(MOD) | 7 | PROG = $(MOD_DIR)/$(MOD) |
8 | TARGET = $(PROG) | 8 | TARGET = $(PROG) |
9 | 9 | ||
10 | EXTRA_HDRS = ../include/common.h ../include/syscall.h | ||
11 | EXTRA_OBJS = ../lib/common.o ../lib/errno.o ../lib/syscall.o | 10 | EXTRA_OBJS = ../lib/common.o ../lib/errno.o ../lib/syscall.o |
12 | 11 | ||
13 | include $(ROOT)/src/prog.mk | 12 | include $(ROOT)/src/prog.mk |
diff --git a/src/fzenity/Makefile b/src/fzenity/Makefile index 3c1aa0574..4cebe7ac5 100644 --- a/src/fzenity/Makefile +++ b/src/fzenity/Makefile | |||
@@ -7,6 +7,4 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | PROG = $(MOD_DIR)/$(MOD) | 7 | PROG = $(MOD_DIR)/$(MOD) |
8 | TARGET = $(PROG) | 8 | TARGET = $(PROG) |
9 | 9 | ||
10 | EXTRA_HDRS = ../include/common.h | ||
11 | |||
12 | include $(ROOT)/src/prog.mk | 10 | include $(ROOT)/src/prog.mk |
diff --git a/src/jailcheck/Makefile b/src/jailcheck/Makefile index 1823ee9d0..431a21c8e 100644 --- a/src/jailcheck/Makefile +++ b/src/jailcheck/Makefile | |||
@@ -7,7 +7,6 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | PROG = $(MOD_DIR)/$(MOD) | 7 | PROG = $(MOD_DIR)/$(MOD) |
8 | TARGET = $(PROG) | 8 | TARGET = $(PROG) |
9 | 9 | ||
10 | EXTRA_HDRS = ../include/common.h ../include/pid.h | ||
11 | EXTRA_OBJS = ../lib/common.o ../lib/pid.o | 10 | EXTRA_OBJS = ../lib/common.o ../lib/pid.o |
12 | 11 | ||
13 | include $(ROOT)/src/prog.mk | 12 | include $(ROOT)/src/prog.mk |
diff --git a/src/libpostexecseccomp/Makefile b/src/libpostexecseccomp/Makefile index f66fdd0d7..a8d3fd8b7 100644 --- a/src/libpostexecseccomp/Makefile +++ b/src/libpostexecseccomp/Makefile | |||
@@ -7,6 +7,4 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | SO = $(MOD_DIR)/$(MOD).so | 7 | SO = $(MOD_DIR)/$(MOD).so |
8 | TARGET = $(SO) | 8 | TARGET = $(SO) |
9 | 9 | ||
10 | EXTRA_HDRS = ../include/seccomp.h ../include/rundefs.h | ||
11 | |||
12 | include $(ROOT)/src/so.mk | 10 | include $(ROOT)/src/so.mk |
diff --git a/src/libtracelog/Makefile b/src/libtracelog/Makefile index a83726167..e9330236c 100644 --- a/src/libtracelog/Makefile +++ b/src/libtracelog/Makefile | |||
@@ -7,6 +7,4 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | SO = $(MOD_DIR)/$(MOD).so | 7 | SO = $(MOD_DIR)/$(MOD).so |
8 | TARGET = $(SO) | 8 | TARGET = $(SO) |
9 | 9 | ||
10 | EXTRA_HDRS = ../include/rundefs.h | ||
11 | |||
12 | include $(ROOT)/src/so.mk | 10 | include $(ROOT)/src/so.mk |
diff --git a/src/profstats/Makefile b/src/profstats/Makefile index 8f33ce1de..213b1476d 100644 --- a/src/profstats/Makefile +++ b/src/profstats/Makefile | |||
@@ -7,6 +7,4 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | PROG = $(MOD_DIR)/$(MOD) | 7 | PROG = $(MOD_DIR)/$(MOD) |
8 | TARGET = $(PROG) | 8 | TARGET = $(PROG) |
9 | 9 | ||
10 | EXTRA_HDRS = ../include/common.h | ||
11 | |||
12 | include $(ROOT)/src/prog.mk | 10 | include $(ROOT)/src/prog.mk |
diff --git a/src/prog.mk b/src/prog.mk index 87e1806a8..a639e87fc 100644 --- a/src/prog.mk +++ b/src/prog.mk | |||
@@ -3,20 +3,26 @@ | |||
3 | # Note: $(ROOT)/config.mk must be included before this file. | 3 | # Note: $(ROOT)/config.mk must be included before this file. |
4 | # | 4 | # |
5 | # The includer should probably define PROG and TARGET and may also want to | 5 | # The includer should probably define PROG and TARGET and may also want to |
6 | # define EXTRA_HDRS and EXTRA_OBJS and extend CLEANFILES. | 6 | # define EXTRA_OBJS and extend CLEANFILES. |
7 | 7 | ||
8 | HDRS := $(sort $(wildcard $(MOD_DIR)/*.h)) $(EXTRA_HDRS) | 8 | HDRS := |
9 | SRCS := $(sort $(wildcard $(MOD_DIR)/*.c)) | 9 | SRCS := $(sort $(wildcard $(MOD_DIR)/*.c)) |
10 | OBJS := $(SRCS:.c=.o) $(EXTRA_OBJS) | 10 | OBJS := $(SRCS:.c=.o) |
11 | DEPS := $(sort $(wildcard $(OBJS:.o=.d))) | ||
12 | |||
13 | ifeq ($(DEPS),) | ||
14 | HDRS := $(sort $(wildcard $(MOD_DIR)/*.h $(ROOT)/src/include/*.h)) | ||
15 | endif | ||
11 | 16 | ||
12 | .PHONY: all | 17 | .PHONY: all |
13 | all: $(TARGET) | 18 | all: $(TARGET) |
19 | -include $(DEPS) | ||
14 | 20 | ||
15 | %.o : %.c $(HDRS) $(ROOT)/config.mk | 21 | %.o : %.c $(HDRS) $(ROOT)/config.mk |
16 | $(CC) $(PROG_CFLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ | 22 | $(CC) $(PROG_CFLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ |
17 | 23 | ||
18 | $(PROG): $(OBJS) $(ROOT)/config.mk | 24 | $(PROG): $(OBJS) $(EXTRA_OBJS) $(ROOT)/config.mk |
19 | $(CC) $(PROG_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) | 25 | $(CC) $(PROG_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRA_OBJS) $(LIBS) |
20 | 26 | ||
21 | .PHONY: clean | 27 | .PHONY: clean |
22 | clean:; rm -fr $(PROG) $(CLEANFILES) | 28 | clean:; rm -fr $(PROG) $(CLEANFILES) |
@@ -3,20 +3,26 @@ | |||
3 | # Note: $(ROOT)/config.mk must be included before this file. | 3 | # Note: $(ROOT)/config.mk must be included before this file. |
4 | # | 4 | # |
5 | # The includer should probably define SO and TARGET and may also want to define | 5 | # The includer should probably define SO and TARGET and may also want to define |
6 | # EXTRA_HDRS and EXTRA_OBJS and extend CLEANFILES. | 6 | # EXTRA_OBJS and extend CLEANFILES. |
7 | 7 | ||
8 | HDRS := $(sort $(wildcard $(MOD_DIR)/*.h)) $(EXTRA_HDRS) | 8 | HDRS := |
9 | SRCS := $(sort $(wildcard $(MOD_DIR)/*.c)) | 9 | SRCS := $(sort $(wildcard $(MOD_DIR)/*.c)) |
10 | OBJS := $(SRCS:.c=.o) $(EXTRA_OBJS) | 10 | OBJS := $(SRCS:.c=.o) |
11 | DEPS := $(sort $(wildcard $(OBJS:.o=.d))) | ||
12 | |||
13 | ifeq ($(DEPS),) | ||
14 | HDRS := $(sort $(wildcard $(MOD_DIR)/*.h $(ROOT)/src/include/*.h)) | ||
15 | endif | ||
11 | 16 | ||
12 | .PHONY: all | 17 | .PHONY: all |
13 | all: $(TARGET) | 18 | all: $(TARGET) |
19 | -include $(DEPS) | ||
14 | 20 | ||
15 | %.o : %.c $(HDRS) $(ROOT)/config.mk | 21 | %.o : %.c $(HDRS) $(ROOT)/config.mk |
16 | $(CC) $(SO_CFLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ | 22 | $(CC) $(SO_CFLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ |
17 | 23 | ||
18 | $(SO): $(OBJS) $(ROOT)/config.mk | 24 | $(SO): $(OBJS) $(EXTRA_OBJS) $(ROOT)/config.mk |
19 | $(CC) $(SO_LDFLAGS) -shared $(LDFLAGS) -o $@ $(OBJS) -ldl | 25 | $(CC) $(SO_LDFLAGS) -shared $(LDFLAGS) -o $@ $(OBJS) $(EXTRA_OBJS) -ldl |
20 | 26 | ||
21 | .PHONY: clean | 27 | .PHONY: clean |
22 | clean:; rm -fr $(SO) $(CLEANFILES) | 28 | clean:; rm -fr $(SO) $(CLEANFILES) |