Implemented a more general Thread Worker pattern
[fmail.git] / Makefile
blobf747f8931e7b0cbad8ac7f27c2d010ab4651e20c
1 # This is the Makefile for fmail.
2 # Copyright (C) WANG Cong
3 # GPLv2 applied.
5 CC= g++
6 CFLAGS= -Wall -W -I./include -g
7 .PHONY: clean all debug
9 all: bin/libfmail.so bin/fmail-fsauth bin/fmail-fsmailbox bin/fmail-queue bin/fmail-pop3 bin/fmail-smtp
11 bin/baseserver.o: src/baseserver.cpp
12 mkdir -p bin
13 $(CC) $^ $(CFLAGS) -c -o $@
14 bin/socket.o: src/posixsocket.cpp
15 $(CC) $^ $(CFLAGS) -c -o $@
16 bin/ipcmsg.o: src/ipcmsg.cpp
17 $(CC) $^ $(CFLAGS) -c -o $@
18 bin/socketipc.o: src/socketipc.cpp
19 $(CC) $^ $(CFLAGS) -c -o $@
20 bin/ipc.o: src/ipc.cpp
21 $(CC) $^ $(CFLAGS) -c -o $@
22 bin/thread.o: src/posix-thread.cpp
23 $(CC) $^ $(CFLAGS) -c -o $@
24 bin/lock.o: src/posix-lock.cpp
25 $(CC) $^ $(CFLAGS) -c -o $@
26 bin/semaphore.o: src/posix-sem.cpp
27 $(CC) $^ $(CFLAGS) -c -o $@
28 bin/threadpool.o: src/threadpool.cpp
29 $(CC) $^ $(CFLAGS) -c -o $@
30 bin/configuration.o: src/configuration.cpp
31 $(CC) $^ $(CFLAGS) -c -o $@
32 bin/worker.o: src/worker.cpp
33 $(CC) $^ $(CFLAGS) -c -o $@
34 bin/libfmail.so: bin/baseserver.o bin/socket.o bin/socketipc.o bin/ipc.o bin/ipcmsg.o bin/lock.o bin/thread.o bin/threadpool.o bin/semaphore.o bin/configuration.o bin/worker.o
35 $(CC) $^ -lpthread -lpcrecpp -lstdc++ -shared -o $@
37 #echo "Compiling Testcases"
38 #$(CC) testcase/ipctest.cpp -lfmail -g -I./include -L./bin -o bin/ipctest
39 #$(CC) testcase/ipccommand.cpp -lfmail -g -I./include -L./bin -o bin/ipccommand
41 bin/fmail-fsauth: backends/auth/fsauth.cpp
42 $(CC) $^ -lstdc++ -L./bin -lfmail $(CFLAGS) -o $@
43 bin/fmail-fsmailbox: backends/mailbox/fsmailbox.cpp
44 $(CC) $^ -lstdc++ -L./bin -lfmail $(CFLAGS) -o $@
45 bin/fmail-queue: backends/queue/queueman.cpp
46 $(CC) $^ -lstdc++ -L./bin -lfmail $(CFLAGS) -o $@
47 bin/fmail-pop3: backends/protocol/pop3.cpp
48 $(CC) $^ -L./bin -lfmail -lstdc++ -lpcrecpp $(CFLAGS) -o $@
49 bin/fmail-smtp: backends/protocol/smtp.cpp
50 $(CC) $^ -L./bin -lfmail -lstdc++ -lpcrecpp $(CFLAGS) -o $@
52 clean:
53 rm -fr bin
54 debug: bin/libfmail.so bin/fmail-fsauth.debug bin/fmail-fsmailbox.debug bin/fmail-queue.debug bin/fmail-pop3.debug bin/fmail-smtp.debug
57 bin/fmail-fsauth.debug: backends/auth/fsauth.cpp
58 $(CC) $^ -lstdc++ -L./bin -lfmail -ggdb $(CFLAGS) -o $@
59 bin/fmail-fsmailbox.debug: backends/mailbox/fsmailbox.cpp
60 $(CC) $^ -lstdc++ -L./bin -lfmail -ggdb $(CFLAGS) -o $@
61 bin/fmail-queue.debug: backends/queue/queueman.cpp
62 $(CC) $^ -lstdc++ -L./bin -lfmail -ggdb $(CFLAGS) -o $@
63 bin/fmail-pop3.debug: backends/protocol/pop3.cpp
64 $(CC) $^ -L./bin -lfmail -lstdc++ -lpcrecpp -ggdb $(CFLAGS) -o $@
65 bin/fmail-smtp.debug: backends/protocol/smtp.cpp
66 $(CC) $^ -L./bin -lfmail -lstdc++ -lpcrecpp -ggdb $(CFLAGS) -o $@