Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: gpio: restructure Makefile

This patch cleans up the Makefile by restructuring a couple of
things, namely:
1) change explicit paths in targets for variables
2) substitute a variable (BINARIES) for another, part of the
selftests build system (TEST_PROGS_EXTENDED)
3) proper cleaning up of the EXTRA objects

The resulting Makefile is much more readable and manageable.

Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>

authored by

Fathi Boudra and committed by
Shuah Khan (Samsung OSG)
a4f222e0 d89d08ff

+20 -22
+20 -22
tools/testing/selftests/gpio/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 3 - TEST_PROGS := gpio-mockup.sh 4 - TEST_FILES := gpio-mockup-sysfs.sh $(BINARIES) 5 - BINARIES := gpio-mockup-chardev 6 - EXTRA_PROGS := ../gpiogpio-event-mon ../gpiogpio-hammer ../gpiolsgpio 7 - EXTRA_DIRS := ../gpioinclude/ 8 - EXTRA_OBJS := ../gpiogpio-event-mon-in.o ../gpiogpio-event-mon.o 9 - EXTRA_OBJS += ../gpiogpio-hammer-in.o ../gpiogpio-utils.o ../gpiolsgpio-in.o 10 - EXTRA_OBJS += ../gpiolsgpio.o 11 - 12 - include ../lib.mk 13 - 14 - all: $(BINARIES) 15 - 16 - override define CLEAN 17 - $(RM) $(BINARIES) $(EXTRA_PROGS) $(EXTRA_OBJS) 18 - $(RM) -r $(EXTRA_DIRS) 19 - endef 20 - 21 3 CFLAGS += -O2 -g -std=gnu99 -Wall -I../../../../usr/include/ 22 4 LDLIBS += -lmount -I/usr/include/libmount 23 5 24 - $(BINARIES):| khdr 25 - $(BINARIES): ../../../gpio/gpio-utils.o 6 + TEST_PROGS := gpio-mockup.sh 7 + TEST_FILES := gpio-mockup-sysfs.sh 8 + TEST_PROGS_EXTENDED := gpio-mockup-chardev 26 9 27 - ../../../gpio/gpio-utils.o: 28 - make ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C ../../../gpio 10 + GPIODIR := ../../../gpio 11 + GPIOOBJ := gpio-utils.o 12 + 13 + include ../lib.mk 14 + 15 + all: $(TEST_PROGS_EXTENDED) 16 + 17 + override define CLEAN 18 + $(RM) $(TEST_PROGS_EXTENDED) 19 + $(MAKE) -C $(GPIODIR) clean 20 + endef 21 + 22 + $(TEST_PROGS_EXTENDED):| khdr 23 + $(TEST_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ) 24 + 25 + $(GPIODIR)/$(GPIOOBJ): 26 + $(MAKE) -C $(GPIODIR)