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