-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (38 loc) · 1.55 KB
/
Copy pathMakefile
File metadata and controls
48 lines (38 loc) · 1.55 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
41
42
43
44
45
46
47
48
INCLUDES+=-Iinclude/ -Idist/mbedtls/include -Idist/inih -Idist/libspf2/src/include
LIBS=-lpthread -Ldist/ -lmbedtls -lmbedcrypto -lmbedx509 -linih -lspf2 -l:libresolv.a
CFLAGS+=$(INCLUDES) -Wall -Werror -Wextra -std=c99 -pedantic -D_DEFAULT_SOURCE -D_GNU_SOURCE
CFLAGS+=-DUSE_PTHREADS
OBJ=objs/server.o objs/logger.o objs/networker.o objs/serworker.o objs/net.o
OBJ+=objs/smtp.o objs/mail.o objs/mail_serialize.o
OUTPUT=barid
default: $(OUTPUT)
################################################################################
# SOURCES STUFF #
################################################################################
dist/libmbedtls.a:
-@git submodule update --init --recursive
cd dist/mbedtls; scripts/config.pl set MBEDTLS_THREADING_C; scripts/config.pl set MBEDTLS_THREADING_PTHREAD;
$(MAKE) lib -C dist/mbedtls
cp dist/mbedtls/library/*.a dist/
dist/libspf2.a:
-@git submodule update --init --recursive
cd dist/libspf2; ./configure
$(MAKE) -C dist/libspf2
cp dist/libspf2/src/libspf2/.libs/libspf2.a dist/
dist/libinih.a:
-@git submodule update --init --recursive
cd dist/inih; $(CC) -c -o ini.o ini.c $(CFLAGS) $(EXTRA)
ar rcs dist/libinih.a dist/inih/ini.o
objs/%.o: src/%.c
@mkdir -p objs/
$(CC) -c -o $@ $< $(CFLAGS) $(EXTRA)
$(OUTPUT): dist/libmbedtls.a dist/libspf2.a dist/libinih.a $(OBJ)
$(CC) $(OBJ) -o $@ $(LIBS) $(CFLAGS)
.PHONY: debug
debug: CFLAGS += -g -O0
debug: $(OUTPUT)
debug: CFLAGS+=-g -O0 -DUSE_PTHREADS -DDEBUG
.PHONY: clean
clean:
-rm -f $(OBJ)
-rm -f $(OUTPUT)