1# SPDX-License-Identifier: GPL-2.0 2 3VAR_CFLAGS := $(shell pkg-config --cflags mount 2>/dev/null) 4VAR_LDLIBS := $(shell pkg-config --libs mount 2>/dev/null) 5ifeq ($(VAR_LDLIBS),) 6VAR_LDLIBS := -lmount -I/usr/include/libmount 7endif 8 9CFLAGS += -O2 -g -std=gnu99 -Wall -I../../../../usr/include/ $(VAR_CFLAGS) 10LDLIBS += $(VAR_LDLIBS) 11 12TEST_PROGS := gpio-mockup.sh 13TEST_FILES := gpio-mockup-sysfs.sh 14TEST_PROGS_EXTENDED := gpio-mockup-chardev 15 16GPIODIR := $(realpath ../../../gpio) 17GPIOOBJ := gpio-utils.o 18 19all: $(TEST_PROGS_EXTENDED) 20 21override define CLEAN 22 $(RM) $(TEST_PROGS_EXTENDED) 23 $(MAKE) -C $(GPIODIR) OUTPUT=$(GPIODIR)/ clean 24endef 25 26KSFT_KHDR_INSTALL := 1 27include ../lib.mk 28 29$(TEST_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ) 30 31$(GPIODIR)/$(GPIOOBJ): 32 $(MAKE) OUTPUT=$(GPIODIR)/ -C $(GPIODIR) 33