1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
222f6592bSBamvor Jian Zhang
3694f1f92SDaniel DíazMOUNT_CFLAGS := $(shell pkg-config --cflags mount 2>/dev/null)
4694f1f92SDaniel DíazMOUNT_LDLIBS := $(shell pkg-config --libs mount 2>/dev/null)
5694f1f92SDaniel Díazifeq ($(MOUNT_LDLIBS),)
6694f1f92SDaniel DíazMOUNT_LDLIBS := -lmount -I/usr/include/libmount
7694f1f92SDaniel Díazendif
8694f1f92SDaniel Díaz
9694f1f92SDaniel DíazCFLAGS += -O2 -g -std=gnu99 -Wall -I../../../../usr/include/ $(MOUNT_CFLAGS)
10694f1f92SDaniel DíazLDLIBS += $(MOUNT_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 Boudrainclude ../lib.mk
20a4f222e0SFathi Boudra
21a4f222e0SFathi Boudraall: $(TEST_PROGS_EXTENDED)
22a4f222e0SFathi Boudra
23a4f222e0SFathi Boudraoverride define CLEAN
24a4f222e0SFathi Boudra	$(RM) $(TEST_PROGS_EXTENDED)
258c7f6316SDaniel Díaz	$(MAKE) -C $(GPIODIR) OUTPUT=$(GPIODIR)/ clean
26a4f222e0SFathi Boudraendef
27a4f222e0SFathi Boudra
28a4f222e0SFathi Boudra$(TEST_PROGS_EXTENDED):| khdr
29a4f222e0SFathi Boudra$(TEST_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ)
30a4f222e0SFathi Boudra
31a4f222e0SFathi Boudra$(GPIODIR)/$(GPIOOBJ):
328c7f6316SDaniel Díaz	$(MAKE) OUTPUT=$(GPIODIR)/ -C $(GPIODIR)
33