- some cleanups
- compatibility to strongswan, Makefile can be called by "make programs" and "make install" (ikev2 patch must be applied to strongswan)
This commit is contained in:
parent
4749578d9d
commit
e07d2dec73
|
@ -12,8 +12,18 @@
|
||||||
# for more details.
|
# for more details.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
FREESWANSRCDIR=../..
|
||||||
|
# include strongswan Makefile, if charon sits in its tree
|
||||||
|
ifeq ($(shell ls $(FREESWANSRCDIR)/Makefile.inc 2>&1), ../../Makefile.inc)
|
||||||
|
include ${FREESWANSRCDIR}/Makefile.inc
|
||||||
|
endif
|
||||||
|
|
||||||
BUILD_DIR= ./bin/
|
BUILD_DIR= ./bin/
|
||||||
|
|
||||||
|
BINNAMECHARON= $(BUILD_DIR)charon
|
||||||
|
BINNAMESTROKE= $(BUILD_DIR)stroke
|
||||||
|
BINNAMETEST= $(BUILD_DIR)run_tests
|
||||||
|
|
||||||
MAIN_DIR= ./
|
MAIN_DIR= ./
|
||||||
|
|
||||||
LDFLAGS= -lgmp -lpthread
|
LDFLAGS= -lgmp -lpthread
|
||||||
|
@ -23,9 +33,14 @@ CFLAGS+= -I. -Wall -g -DLEAK_DETECTIVE
|
||||||
# objects is extended by each included Makefile
|
# objects is extended by each included Makefile
|
||||||
OBJS=
|
OBJS=
|
||||||
|
|
||||||
all : build_dir $(BUILD_DIR)charon $(BUILD_DIR)run_tests
|
all : build_dir $(BINNAMECHARON) $(BINNAMESTROKE)
|
||||||
|
|
||||||
doxygen :
|
programs : all
|
||||||
|
|
||||||
|
test : build_dir $(BINNAMETEST)
|
||||||
|
$(BINNAMETEST)
|
||||||
|
|
||||||
|
apidoc :
|
||||||
doxygen Doxyfile
|
doxygen Doxyfile
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,28 +55,45 @@ include $(MAIN_DIR)utils/Makefile.utils
|
||||||
|
|
||||||
|
|
||||||
build_dir:
|
build_dir:
|
||||||
mkdir -p $(BUILD_DIR)
|
mkdir -p $(BUILD_DIR)
|
||||||
|
|
||||||
$(BUILD_DIR)daemon.o : daemon.c daemon.h
|
$(BUILD_DIR)daemon.o : daemon.c daemon.h
|
||||||
$(CC) $(CFLAGS) -c -o $@ $<
|
$(CC) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
OBJS+=$(BUILD_DIR)types.o
|
OBJS+=$(BUILD_DIR)types.o
|
||||||
$(BUILD_DIR)types.o : types.c types.h
|
$(BUILD_DIR)types.o : types.c types.h
|
||||||
$(CC) $(CFLAGS) -c -o $@ $<
|
$(CC) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
OBJS+=$(BUILD_DIR)definitions.o
|
OBJS+=$(BUILD_DIR)definitions.o
|
||||||
$(BUILD_DIR)definitions.o : definitions.c definitions.h
|
$(BUILD_DIR)definitions.o : definitions.c definitions.h
|
||||||
$(CC) $(CFLAGS) -c -o $@ $<
|
$(CC) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
$(BUILD_DIR)charon : $(OBJS) $(BUILD_DIR)daemon.o
|
$(BINNAMECHARON) : $(OBJS) $(BUILD_DIR)daemon.o
|
||||||
$(CC) $(LDFLAGS) $(OBJS) $(BUILD_DIR)daemon.o -o $@
|
$(CC) $(LDFLAGS) $(OBJS) $(BUILD_DIR)daemon.o -o $@
|
||||||
|
|
||||||
|
$(BINNAMESTROKE) : stroke.c
|
||||||
|
$(CC) $(LDFLAGS) $(CFLAGS) stroke.c -o $@
|
||||||
|
|
||||||
TEST_OBJS = $(OBJS)
|
TEST_OBJS = $(OBJS)
|
||||||
include $(MAIN_DIR)testcases/Makefile.testcases
|
include $(MAIN_DIR)testcases/Makefile.testcases
|
||||||
|
|
||||||
$(BUILD_DIR)run_tests : $(TEST_OBJS)
|
$(BUILD_DIR)run_tests : $(TEST_OBJS)
|
||||||
$(CC) $(LDFLAGS) $(TEST_OBJS) -o $@
|
$(CC) $(LDFLAGS) $(TEST_OBJS) -o $@
|
||||||
|
|
||||||
|
install : $(BINNAMECHARON)
|
||||||
|
$(INSTALL) $(INSTBINFLAGS) $(BINNAMECHARON) $(BINNAMESTROKE) $(LIBEXECDIR)
|
||||||
|
|
||||||
|
install_file_list:
|
||||||
|
@echo $(LIBEXECDIR)/charon
|
||||||
|
@echo $(LIBEXECDIR)/stroke
|
||||||
|
|
||||||
clean :
|
clean :
|
||||||
rm -f $(TEST_OBJS) $(BUILD_DIR)charon $(BUILD_DIR)run_tests $(BUILD_DIR)daemon.o; \
|
rm -fR $(BUILD_DIR); rm -Rf doc/api
|
||||||
rmdir --ignore-fail-on-non-empty $(BUILD_DIR)
|
|
||||||
|
cleanall: clean
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
|
||||||
|
mostlyclean: clean
|
||||||
|
|
||||||
|
realclean: clean
|
||||||
|
|
Loading…
Reference in New Issue