a726bba8e42038841c9c8e21bfe51125d8ff6b07
[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 #-Werror
25
26 # objects is extended by each included Makefile
27 OBJS=
28
29 all : build_dir $(BUILD_DIR)charon $(BUILD_DIR)run_tests
30
31 doxygen :
32 doxygen Doxyfile
33
34
35 include $(MAIN_DIR)network/Makefile.network
36 include $(MAIN_DIR)config/Makefile.config
37 include $(MAIN_DIR)encoding/Makefile.encoding
38 include $(MAIN_DIR)queues/Makefile.queues
39 include $(MAIN_DIR)sa/Makefile.sa
40 include $(MAIN_DIR)threads/Makefile.threads
41 include $(MAIN_DIR)transforms/Makefile.transforms
42 include $(MAIN_DIR)utils/Makefile.utils
43
44
45 build_dir:
46 mkdir -p $(BUILD_DIR)
47
48 $(BUILD_DIR)daemon.o : daemon.c daemon.h
49 $(CC) $(CFLAGS) -c -o $@ $<
50
51 OBJS+=$(BUILD_DIR)types.o
52 $(BUILD_DIR)types.o : types.c types.h
53 $(CC) $(CFLAGS) -c -o $@ $<
54
55 OBJS+=$(BUILD_DIR)definitions.o
56 $(BUILD_DIR)definitions.o : definitions.c definitions.h
57 $(CC) $(CFLAGS) -c -o $@ $<
58
59 $(BUILD_DIR)charon : $(OBJS) $(BUILD_DIR)daemon.o
60 $(CC) $(LDFLAGS) $(OBJS) $(BUILD_DIR)daemon.o -o $@
61
62 TEST_OBJS = $(OBJS)
63 include $(MAIN_DIR)testcases/Makefile.testcases
64
65 $(BUILD_DIR)run_tests : $(TEST_OBJS)
66 $(CC) $(LDFLAGS) $(TEST_OBJS) -o $@
67
68 clean :
69 rm -f $(TEST_OBJS) $(BUILD_DIR)charon $(BUILD_DIR)run_tests $(BUILD_DIR)daemon.o; \
70 rmdir --ignore-fail-on-non-empty $(BUILD_DIR)