1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
222f6592bSBamvor Jian Zhang
393a4388bSShuah KhanVAR_CFLAGS := $(shell pkg-config --cflags mount 2>/dev/null)
493a4388bSShuah KhanVAR_LDLIBS := $(shell pkg-config --libs mount 2>/dev/null)
593a4388bSShuah Khanifeq ($(VAR_LDLIBS),)
693a4388bSShuah KhanVAR_LDLIBS := -lmount -I/usr/include/libmount
7694f1f92SDaniel Díazendif
8694f1f92SDaniel Díaz
993a4388bSShuah KhanCFLAGS += -O2 -g -std=gnu99 -Wall -I../../../../usr/include/ $(VAR_CFLAGS)
1093a4388bSShuah KhanLDLIBS += $(VAR_LDLIBS)
1122f6592bSBamvor Jian Zhang
12a4f222e0SFathi BoudraTEST_PROGS := gpio-mockup.sh
13a4f222e0SFathi BoudraTEST_FILES := gpio-mockup-sysfs.sh
14ff2c395bSMichael EllermanTEST_GEN_PROGS_EXTENDED := gpio-mockup-chardev
1522f6592bSBamvor Jian Zhang
16*449539daSMichael EllermanKSFT_KHDR_INSTALL := 1
17*449539daSMichael Ellermaninclude ../lib.mk
18*449539daSMichael Ellerman
198c7f6316SDaniel DíazGPIODIR := $(realpath ../../../gpio)
20a4f222e0SFathi BoudraGPIOOBJ := gpio-utils.o
21a4f222e0SFathi Boudra
22a4f222e0SFathi Boudraoverride define CLEAN
23ff2c395bSMichael Ellerman	$(RM) $(TEST_GEN_PROGS_EXTENDED)
248c7f6316SDaniel Díaz	$(MAKE) -C $(GPIODIR) OUTPUT=$(GPIODIR)/ clean
25a4f222e0SFathi Boudraendef
26a4f222e0SFathi Boudra
27ff2c395bSMichael Ellerman$(TEST_GEN_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ)
28a4f222e0SFathi Boudra
29a4f222e0SFathi Boudra$(GPIODIR)/$(GPIOOBJ):
308c7f6316SDaniel Díaz	$(MAKE) OUTPUT=$(GPIODIR)/ -C $(GPIODIR)
31