-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (36 loc) · 711 Bytes
/
Copy pathMakefile
File metadata and controls
49 lines (36 loc) · 711 Bytes
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
TARGET=mtkeepmgr
OBJ=\
con_file.o \
mt7601.o \
mt7603.o \
mt7610.o \
mt7620.o \
mt7628.o \
mt7662.o \
mt7663.o \
mtkeepmgr.o \
rt5592.o \
utils.o
DEP=$(OBJ:%.o=%.d)
DEFS=
HAVE_LIBUSB?=$(shell pkg-config libusb-1.0 && echo y || echo n)
CONFIG_CON_USB?=$(HAVE_LIBUSB)
ifeq ($(CONFIG_CON_USB),y)
DEFS+=-DCONFIG_CON_USB
OBJ+=con_usb.o
con_usb.o: CFLAGS+=$(shell pkg-config --cflags libusb-1.0)
LDFLAGS+=$(shell pkg-config --libs libusb-1.0)
endif
CFLAGS += -Wall -g
DEPFLAGS=-MMD -MP
.PHONY: all
all: $(TARGET)
$(TARGET): $(OBJ)
$(CC) $(LDFLAGS) $^ -o $@
%.o: %.c
$(CC) $(DEPFLAGS) $(CFLAGS) $(DEFS) -c $< -o $@
.PHONY: clean
clean:
rm -rf $(TARGET) $(OBJ)
rm -rf $(DEP)
-include $(DEP)