-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
47 lines (33 loc) · 820 Bytes
/
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
###
### Makefile
###
CC = gcc
TARGET = keuka
INSTALL = /usr/bin/install -c
prefix = /usr/local
bindir = $(prefix)/bin
binprefix =
ARFLAGS = rcs
RM = rm
RMFLAGS = -rf
INCLUDE = include
SOURCES = src
TOOLS = tools
CSFILES = $(wildcard $(SOURCES)/*.c)
OBFILES = $(patsubst %.c,%.o,$(CSFILES))
KERNEL := $(shell sh -c 'uname -s 2>/dev/null || echo unknown')
CFLAGS = -I/usr/local/opt/openssl/include -I$(INCLUDE)
LDFLAGS = -L/usr/local/opt/openssl/lib -pthread -lssl -lcrypto -lz
ifeq "$(KERNEL)" "Darwin"
LDFLAGS += -framework CoreFoundation -framework Security
endif
.PHONY: all clean install uninstall
all: $(TARGET)
$(TARGET): $(CSFILES)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
clean:
@cd $(TOOLS) && ./clean.sh
install:
@cd $(TOOLS) && ./install.sh
uninstall:
@cd $(TOOLS) && ./uninstall.sh