blob: 298929df97e695b5be640a47d51b84d173f5da5f [file] [log] [blame]
Bamvor Jian Zhang22f65922016-11-21 18:16:11 +08001
2TEST_PROGS := gpio-mockup.sh
3TEST_FILES := gpio-mockup-sysfs.sh $(BINARIES)
4BINARIES := gpio-mockup-chardev
Shuah Khan51c6bd72017-04-21 18:01:51 -06005EXTRA_PROGS := ../gpiogpio-event-mon ../gpiogpio-hammer ../gpiolsgpio
6EXTRA_DIRS := ../gpioinclude/
7EXTRA_OBJS := ../gpiogpio-event-mon-in.o ../gpiogpio-event-mon.o
8EXTRA_OBJS += ../gpiogpio-hammer-in.o ../gpiogpio-utils.o ../gpiolsgpio-in.o
9EXTRA_OBJS += ../gpiolsgpio.o
Bamvor Jian Zhang22f65922016-11-21 18:16:11 +080010
11include ../lib.mk
12
13all: $(BINARIES)
14
Shuah Khan6dd89012017-04-21 16:19:50 -060015override define CLEAN
Shuah Khan51c6bd72017-04-21 18:01:51 -060016 $(RM) $(BINARIES) $(EXTRA_PROGS) $(EXTRA_OBJS)
17 $(RM) -r $(EXTRA_DIRS)
Shuah Khan6dd89012017-04-21 16:19:50 -060018endef
Bamvor Jian Zhang22f65922016-11-21 18:16:11 +080019
20CFLAGS += -O2 -g -std=gnu99 -Wall -I../../../../usr/include/
21LDLIBS += -lmount -I/usr/include/libmount
22
23$(BINARIES): ../../../gpio/gpio-utils.o ../../../../usr/include/linux/gpio.h
24
25../../../gpio/gpio-utils.o:
26 make ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C ../../../gpio
27
28../../../../usr/include/linux/gpio.h:
29 make -C ../../../.. headers_install INSTALL_HDR_PATH=$(shell pwd)/../../../../usr/
30