~xdavidwu/motion-control

ref: 64792e8f1dedecacf7c61b072ba352bd1e5a1515 motion-control/Makefile -rw-r--r-- 792 bytes
64792e8fPinghao Wu Makefile: make joycon default sensor 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
SENSORS ?= joycon
SENSORS_LIBS =
HEADERS_PREFIX ?= /usr/include
BINARIES = event-codes evdev-dump-events uinput-pointer sensors-dump pointerd pointerc motion-control buttonc

ifeq ($(SENSORS), joycon)
	SENSORS_LIBS = -levdev
endif

.PHONY: $(BINARIES)
all: $(BINARIES)

event-codes:
	hare build -o $@ aux/$@/
evdev/codes.ha: event-codes
	./event-codes <$(HEADERS_PREFIX)/linux/input-event-codes.h >$@

evdev-dump-events uinput-pointer: evdev/codes.ha
	hare build -levdev -o $@ tools/$@/
sensors-dump:
	hare build $(SENSORS_LIBS) -T +$(SENSORS) -o $@ tools/$@/
buttonc pointerc:
	hare build -o $@ tools/$@/
pointerd: evdev/codes.ha
	hare build -levdev -o $@ cmd/$@/
motion-control:
	hare build $(SENSORS_LIBS) -T +$(SENSORS) -o $@ cmd/$@/

clean:
	rm -f event-codes evdev/codes.ha $(BINARIES)