- fixed doxygen build
[strongswan.git] / Source / 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 FREESWANSRCDIR=../..
16 # include strongswan Makefile, if charon sits in its tree
17 ifeq ($(shell ls $(FREESWANSRCDIR)/Makefile.inc 2>&1), ../../Makefile.inc)
18 include ${FREESWANSRCDIR}/Makefile.inc
19 endif
20
21 BUILD_DIR= ./bin/
22
23 BINNAMECHARON= $(BUILD_DIR)charon
24 BINNAMESTROKE= $(BUILD_DIR)stroke
25 BINNAMETEST= $(BUILD_DIR)run_tests
26 BINNAMELIB= $(BUILD_DIR)libstrongswan.so
27
28 MAIN_DIR= ./
29
30 CFLAGS= -Icharon -Ilib -Istroke -fPIC -Wall -g -DLEAK_DETECTIVE
31 #CFLAGS= -Icharon -Ilib -Istroke -fPIC -O3
32
33 # objects is extended by each included Makefile
34 CHARON_OBJS=
35 LIB_OBJS=
36 TEST_OBJS=
37
38 all : programs
39
40 include $(MAIN_DIR)charon/Makefile.charon
41 include $(MAIN_DIR)lib/Makefile.lib
42 include $(MAIN_DIR)stroke/Makefile.stroke
43 include $(MAIN_DIR)testing/Makefile.testcases
44
45 programs : $(BINNAMECHARON) $(BINNAMESTROKE)
46
47 test : $(BINNAMETEST)
48 LD_LIBRARY_PATH=$(BUILD_DIR) $(BINNAMETEST)
49
50 run : $(BINNAMECHARON)
51 LD_LIBRARY_PATH=$(BUILD_DIR) $(BINNAMECHARON)
52
53 apidoc :
54 doxygen Doxyfile
55
56 build_dir:
57 mkdir -p $(BUILD_DIR)
58
59 $(BINNAMELIB) : build_dir $(LIB_OBJS)
60 $(CC) -ldl -lgmp -lpthread -shared $(LIB_OBJS) -o $@
61
62 $(BINNAMECHARON) : build_dir $(CHARON_OBJS) $(BINNAMELIB) $(BUILD_DIR)daemon.o
63 $(CC) -L./bin -lstrongswan $(CHARON_OBJS) $(BUILD_DIR)daemon.o -o $@
64
65 $(BINNAMETEST) : build_dir $(CHARON_OBJS) $(TEST_OBJS) $(BINNAMELIB) $(BUILD_DIR)testcases.o
66 $(CC) -L./bin -lstrongswan $(LDFLAGS) $(CHARON_OBJS) $(TEST_OBJS) $(BUILD_DIR)testcases.o -o $@
67
68 $(BINNAMESTROKE) : build_dir $(BINNAMELIB) $(BUILD_DIR)stroke.o
69 $(CC) $(LDFLAGS) $(CFLAGS) $(BUILD_DIR)stroke.o -o $@
70
71 install : $(BINNAMECHARON) $(BINNAMESTROKE)
72 $(INSTALL) $(INSTBINFLAGS) $(BINNAMECHARON) $(BINNAMESTROKE) $(LIBEXECDIR)
73 $(INSTALL) $(INSTBINFLAGS) $(BINNAMELIB) $(SHAREDLIBDIR)
74
75 install_file_list:
76 @echo $(LIBEXECDIR)/charon
77 @echo $(LIBEXECDIR)/stroke
78 @echo $(SHAREDLIBDIR)/libstrongswan.so
79
80 clean :
81 rm -fR $(BUILD_DIR)
82
83 cleanall: clean
84
85 distclean: clean
86
87 mostlyclean: clean
88
89 realclean: clean