-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
65 lines (50 loc) · 1.41 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
#
# GDBFrontendLive is a server that creates sharable GDBFrontend instances and provides online IDEs.
#
# https://github.com/rohanrhu/gdb-frontend-live
# https://oguzhaneroglu.com/projects/gdb-frontend-live/
#
# Licensed under GNU/GPLv3
# Copyright (C) 2020, Oğuzhan Eroğlu (https://oguzhaneroglu.com/) <[email protected]>
#
CC = gcc
CFLAGS = -std=c99 \
-fcommon \
-I. \
-g \
-luuid \
-lssl \
-lcrypto \
-lpthread \
-lm
LDFLAGS =
SOURCES = $(shell find . -wholename "./src/*.c")
HEADERS = $(shell find . -wholename "./include/*.h")
EXECUTABLES = server
OBJECTS = $(addprefix ./dist/, $(notdir $(filter-out ./src/server.o, $(SOURCES:.c=.o))))
RM = rm -rf
.PHONY: clean
all: server
dist:
mkdir -p dist/
server: dist $(OBJECTS) jsonic
$(CC) -o $@ src/server.c $(filter-out dist jsonic, $^) lib/jsonic/jsonic.o $(CFLAGS) $(LDFLAGS)
chmod +x server
$(RM) dist/
@echo "\033[32mExecutable: ./server is built.\033[0m"
dist/util.o:
$(CC) -c -o $@ src/util.c $(CFLAGS) $(LDFLAGS)
dist/instance.o:
$(CC) -c -o $@ src/instance.c $(CFLAGS) $(LDFLAGS)
dist/uniqid.o:
$(CC) -c -o $@ src/uniqid.c $(CFLAGS) $(LDFLAGS)
dist/arg.o:
$(CC) -c -o $@ src/arg.c $(CFLAGS) $(LDFLAGS)
dist/websocket.o:
$(CC) -c -o $@ src/websocket.c $(CFLAGS) $(LDFLAGS)
jsonic:
make -C lib/jsonic
clean:
make clean -C lib/jsonic
$(RM) dist/
$(RM) $(EXECUTABLES)