-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
42 lines (31 loc) · 1.1 KB
/
Makefile
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
CFILES = include/gopt/gopt.c src/G203-single-packet.c
MMO_CFILES = include/gopt/gopt.c src/G203-native-libusb.c # means orginal
IDIR = -Iinclude/ -I/usr/local/include/hidapi
CC = clang
CFLAGS= -std=gnu11 -Wall -Wextra $(IDIR)
LDIR = -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu
LIBS = -lusb-1.0 -lpthread -Wl,-rpath -Wl,/usr/local/lib #with HID
TARGET = G203colorshifter
MMO_TARGET = G203MMO
DESTDIR = /usr/local
all: $(TARGET) $(MMO_TARGET)
$(TARGET): $(CFILES)
$(CC) $(CFLAGS) -o $(TARGET) $(CFILES) $(LDIR) $(LIBS)
$(MMO_TARGET): $(MMO_CFILES)
$(CC) $(CFLAGS) -o $(MMO_TARGET) $(MMO_CFILES) $(LDIR) $(LIBS)
debug: $(MMO_CFILES)
$(CC) $(CFLAGS) -g -o $(TARGET) $(MMO_CFILES) $(LDIR) $(LIBS)
single_debug: $(CFILES)
$(CC) $(CFLAGS) -g -o $(TARGET) $(CFILES) $(LDIR) $(LIBS)
install:
install -d $(DESTDIR)/bin/
install -m 755 $(TARGET) $(DESTDIR)/bin/
ifneq ("$(wildcard $(MMO_TARGET))","")
install -m 755 $(MMO_TARGET) $(DESTDIR)/bin/
endif
.PHONY: install clean # check if bins are present
uninstall:
rm -rf $(DESTDIR)/bin/$(TARGET)
rm -rf $(DESTDIR)/bin/$(MMO_TARGET)
clean:
$(RM) $(TARGET) $(MMO_TARGET)