-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (42 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
#
# Makefile
# =============================================================================
# Urban bus routing microservice prototype (C port). Version 0.3.1
# =============================================================================
# A daemon written in C (GNOME/libsoup), designed and intended to be run
# as a microservice, implementing a simple urban bus routing prototype.
# =============================================================================
# Copyright (C) 2023-2024 Radislav (Radicchio) Golubtsov
#
# (See the LICENSE file at the top of the source tree.)
#
BIN_DIR = bin
SRC_DIR = src
PREF = bus
EXEC = $(BIN_DIR)/$(PREF)d
DEPS = $(SRC_DIR)/$(PREF)-core.o \
$(SRC_DIR)/$(PREF)-controller.o \
$(SRC_DIR)/$(PREF)-handler.o \
$(SRC_DIR)/$(PREF)-helper.o
# Specify flags and other vars here.
CSTD = c99
CFLAGS = -Wall -std=$(CSTD) -march=x86-64 -O3 -pipe -c
MKDIR = mkdir
RMFLAGS = -vR
CFLAGS += `pkg-config --cflags-only-I libsoup-3.0 json-glib-1.0`
LDLIBS = `pkg-config --libs-only-l libsoup-3.0 json-glib-1.0`
LDFLAGS = -o $(EXEC)
# Making the first target (object files).
%.o: %.c
$(CC) $(CFLAGS) $< -o $@
# Making the second target (the microservice itself).
$(EXEC): $(DEPS)
if [ ! -d $(BIN_DIR) ]; then \
$(MKDIR) $(BIN_DIR); \
fi
tcc $(LDLIBS) $(LDFLAGS) $(DEPS)
.PHONY: all clean
all: $(EXEC)
clean:
$(RM) $(RMFLAGS) $(BIN_DIR) $(DEPS)
# vim:set nu et ts=4 sw=4: