1491efcc2033964cd23fbda71f19d032e05a8632
[strongswan.git] / Source / charon / Makefile
1 # Copyright (C) 2005 Jan Hutter, Martin Willi
2 # Hochschule fuer Technik Rapperswil
3 #
4 # This program is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU General Public License as published by the
6 # Free Software Foundation; either version 2 of the License, or (at your
7 # option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 # for more details.
13 #
14
15 BUILD_DIR= ./bin/
16
17 MAIN_DIR= ./
18
19 LDFLAGS= -lgmp -lpthread
20
21 CFLAGS+= -Wall \
22 -DLEAK_DETECTIVE \
23 -I. \
24 -g
25
26 # -Werror
27
28 # objects is extended by each included Makefile
29 OBJS=
30
31 all : build_dir $(BUILD_DIR)charon $(BUILD_DIR)run_tests
32
33 daemon : $(BUILD_DIR)charon
34
35 testcases : $(BUILD_DIR)run_tests
36
37 doxygen :
38 doxygen Doxyfile
39
40
41 include $(MAIN_DIR)network/Makefile.network
42 include $(MAIN_DIR)config/Makefile.config
43 include $(MAIN_DIR)encoding/Makefile.encoding
44 include $(MAIN_DIR)queues/Makefile.queues
45 include $(MAIN_DIR)sa/Makefile.sa
46 include $(MAIN_DIR)threads/Makefile.threads
47 include $(MAIN_DIR)transforms/Makefile.transforms
48 include $(MAIN_DIR)utils/Makefile.utils
49
50
51 build_dir:
52 mkdir -p $(BUILD_DIR)
53
54 $(BUILD_DIR)daemon.o : daemon.c daemon.h
55 $(CC) $(CFLAGS) -c -o $@ $<
56
57 OBJS+=$(BUILD_DIR)types.o
58 $(BUILD_DIR)types.o : types.c types.h
59 $(CC) $(CFLAGS) -c -o $@ $<
60
61 OBJS+=$(BUILD_DIR)definitions.o
62 $(BUILD_DIR)definitions.o : definitions.c definitions.h
63 $(CC) $(CFLAGS) -c -o $@ $<
64
65 $(BUILD_DIR)charon : $(OBJS) $(BUILD_DIR)daemon.o
66 $(CC) $(LDFLAGS) $(OBJS) $(BUILD_DIR)daemon.o -o $@
67
68 TEST_OBJS = $(OBJS)
69 include $(MAIN_DIR)testcases/Makefile.testcases
70
71 $(BUILD_DIR)run_tests : $(TEST_OBJS)
72 $(CC) $(LDFLAGS) $(TEST_OBJS) -o $@
73
74 clean :
75 rm -f $(TEST_OBJS) $(BUILD_DIR)charon $(BUILD_DIR)run_tests $(BUILD_DIR)daemon.o; \
76 rmdir $(BUILD_DIR)