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_GEN_PROGS_EXTENDED := gpio-mockup-chardev 15 16GPIODIR := $(realpath ../../../gpio) 17GPIOOBJ := gpio-utils.o 18 19override define CLEAN 20 $(RM) $(TEST_GEN_PROGS_EXTENDED) 21 $(MAKE) -C $(GPIODIR) OUTPUT=$(GPIODIR)/ clean 22endef 23 24KSFT_KHDR_INSTALL := 1 25include ../lib.mk 26 27$(TEST_GEN_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ) 28 29$(GPIODIR)/$(GPIOOBJ): 30 $(MAKE) OUTPUT=$(GPIODIR)/ -C $(GPIODIR) 31