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
23 BINNAMECHARON
= $(BUILD_DIR
)charon
24 BINNAMESTROKE
= $(BUILD_DIR
)stroke
25 BINNAMETEST
= $(BUILD_DIR
)run_tests
26 BINNAMELIB
= $(BUILD_DIR
)libstrong.so
30 LDFLAGS
= -ldl
-lgmp
-lpthread
-rdynamic
32 CFLAGS
= -Icharon
-Ilib
-Istroke
-Wall
-g
-fPIC
-fomit-frame-pointer
-DLEAK_DETECTIVE
34 # objects is extended by each included Makefile
41 include $(MAIN_DIR
)charon
/Makefile.charon
42 include $(MAIN_DIR
)lib
/Makefile.lib
43 include $(MAIN_DIR
)stroke
/Makefile.stroke
44 include $(MAIN_DIR
)testing
/Makefile.testcases
46 programs
: $(BINNAMECHARON
) $(BINNAMESTROKE
)
49 LD_LIBRARY_PATH
=$(BUILD_DIR
) $(BINNAMETEST
)
51 run
: $(BINNAMECHARON
)
52 LD_LIBRARY_PATH
=$(BUILD_DIR
) $(BINNAMECHARON
)
60 $(BINNAMELIB
) : build_dir
$(LIB_OBJS
)
61 $(CC
) -shared
$(LIB_OBJS
) -o
$@
63 $(BINNAMECHARON
) : build_dir
$(CHARON_OBJS
) $(BINNAMELIB
) $(BUILD_DIR
)daemon.o
64 $(CC
) -ldl
-lgmp
-rdynamic
-L.
/bin
-lstrong
-lpthread
$(CHARON_OBJS
) $(BUILD_DIR
)daemon.o
-o
$@
66 $(BINNAMETEST
) : build_dir
$(CHARON_OBJS
) $(TEST_OBJS
) $(BINNAMELIB
) $(BUILD_DIR
)testcases.o
67 $(CC
) -L.
/bin
-lstrong
$(LDFLAGS
) $(CHARON_OBJS
) $(TEST_OBJS
) $(BUILD_DIR
)testcases.o
-o
$@
69 $(BINNAMESTROKE
) : build_dir
$(BINNAMELIB
) $(BUILD_DIR
)stroke.o
70 $(CC
) $(LDFLAGS
) $(CFLAGS
) $(BUILD_DIR
)stroke.o
-o
$@
72 install : $(BINNAMECHARON
) $(BINNAMESTROKE
)
73 $(INSTALL
) $(INSTBINFLAGS
) $(BINNAMECHARON
) $(BINNAMESTROKE
) $(LIBEXECDIR
)
76 @echo
$(LIBEXECDIR
)/charon
77 @echo
$(LIBEXECDIR
)/stroke