Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: use full paths on compile/link targets #6158

Merged
merged 2 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ LDFLAGS=@LDFLAGS@
# Project variables
EXTRA_CFLAGS =@EXTRA_CFLAGS@
COMMON_CFLAGS = \
-ggdb -O2 -DVERSION='"$(VERSION)"' -DMOD_DIR='"$(MOD_DIR)"' \
-ggdb -O2 -DVERSION='"$(VERSION)"' \
-Wall -Wextra $(HAVE_FATAL_WARNINGS) \
-Wformat -Wformat-security \
-fstack-protector-all -D_FORTIFY_SOURCE=2 \
Expand Down
5 changes: 3 additions & 2 deletions src/etc-cleanup/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/etc-cleanup
PROG = etc-cleanup
MOD = etc-cleanup
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

EXTRA_HDRS = ../include/etc_groups.h
Expand Down
5 changes: 3 additions & 2 deletions src/fbuilder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/fbuilder
PROG = fbuilder
MOD = fbuilder
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

EXTRA_HDRS = ../include/common.h ../include/syscall.h
Expand Down
5 changes: 3 additions & 2 deletions src/fcopy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/fcopy
PROG = fcopy
MOD = fcopy
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

EXTRA_HDRS = ../include/common.h ../include/syscall.h
Expand Down
5 changes: 3 additions & 2 deletions src/fids/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/fids
PROG = fids
MOD = fids
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

EXTRA_HDRS = ../include/common.h
Expand Down
5 changes: 3 additions & 2 deletions src/firecfg/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/firecfg
PROG = firecfg
MOD = firecfg
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

EXTRA_HDRS = \
Expand Down
5 changes: 3 additions & 2 deletions src/firejail/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/firejail
PROG = firejail
MOD = firejail
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

EXTRA_HDRS = \
Expand Down
5 changes: 3 additions & 2 deletions src/firemon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/firemon
PROG = firemon
MOD = firemon
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

EXTRA_HDRS = ../include/common.h ../include/pid.h
Expand Down
5 changes: 3 additions & 2 deletions src/fldd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/fldd
PROG = fldd
MOD = fldd
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

EXTRA_HDRS = ../include/common.h ../include/syscall.h ../include/ldd_utils.h
Expand Down
5 changes: 3 additions & 2 deletions src/fnet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/fnet
PROG = fnet
MOD = fnet
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

EXTRA_HDRS = ../include/common.h ../include/libnetlink.h
Expand Down
5 changes: 3 additions & 2 deletions src/fnetfilter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/fnetfilter
PROG = fnetfilter
MOD = fnetfilter
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

EXTRA_HDRS = ../include/common.h ../include/syscall.h
Expand Down
5 changes: 3 additions & 2 deletions src/fnetlock/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/fnetlock
PROG = fnetlock
MOD = fnetlock
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

include $(ROOT)/src/prog.mk
5 changes: 3 additions & 2 deletions src/fnettrace-dns/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/fnettrace-dns
PROG = fnettrace-dns
MOD = fnettrace-dns
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

include $(ROOT)/src/prog.mk
5 changes: 3 additions & 2 deletions src/fnettrace-icmp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/fnettrace-icmp
PROG = fnettrace-icmp
MOD = fnettrace-icmp
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

include $(ROOT)/src/prog.mk
5 changes: 3 additions & 2 deletions src/fnettrace-sni/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/fnettrace-sni
PROG = fnettrace-sni
MOD = fnettrace-sni
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

include $(ROOT)/src/prog.mk
9 changes: 5 additions & 4 deletions src/fnettrace/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/fnettrace
PROG = fnettrace
MOD = fnettrace
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

include $(ROOT)/src/prog.mk

all: $(TARGET) static-ip-map
static-ip-map: static-ip-map.txt fnettrace
./fnettrace --squash-map=static-ip-map.txt > static-ip-map
static-ip-map: static-ip-map.txt $(PROG)
./$(PROG) --squash-map=static-ip-map.txt > static-ip-map
5 changes: 3 additions & 2 deletions src/fsec-optimize/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/fsec-optimize
PROG = fsec-optimize
MOD = fsec-optimize
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

EXTRA_HDRS = ../include/common.h ../include/seccomp.h ../include/syscall.h
Expand Down
5 changes: 3 additions & 2 deletions src/fsec-print/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/fsec-print
PROG = fsec-print
MOD = fsec-print
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

EXTRA_HDRS = ../include/common.h ../include/seccomp.h ../include/syscall.h
Expand Down
5 changes: 3 additions & 2 deletions src/fseccomp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/fseccomp
PROG = fseccomp
MOD = fseccomp
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

EXTRA_HDRS = ../include/common.h ../include/syscall.h
Expand Down
5 changes: 3 additions & 2 deletions src/ftee/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/ftee
PROG = ftee
MOD = ftee
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

include $(ROOT)/src/prog.mk
5 changes: 3 additions & 2 deletions src/fzenity/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/fzenity
PROG = fzenity
MOD = fzenity
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

EXTRA_HDRS = ../include/common.h
Expand Down
4 changes: 2 additions & 2 deletions src/include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@

#define errExit(msg) do { \
char msgout[500]; \
snprintf(msgout, 500, "Error %s/%s:%d %s(): %s", \
MOD_DIR, __FILE__, __LINE__, __func__, msg); \
snprintf(msgout, 500, "Error %s:%d: %s: %s", \
__FILE__, __LINE__, __func__, msg); \
perror(msgout); \
exit(1); \
} while (0)
Expand Down
5 changes: 3 additions & 2 deletions src/jailcheck/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/jailcheck
PROG = jailcheck
MOD = jailcheck
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

EXTRA_HDRS = ../include/common.h ../include/pid.h
Expand Down
3 changes: 2 additions & 1 deletion src/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/lib
MOD = lib
MOD_DIR = $(ROOT)/src/$(MOD)
TARGET = lib

include $(ROOT)/src/prog.mk
Expand Down
5 changes: 3 additions & 2 deletions src/libpostexecseccomp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/libpostexecseccomp
SO = libpostexecseccomp.so
MOD = libpostexecseccomp
MOD_DIR = $(ROOT)/src/$(MOD)
SO = $(MOD_DIR)/$(MOD).so
TARGET = $(SO)

EXTRA_HDRS = ../include/seccomp.h ../include/rundefs.h
Expand Down
5 changes: 3 additions & 2 deletions src/libtrace/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/libtrace
SO = libtrace.so
MOD = libtrace
MOD_DIR = $(ROOT)/src/$(MOD)
SO = $(MOD_DIR)/$(MOD).so
TARGET = $(SO)

include $(ROOT)/src/so.mk
5 changes: 3 additions & 2 deletions src/libtracelog/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/libtracelog
SO = libtracelog.so
MOD = libtracelog
MOD_DIR = $(ROOT)/src/$(MOD)
SO = $(MOD_DIR)/$(MOD).so
TARGET = $(SO)

EXTRA_HDRS = ../include/rundefs.h
Expand Down
5 changes: 3 additions & 2 deletions src/profstats/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ROOT = ../..
-include $(ROOT)/config.mk

MOD_DIR = src/profstats
PROG = profstats
MOD = profstats
MOD_DIR = $(ROOT)/src/$(MOD)
PROG = $(MOD_DIR)/$(MOD)
TARGET = $(PROG)

EXTRA_HDRS = ../include/common.h
Expand Down
4 changes: 2 additions & 2 deletions src/prog.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# The includer should probably define PROG and TARGET and may also want to
# define EXTRA_HDRS and EXTRA_OBJS and extend CLEANFILES.

HDRS := $(sort $(wildcard *.h)) $(EXTRA_HDRS)
SRCS := $(sort $(wildcard *.c))
HDRS := $(sort $(wildcard $(MOD_DIR)/*.h)) $(EXTRA_HDRS)
SRCS := $(sort $(wildcard $(MOD_DIR)/*.c))
OBJS := $(SRCS:.c=.o) $(EXTRA_OBJS)

.PHONY: all
Expand Down
4 changes: 2 additions & 2 deletions src/so.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# The includer should probably define SO and TARGET and may also want to define
# EXTRA_HDRS and EXTRA_OBJS and extend CLEANFILES.

HDRS := $(sort $(wildcard *.h)) $(EXTRA_HDRS)
SRCS := $(sort $(wildcard *.c))
HDRS := $(sort $(wildcard $(MOD_DIR)/*.h)) $(EXTRA_HDRS)
SRCS := $(sort $(wildcard $(MOD_DIR)/*.c))
OBJS := $(SRCS:.c=.o) $(EXTRA_OBJS)

.PHONY: all
Expand Down
Loading