blob: a4d0792ca7ae44c803b7fd51225d1271b810706d (
plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
|
# Use the following 3 lines on Unix (uncomment the framework on Mac OS X):
USBFLAGS = `libusb-config --cflags`
USBLIBS = `libusb-config --libs` #-framework CoreFoundation
CC ?= gcc
CFLAGS = $(USBFLAGS) -O2 -Wall -Wextra -pedantic
LIBS = $(USBLIBS)
PREFIX ?= /usr/local
bin_dir = ${DESTDIR}${PREFIX}/bin
PROGRAMS = vusb-i2c vusb-i2cdetect vusb-i2cwrite
all: $(PROGRAMS)
.c.o:
$(CC) $(CFLAGS) -c $<
i2c.o: i2c.c i2c-util.c i2c-util.h
i2c-util.o: i2c-util.c
i2cdetect.o: i2cdetect.c i2c-util.c i2c-util.h
i2cwrite.o: i2cwrite.c i2c-util.c i2c-util.h
vusb-i2c: i2c.o i2c-util.o
$(CC) -o $@ $^ $(LIBS)
vusb-i2cdetect: i2cdetect.o i2c-util.o
$(CC) -o $@ $^ $(LIBS)
vusb-i2cwrite: i2cwrite.o i2c-util.o
$(CC) -o $@ $^ $(LIBS)
clean:
rm -f *.o $(PROGRAMS)
install:
install -m 4755 $(PROGRAMS) $(bin_dir)
uninstall:
rm -rf $(bin_dir)/vusb-i2c $(bin_dir)/vusb-i2cdetect
.PHONY: all strip clean install uninstall
|