]>
git.ipfire.org Git - thirdparty/strongswan.git/blob - Source/Makefile
1 # Copyright (C) 2005 Jan Hutter, Martin Willi
2 # Hochschule fuer Technik Rapperswil
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>.
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
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
20 # Defaults if not using strongswan defines
21 USE_LEAK_DETECTIVE?
=false
23 INSTBINFLAGS
=-b
--suffix=.old
24 LIBEXECDIR
=/usr
/local
/libexec
/ipsec
25 SHAREDLIBDIR
=/usr
/local
/lib
31 BINNAMECHARON
= $(BUILD_DIR
)charon
32 BINNAMESTROKE
= $(BUILD_DIR
)stroke
33 BINNAMETEST
= $(BUILD_DIR
)run_tests
34 BINNAMELIB
= $(BUILD_DIR
)libstrongswan.so
38 CFLAGS
= -Icharon
-Ilib
-Istroke
-fPIC
-Wall
-g
39 ifeq ($(USE_LEAK_DETECTIVE
),true
)
40 CFLAGS
+= -DLEAK_DETECTIVE
43 # objects is extended by each included Makefile
50 include $(MAIN_DIR
)charon
/Makefile.charon
51 include $(MAIN_DIR
)lib
/Makefile.lib
52 include $(MAIN_DIR
)stroke
/Makefile.stroke
53 include $(MAIN_DIR
)testing
/Makefile.testcases
55 programs
: $(BINNAMECHARON
) $(BINNAMESTROKE
)
58 LD_LIBRARY_PATH
=$(BUILD_DIR
) $(BINNAMETEST
)
60 run
: $(BINNAMECHARON
)
61 LD_LIBRARY_PATH
=$(BUILD_DIR
) $(BINNAMECHARON
)
69 $(BINNAMELIB
) : build_dir
$(LIB_OBJS
)
70 $(CC
) -lpthread
-ldl
-lgmp
-shared
$(LIB_OBJS
) -o
$@
72 $(BINNAMECHARON
) : build_dir
$(CHARON_OBJS
) $(BINNAMELIB
) $(BUILD_DIR
)daemon.o
73 $(CC
) -L.
/bin
-lstrongswan
$(CHARON_OBJS
) $(BUILD_DIR
)daemon.o
-o
$@
75 $(BINNAMETEST
) : build_dir
$(CHARON_OBJS
) $(TEST_OBJS
) $(BINNAMELIB
) $(BUILD_DIR
)testcases.o
76 $(CC
) -L.
/bin
-lstrongswan
$(LDFLAGS
) $(CHARON_OBJS
) $(TEST_OBJS
) $(BUILD_DIR
)testcases.o
-o
$@
78 $(BINNAMESTROKE
) : build_dir
$(BINNAMELIB
) $(BUILD_DIR
)stroke.o
79 $(CC
) $(LDFLAGS
) $(CFLAGS
) $(BUILD_DIR
)stroke.o
-o
$@
81 install : $(BINNAMECHARON
) $(BINNAMESTROKE
)
82 $(INSTALL
) $(INSTBINFLAGS
) $(BINNAMECHARON
) $(BINNAMESTROKE
) $(LIBEXECDIR
)
83 $(INSTALL
) $(INSTBINFLAGS
) $(BINNAMELIB
) $(SHAREDLIBDIR
)
86 @echo
$(LIBEXECDIR
)/charon
87 @echo
$(LIBEXECDIR
)/stroke
88 @echo
$(SHAREDLIBDIR
)/libstrongswan.so