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
14a4f222e0SFathi BoudraTEST_PROGS_EXTENDED := gpio-mockup-chardev
1522f6592bSBamvor Jian Zhang
168c7f6316SDaniel DíazGPIODIR := $(realpath ../../../gpio)
17a4f222e0SFathi BoudraGPIOOBJ := gpio-utils.o
18a4f222e0SFathi Boudra
19a4f222e0SFathi Boudraall: $(TEST_PROGS_EXTENDED)
20a4f222e0SFathi Boudra
21a4f222e0SFathi Boudraoverride define CLEAN
22a4f222e0SFathi Boudra	$(RM) $(TEST_PROGS_EXTENDED)
238c7f6316SDaniel Díaz	$(MAKE) -C $(GPIODIR) OUTPUT=$(GPIODIR)/ clean
24a4f222e0SFathi Boudraendef
25a4f222e0SFathi Boudra
26283ac6d5SShuah KhanKSFT_KHDR_INSTALL := 1
27283ac6d5SShuah Khaninclude ../lib.mk
28283ac6d5SShuah Khan
29a4f222e0SFathi Boudra$(TEST_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ)
30a4f222e0SFathi Boudra
31a4f222e0SFathi Boudra$(GPIODIR)/$(GPIOOBJ):
328c7f6316SDaniel Díaz	$(MAKE) OUTPUT=$(GPIODIR)/ -C $(GPIODIR)
33