1# SPDX-License-Identifier: GPL-2.0 2 3MOUNT_CFLAGS := $(shell pkg-config --cflags mount 2>/dev/null) 4MOUNT_LDLIBS := $(shell pkg-config --libs mount 2>/dev/null) 5ifeq ($(MOUNT_LDLIBS),) 6MOUNT_LDLIBS := -lmount -I/usr/include/libmount 7endif 8 9CFLAGS += -O2 -g -std=gnu99 -Wall -I../../../../usr/include/ $(MOUNT_CFLAGS) 10LDLIBS += $(MOUNT_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 19include ../lib.mk 20 21all: $(TEST_PROGS_EXTENDED) 22 23override define CLEAN 24 $(RM) $(TEST_PROGS_EXTENDED) 25 $(MAKE) -C $(GPIODIR) OUTPUT=$(GPIODIR)/ clean 26endef 27 28$(TEST_PROGS_EXTENDED):| khdr 29$(TEST_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ) 30 31$(GPIODIR)/$(GPIOOBJ): 32 $(MAKE) OUTPUT=$(GPIODIR)/ -C $(GPIODIR) 33