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
14*ff2c395bSMichael EllermanTEST_GEN_PROGS_EXTENDED := gpio-mockup-chardev
1522f6592bSBamvor Jian Zhang
168c7f6316SDaniel DíazGPIODIR := $(realpath ../../../gpio)
17a4f222e0SFathi BoudraGPIOOBJ := gpio-utils.o
18a4f222e0SFathi Boudra
19a4f222e0SFathi Boudraoverride define CLEAN
20*ff2c395bSMichael Ellerman	$(RM) $(TEST_GEN_PROGS_EXTENDED)
218c7f6316SDaniel Díaz	$(MAKE) -C $(GPIODIR) OUTPUT=$(GPIODIR)/ clean
22a4f222e0SFathi Boudraendef
23a4f222e0SFathi Boudra
24283ac6d5SShuah KhanKSFT_KHDR_INSTALL := 1
25283ac6d5SShuah Khaninclude ../lib.mk
26283ac6d5SShuah Khan
27*ff2c395bSMichael Ellerman$(TEST_GEN_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ)
28a4f222e0SFathi Boudra
29a4f222e0SFathi Boudra$(GPIODIR)/$(GPIOOBJ):
308c7f6316SDaniel Díaz	$(MAKE) OUTPUT=$(GPIODIR)/ -C $(GPIODIR)
31