-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
54 lines (41 loc) · 1.04 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
UNAME = $(shell uname)
CFLAGS = -Wall -Wpedantic -lusb-1.0
ifeq ($(UNAME), Darwin)
CFLAGS += -Wno-unused-command-line-argument \
-I/usr/local/opt/libusb/include/libusb-1.0 \
-L/usr/local/opt/libusb/lib/
else
CFLAGS += -I/usr/include/libusb-1.0 -Wno-unused-result -Wno-format-overflow
endif
ifdef DEBUG
CFLAGS += -DDEBUG -Og
else
CFLAGS += -O3
endif
BUILD = build
BIN = bin
SRC = src
.PHONY: all
all: volcanod volcano volcanosrv volcanoctl
volcanod: $(addprefix $(BUILD)/, util.o config.o fmt.o daemon.o keyboard.o)
@-mkdir -p $(BIN)
$(CC) $^ $(CFLAGS) -o $(BIN)/$@
volcanosrv: $(addprefix $(BUILD)/, util.o config.o fmt.o srv.o keyboard.o)
@-mkdir -p $(BIN)
$(CC) $^ $(CFLAGS) -o $(BIN)/$@
volcano: $(addprefix $(BUILD)/, fmt.o main.o keyboard.o)
@-mkdir -p $(BIN)
$(CC) $^ $(CFLAGS) -o $(BIN)/$@
volcanoctl:
@-mkdir -p $(BIN)
cp tools/volcanoctl $(BIN)/volcanoctl
$(BUILD):
@-mkdir -p $@
$(BIN):
@-mkdir -p $@
clean:
-rm -rf $(BUILD)
-rm -rf $(BIN)
$(BUILD)/%.o: $(SRC)/%.c $(BUILD)
$(CC) -c $(CFLAGS) $< -o $@
$(SRC)/%.c: $(SRC)/%.h