Skip to content

Commit

Permalink
tests: drop headers from Makefile dependencies
Browse files Browse the repository at this point in the history
Clang does not support header files included in the compile command:

    clang -g -O2 -Werror -Wall -Wextra -Wno-error=unused-parameter -D_GNU_SOURCE -DHAVE_BPF -DHAVE_FS_WATCH_PERM -DHAVE_BPF    bpf_test.c bpf_common.c bpf_common.h  -lselinux -lbpf -o bpf_test
    clang: error: cannot specify -o when generating multiple output files

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
  • Loading branch information
cgzones committed Nov 18, 2024
1 parent dbcd3f6 commit f8c51e2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tests/binder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ INCLUDEDIR ?= /usr/include

TARGETS = check_binder client manager service_provider
LDLIBS += -lselinux -lrt
DEPS = binder_common.c binder_common.h
DEPS = binder_common.c

ifeq ($(shell test -e $(INCLUDEDIR)/linux/android/binderfs.h && echo true),true)
CFLAGS += -DHAVE_BINDERFS
TARGETS += check_binderfs
endif

ifneq (,$(findstring -DHAVE_BPF,$(CFLAGS)))
DEPS += ../bpf/bpf_common.c ../bpf/bpf_common.h
DEPS += ../bpf/bpf_common.c
LDLIBS += -lbpf
endif

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TARGETS = bpf_test
DEPS = bpf_common.c bpf_common.h
DEPS = bpf_common.c
LDLIBS += -lselinux -lbpf

# export so that BPF_ENABLED entries get built correctly on local build
Expand Down
2 changes: 1 addition & 1 deletion tests/fdreceive/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TARGETS = client server

ifneq (,$(findstring -DHAVE_BPF,$(CFLAGS)))
DEPS = ../bpf/bpf_common.c ../bpf/bpf_common.h
DEPS = ../bpf/bpf_common.c
LDLIBS += -lbpf
endif

Expand Down
2 changes: 0 additions & 2 deletions tests/keys/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
TARGETS = keyctl keyctl_relabel keyring_service request_keys
LDLIBS += -lselinux -lkeyutils

$(TARGETS): keys_common.h

all: $(TARGETS)

clean:
Expand Down
2 changes: 1 addition & 1 deletion tests/tun_tap/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TARGETS = tun_tap tun_relabel
DEPS = tun_common.c tun_common.h
DEPS = tun_common.c
LDLIBS += -lselinux

all: $(TARGETS)
Expand Down

0 comments on commit f8c51e2

Please sign in to comment.