-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
37 lines (32 loc) · 960 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
CC=gcc
CFLAGS=-lpthread -lssl -lcrypto --std=gnu99 -I/usr/include/openssl/
SRC=src
BIN=build
CONF=conf
WS=-lwebsockets
# Check for Linux environment
ENV:=$(shell uname -s | cut -d _ -f1)
define os_check =
$(if $(filter-out $(ENV), Linux), exit 1)
endef
all:
$(os_check)
@echo Starting shhchat build
rm -rf $(BIN)
mkdir -p $(BIN)/$(CONF)
$(CC) -o $(BIN)/shhchatd $(SRC)/shhchatd/server.c $(CFLAGS) $(WS) -DVERSION='"_beta"'
$(CC) -o $(BIN)/shhclient $(SRC)/chatclient/client.c $(CFLAGS) -DVERSION='"_beta"'
cp $(CONF)/* -t $(BIN)/$(CONF)
@echo Finished shhchat build
clean:
rm -f $(BIN)/shhchatd $(BIN)/shhclient
@echo Finished clean
debug:
$(os_check)
@echo Starting shhchat build
rm -rf $(BIN)
mkdir -p $(BIN)/$(CONF)
$(CC) -o $(BIN)/shhchatd $(SRC)/shhchatd/server.c $(CFLAGS) $(WS) -DDEBUG -g
$(CC) -o $(BIN)/shhclient $(SRC)/chatclient/client.c $(CFLAGS) -DDEBUG -g
cp $(CONF)/* -t $(BIN)/$(CONF)
@echo Finished shhchat debug build