-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
73 lines (54 loc) · 1.18 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
V ?= 0
ifeq ($V, 1)
E =
P = @true
else
E = @
P = @echo
endif
SHELL = /bin/sh
srcdir = src
objdir = obj
prefix = $(DESTDIR)/usr/local
exec_prefix = $(DESTDIR)/${prefix}
bindir = $(exec_prefix)/bin
CC = $(CROSS_COMPILE)gcc
INSTALL = install
MKDIR = mkdir -p
LIBS = -lusb-1.0 -lpthread
CFLAGS += -g -O0
LDFLAGS +=
CPPFLAGS +=
ARCH ?= $(ARCH_x86_64)
ARCH_CFLAGS ?= $(CFLAGS_x86_64)
CFLAGS += -Isrc -I/usr/include/libusb-1.0
CFLAGS += -Wall -Wextra -Wno-char-subscripts -Wno-unused-parameter -Wno-format
CFLAGS += $(ARCH_CFLAGS)
OBJ = $(objdir)/main.o \
$(objdir)/hid_device_manager.o \
$(objdir)/accessory_manager.o \
$(objdir)/hid_event.o
TARGET = accessoryHID
all: $(objdir) $(TARGET)
$(TARGET): $(OBJ)
$P ' LD $@'
$E $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
$(objdir):
$E mkdir $(objdir)
$(objdir)/%.o: $(srcdir)/%.c
$P ' CC $@'
$E $(CC) $(CFLAGS) -c -o $@ $^
.PHONY: clean
clean:
$P ' RM TARGET'
$E rm -f $(TARGET)
$P ' RM OBJS'
$E rm -rf $(objdir)
install:
$P ' MKDIRS '
$E $(MKDIR) $(bindir)
$P ' INSTALL $(TARGET)'
$E $(INSTALL) $(TARGET) $(bindir)
uninstall:
$P ' UNINSTALL'
$E rm -f $(bindir)/$(TARGET)