diff options
| author | Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> | 2015-11-17 09:35:41 -0500 |
|---|---|---|
| committer | Shuah Khan <shuahkh@osg.samsung.com> | 2015-11-23 15:20:10 -0500 |
| commit | d3edeb47d886cf38bcf0e96c38f15f6cfda67e02 (patch) | |
| tree | 247c560acac523f02d9ffa06fd388b15f79f8437 /tools/testing/selftests/capabilities | |
| parent | 8005c49d9aea74d382f474ce11afbbc7d7130bec (diff) | |
selftests/capabilities: clean up for Makefile
Clean up the following things:
1. Avoid the broken when use TARGETS in the command line, eg:
$ make -C tools/testing/selftests TARGETS=capabilities
make[1]: *** No rule to make target 'capabilities', needed by 'all'. Stop.
Replace TARGETS with BINARIES.
2. User need to provide cap-ng.h and libcap-ng.so for cross compiling.
Replace ':=' with '+=' for CFLAGS and introduce LDLIBS to archieve
it. Delete useless EXTRA_CLAGS at the same time.
3. Delete the duplicated definition which is already defined by
lib.mk.
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools/testing/selftests/capabilities')
| -rw-r--r-- | tools/testing/selftests/capabilities/Makefile | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/tools/testing/selftests/capabilities/Makefile b/tools/testing/selftests/capabilities/Makefile index 8c8f0c1f0889..008602aed920 100644 --- a/tools/testing/selftests/capabilities/Makefile +++ b/tools/testing/selftests/capabilities/Makefile | |||
| @@ -1,18 +1,15 @@ | |||
| 1 | all: | 1 | TEST_FILES := validate_cap |
| 2 | |||
| 3 | include ../lib.mk | ||
| 4 | |||
| 5 | .PHONY: all clean | ||
| 6 | |||
| 7 | TARGETS := validate_cap test_execve | ||
| 8 | TEST_PROGS := test_execve | 2 | TEST_PROGS := test_execve |
| 9 | 3 | ||
| 10 | CFLAGS := -O2 -g -std=gnu99 -Wall -lcap-ng | 4 | BINARIES := $(TEST_FILES) $(TEST_PROGS) |
| 11 | 5 | ||
| 12 | all: $(TARGETS) | 6 | CFLAGS += -O2 -g -std=gnu99 -Wall |
| 7 | LDLIBS += -lcap-ng -lrt -ldl | ||
| 8 | |||
| 9 | all: $(BINARIES) | ||
| 13 | 10 | ||
| 14 | clean: | 11 | clean: |
| 15 | $(RM) $(TARGETS) | 12 | $(RM) $(BINARIES) |
| 13 | |||
| 14 | include ../lib.mk | ||
| 16 | 15 | ||
| 17 | $(TARGETS): %: %.c | ||
| 18 | $(CC) -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl | ||
