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) 20GPIOOUT := $(OUTPUT)/tools-gpio/ 21GPIOOBJ := $(GPIOOUT)/gpio-utils.o 22 23override define CLEAN 24 $(RM) $(TEST_GEN_PROGS_EXTENDED) 25 $(RM) -rf $(GPIOOUT) 26endef 27 28$(TEST_GEN_PROGS_EXTENDED): $(GPIOOBJ) 29 30$(GPIOOUT): 31 mkdir -p $@ 32 33$(GPIOOBJ): $(GPIOOUT) 34 $(MAKE) OUTPUT=$(GPIOOUT) -C $(GPIODIR) 35