-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
49 lines (35 loc) · 1006 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
48
49
PREFIX = /usr/local
bindir = $(DESTDIR)$(PREFIX)/bin
include config.mk
-include $(DEPS)
OPT = -O2
WARN = -Wall -Wextra -pedantic
DEPSFLAGS = -MMD -MP
CFLAGS += -std=c99 $(OPT) -g -pipe -Werror=implicit $(DEFS) $(DEPSFLAGS)
LDLIBS += -lbearssl
LDFLAGS += $(CFLAGS) -Wl,--as-needed
PURROBJS = socket.o urls.o files.o comm.o formats.o encrypt.o mmap_file.o
PURROBJS += read_certs.o gemini.o pager.o compat.o
LIBSOBJS = $(PURROBJS)
FINAL = purr gemi tests
OBJS.purr = purr.o
OBJS.gemi = gemi.o
OBJS.tests = tests.o
OBJS = $(foreach var,$(FINAL),$(OBJS.$(var)))
DEPS = $(LIBSOBJS:.o=.d) $(OBJS:.o=.d)
.PHONY: all check check-net install clean
all: $(FINAL)
check: tests
./tests
check-net: tests
./test.sh
$(OBJS) $(PURROBJS): config.mk
$(OBJS) $(PURROBJS): CFLAGS += $(WARN)
$(FINAL): $(OBJS.$@) $(LIBSOBJS)
install: $(FINAL)
install -Dm755 purr $(bindir)
ln -sf purr $(bindir)/meow
ln -sf purr $(bindir)/meowd
install -m755 gemi $(bindir)
clean:
rm -f $(FINAL) $(OBJS) $(LIBSOBJS) $(DEPS)