diff options
-rw-r--r-- | CMakeLists.txt | 21 | ||||
-rw-r--r-- | Makefile | 56 | ||||
-rw-r--r-- | database/sqlite/CMakeLists.txt | 14 | ||||
-rw-r--r-- | database/sqlite/Makefile | 43 | ||||
-rw-r--r-- | firewall/iptables/CMakeLists.txt | 10 | ||||
-rw-r--r-- | firewall/iptables/Makefile | 33 |
6 files changed, 45 insertions, 132 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..ab013c0 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,21 @@ +PROJECT(eurephia C) +cmake_minimum_required(VERSION 2.6) +SET(eurephia_auth_SRC + certinfo.c + eurephia-auth.c + eurephia.c + eurephiadb.c + eurephiadb_session.c + eurephiafw.c + eurephiafw_helpers.c + eurephia_getsym.c + eurephia_log.c + eurephia_values.c + passwd.c + sha512.c +) +INCLUDE_DIRECTORIES(BEFORE ../../openvpn/openvpn-2.1_rc7 .) +ADD_LIBRARY(eurephia-auth MODULE ${eurephia_auth_SRC}) +SET_TARGET_PROPERTIES(eurephia-auth PROPERTIES OUTPUT_NAME eurephia-auth PREFIX "") +SUBDIRS(database/sqlite firewall/iptables) + diff --git a/Makefile b/Makefile deleted file mode 100644 index 48b868a..0000000 --- a/Makefile +++ /dev/null @@ -1,56 +0,0 @@ -topdir = . - -directories = database/sqlite firewall/iptables - -objs = eurephiadb.o eurephia_log.o eurephia_values.o eurephiadb_session.o sha512.o passwd.o \ - eurephia-auth.o eurephia.o certinfo.o eurephia_getsym.o eurephiafw.o eurephiafw_helpers.o - -#programs = eurephiadb-testprog -testprog_obj = eurephiadb-testprog.o eurephiadb.o eurephia_log.o sha512.o eurephiadb_session.o - -CFLAGS += -I. -LDFLAGS += -lpthread -lrt -lgcc_s -lcrypto - -ifeq (${EUREPHIAMW},enabled) - objs += memwatch.o - testprog_obj += memwatch.o - CFLAGS += -DMEMWATCH -endif - -ifeq (${DRIVERMW},enabled) - objs += memwatch.o -endif - -CFLAGS += -fPIC -LDFLAGS += -ldl - -include ${topdir}/Makefile.global - - -.PHONY : ${directories} - -all : -ifndef OPENVPN_SRC_DIR - @echo "Invokce with make OPENVPN_SRC_DIR=<path to openvpn source>" -else - make do-real-all -endif - - -do-real-all : ${objs} ${directories} eurephia-auth.so - -${directories} : - make -C $@ - -eurephia-auth.so : ${objs} - ${CC} -fPIC -g -shared -Wall ${LDFLAGS} -o $@ $^ - -eurephiadb-testprog : ${testprog_obj} - ${CC} -o $@ -g ${LDFLAGS} $^ - -clean : clean-dir - rm -f ${objs} *.so ${programs} memwatch.log *~ - -clean-dir : - @for i in ${directories} ; do make -C $$i clean ; done - diff --git a/database/sqlite/CMakeLists.txt b/database/sqlite/CMakeLists.txt new file mode 100644 index 0000000..83fb8fd --- /dev/null +++ b/database/sqlite/CMakeLists.txt @@ -0,0 +1,14 @@ +PROJECT(eurephiadb-sqlite C) +cmake_minimum_required(VERSION 2.6) +SET(eurephiadb_sqlite_SRC + ../../eurephia_log.c + ../../eurephiadb_session.c + ../..//eurephia_values.c + ../../passwd.c + ../../sha512.c + sqlite.c + eurephiadb-sqlite.c +) +INCLUDE_DIRECTORIES(BEFORE ../..) +ADD_LIBRARY(eurephiadb-sqlite MODULE ${eurephiadb_sqlite_SRC}) +SET_TARGET_PROPERTIES(eurephiadb-sqlite PROPERTIES OUTPUT_NAME eurephiadb-sqlite PREFIX "") diff --git a/database/sqlite/Makefile b/database/sqlite/Makefile deleted file mode 100644 index fd5bd31..0000000 --- a/database/sqlite/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -topdir = ../.. - -DRIVERVERSION=1.0 -DRIVERAPIVERSION=1 - -objs = eurephiadb-sqlite.o ../../eurephia_log.o ../../eurephiadb_session.o ../../eurephia_values.o ../../passwd.o ../../sha512.o sqlite.o - -driver=eurephiadb-sqlite.so - -include ${topdir}/Makefile.global - -LDFLAGS += -lsqlite3 -CFLAGS += -DDRIVERVERSION="\"${DRIVERVERSION}\"" -DDRIVERAPIVERSION=${DRIVERAPIVERSION} - -ifeq (${DRIVERMW},enabled) - objs += ${topdir}/memwatch.o - CFLAGS += -DMEMWATCH -endif - - -all : ${driver} ${DATABASE_NAME} - -sqlite : - ${CC} -o $@ sqlite.c ../../eurephia_log.o -DSQLITE_DEBUG=1 -DMEMWATCH ../../memwatch.c -lsqlite3 -g -Wall -I. -I../.. - -${driver} : ${objs} - ${CC} -fPIC -g -shared ${LDFLAGS} -o $@ $^ - -${DATABASE_NAME} : - rm -f eurephiadb - cat sql-schema.sql | sqlite3 $@ - - -install : all - mkdir -p -m 755 ${DRIVER_DIR} - install -m 755 ${driver} ${DRIVER_DIR}/ - if [ ! -f ${DATABASE_DIR}/${DATABASE_NAME} ]; then \ - install -m 644 ${DATABASE_NAME} ${DATABASE_DIR}/; \ - fi - -clean : - rm -f *.so *.o *~ memwatch.log ${DATABASE_NAME} - diff --git a/firewall/iptables/CMakeLists.txt b/firewall/iptables/CMakeLists.txt new file mode 100644 index 0000000..adbb168 --- /dev/null +++ b/firewall/iptables/CMakeLists.txt @@ -0,0 +1,10 @@ +PROJECT(eurephiafw-iptables C) +cmake_minimum_required(VERSION 2.6) +SET(efw_ipt_SRC + efw_iptables.c + ../../eurephia_log.c + ../../eurephiafw_helpers.c +) +INCLUDE_DIRECTORIES(BEFORE ../..) +ADD_LIBRARY(efw_iptables MODULE ${efw_ipt_SRC}) +SET_TARGET_PROPERTIES(efw_iptables PROPERTIES PREFIX "") diff --git a/firewall/iptables/Makefile b/firewall/iptables/Makefile deleted file mode 100644 index 1491abc..0000000 --- a/firewall/iptables/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -topdir = ../.. - -INTERFACEVER=1.0 -INTERFACEAPIVER=1 - -objs = efw_iptables.o ../../eurephia_log.o ../../eurephiafw_helpers.o - -interface = efw_iptables.so - -include ${topdir}/Makefile.global - -CFLAGS += -DINTERFACEVER="\"${INTERFACEVER}\"" -DINTERFACEAPIVER=${INTERFACEAPIVER} -LDFLAGS += -lpthread -lrt -lgcc_s - -ifeq (${DRIVERMW},enabled) - objs += ${topdir}/memwatch.o - CFLAGS += -DMEMWATCH -endif - - -all : ${interface} - -${interface} : ${objs} - ${CC} -fPIC -g -shared ${LDFLAGS} -o $@ $^ - - -install : all - mkdir -p -m 755 ${FW_INTERFACE_DIR} - install -m 755 ${interface} ${FW_INTERFACE_DIR}/ - -clean : - rm -f ${interface} ${objs} *~ memwatch.log - |