Applied a slightly modified version of WANG Cong patch: fix ipcmsg bugs and cleanups.
[fmail.git] / Makefile
blob1e4d7c9d6143f2084257d47c992d708ce5494a24
1 # This is the Makefile for fmail.
2 # Copyright (C) WANG Cong
3 # GPLv2 applied.
5 CC= g++
6 CFLAGS= -Wall -W -I./include
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/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
33 $(CC) $^ -lpthread -lpcrecpp -lstdc++ -shared -o $@
35 #echo "Compiling Testcases"
36 #$(CC) testcase/ipctest.cpp -lfmail -g -I./include -L./bin -o bin/ipctest
37 #$(CC) testcase/ipccommand.cpp -lfmail -g -I./include -L./bin -o bin/ipccommand
39 bin/fmail-fsauth: backends/auth/fsauth.cpp
40 $(CC) $^ -lstdc++ -L./bin -lfmail $(CFLAGS) -o $@
41 bin/fmail-fsmailbox: backends/mailbox/fsmailbox.cpp
42 $(CC) $^ -lstdc++ -L./bin -lfmail $(CFLAGS) -o $@
43 bin/fmail-queue: backends/queue/queueman.cpp
44 $(CC) $^ -lstdc++ -L./bin -lfmail $(CFLAGS) -o $@
45 bin/fmail-pop3: backends/protocol/pop3.cpp
46 $(CC) $^ -L./bin -lfmail -lstdc++ -lpcrecpp $(CFLAGS) -o $@
47 bin/fmail-smtp: backends/protocol/smtp.cpp
48 $(CC) $^ -L./bin -lfmail -lstdc++ -lpcrecpp $(CFLAGS) -o $@
50 clean:
51 rm -fr bin
52 debug: bin/libfmail.so bin/fmail-fsauth.debug bin/fmail-fsmailbox.debug bin/fmail-queue.debug bin/fmail-pop3.debug bin/fmail-smtp.debug
55 bin/fmail-fsauth.debug: backends/auth/fsauth.cpp
56 $(CC) $^ -lstdc++ -L./bin -lfmail -ggdb $(CFLAGS) -o $@
57 bin/fmail-fsmailbox.debug: backends/mailbox/fsmailbox.cpp
58 $(CC) $^ -lstdc++ -L./bin -lfmail -ggdb $(CFLAGS) -o $@
59 bin/fmail-queue.debug: backends/queue/queueman.cpp
60 $(CC) $^ -lstdc++ -L./bin -lfmail -ggdb $(CFLAGS) -o $@
61 bin/fmail-pop3.debug: backends/protocol/pop3.cpp
62 $(CC) $^ -L./bin -lfmail -lstdc++ -lpcrecpp -ggdb $(CFLAGS) -o $@
63 bin/fmail-smtp.debug: backends/protocol/smtp.cpp
64 $(CC) $^ -L./bin -lfmail -lstdc++ -lpcrecpp -ggdb $(CFLAGS) -o $@