1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
222f6592bSBamvor Jian Zhang
322f6592bSBamvor Jian ZhangTEST_PROGS := gpio-mockup.sh
422f6592bSBamvor Jian ZhangTEST_FILES := gpio-mockup-sysfs.sh $(BINARIES)
522f6592bSBamvor Jian ZhangBINARIES := gpio-mockup-chardev
651c6bd7cSShuah KhanEXTRA_PROGS := ../gpiogpio-event-mon ../gpiogpio-hammer ../gpiolsgpio
751c6bd7cSShuah KhanEXTRA_DIRS := ../gpioinclude/
851c6bd7cSShuah KhanEXTRA_OBJS := ../gpiogpio-event-mon-in.o ../gpiogpio-event-mon.o
951c6bd7cSShuah KhanEXTRA_OBJS += ../gpiogpio-hammer-in.o ../gpiogpio-utils.o ../gpiolsgpio-in.o
1051c6bd7cSShuah KhanEXTRA_OBJS += ../gpiolsgpio.o
1122f6592bSBamvor Jian Zhang
1222f6592bSBamvor Jian Zhanginclude ../lib.mk
1322f6592bSBamvor Jian Zhang
1422f6592bSBamvor Jian Zhangall: $(BINARIES)
1522f6592bSBamvor Jian Zhang
166dd89010SShuah Khanoverride define CLEAN
1751c6bd7cSShuah Khan	$(RM) $(BINARIES) $(EXTRA_PROGS) $(EXTRA_OBJS)
1851c6bd7cSShuah Khan	$(RM) -r $(EXTRA_DIRS)
196dd89010SShuah Khanendef
2022f6592bSBamvor Jian Zhang
2122f6592bSBamvor Jian ZhangCFLAGS += -O2 -g -std=gnu99 -Wall -I../../../../usr/include/
2222f6592bSBamvor Jian ZhangLDLIBS += -lmount -I/usr/include/libmount
2322f6592bSBamvor Jian Zhang
2422f6592bSBamvor Jian Zhang$(BINARIES): ../../../gpio/gpio-utils.o ../../../../usr/include/linux/gpio.h
2522f6592bSBamvor Jian Zhang
2622f6592bSBamvor Jian Zhang../../../gpio/gpio-utils.o:
2722f6592bSBamvor Jian Zhang	make ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C ../../../gpio
2822f6592bSBamvor Jian Zhang
2922f6592bSBamvor Jian Zhang../../../../usr/include/linux/gpio.h:
3022f6592bSBamvor Jian Zhang	make -C ../../../.. headers_install INSTALL_HDR_PATH=$(shell pwd)/../../../../usr/
3122f6592bSBamvor Jian Zhang
32