-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (30 loc) · 1.14 KB
/
Copy pathMakefile
File metadata and controls
40 lines (30 loc) · 1.14 KB
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
CC ?= cc
CFLAGS ?= -std=c11 -Wall -Wextra -Wpedantic -O2
CPPFLAGS ?= -D_POSIX_C_SOURCE=200809L
LDFLAGS ?= -static
LDLIBS ?= -lutil
.PHONY: all clean test dist client-dist server-dist
all: remoted remoter
remoted: server.o common.o config.o
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
remoter: client.o common.o config.o
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
%.o: %.c common.h config.h
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
test: all
./tests/integration.sh
# Recreate each package from an explicit allowlist. Empty the existing package
# first while preserving its directory.
client-dist: remoter
mkdir -p dist/client
find dist/client -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +
cp remoter client.conf client-commands.conf dist/client/
server-dist: remoted
mkdir -p dist/server
find dist/server -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +
cp remoted server.conf server-commands.conf dist/server/
dist: client-dist server-dist
clean:
rm -f remoted remoter *.o
if [ -d dist/client ]; then find dist/client -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +; fi
if [ -d dist/server ]; then find dist/server -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +; fi