Browse Source

remove Makefile-old, Makefile.conf-old, Makefile.Linux

Release_2.1
roker 5 months ago
parent
commit
2955c4f102
3 changed files with 0 additions and 526 deletions
  1. +0
    -172
      server/Makefile-old
  2. +0
    -191
      server/Makefile.Linux
  3. +0
    -163
      server/Makefile.conf-old

+ 0
- 172
server/Makefile-old View File

@ -1,172 +0,0 @@
# Copyright 2017 pEp Security SA
#
# This file is part of pEp JSON Server Adapter.
#
# pEp JSON Server Adapter is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License, version 3, as
# published by the Free Software Foundation.
#
# pEp JSON Server Adapter is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with pEp JSON Server Adapter. If not, see <http://www.gnu.org/licenses/>.
include Makefile.conf-old
ifneq ($(wildcard local.conf-old),)
$(info ================================================)
$(info Overrides in \`local.conf\` are used.)
$(info ================================================)
endif
ifdef BUILD_CONFIG
$(info ================================================)
$(info Overrides in \`$(BUILD_CONFIG)\` are used.)
$(info ================================================)
endif
# These source files shall _not_ be part of the libjson-adapter.a:
NO_SOURCE=$(wildcard mini-adapter-*.cc) servertest.cc $(wildcard unittest_*.cc) parse_mail.cc
ALL_SOURCE=$(filter-out $(NO_SOURCE),$(wildcard json_spirit/*.cpp))
ALL_SOURCE+= prefix-config.cc
ALL_SOURCE+= $(filter-out $(NO_SOURCE),$(wildcard *.cc))
DEPENDS0=$(subst .cpp,.d,$(ALL_SOURCE))
DEPENDS=$(subst .cc,.d,$(DEPENDS0))
ALL_OBJECTS0=$(subst .cpp,.o,$(ALL_SOURCE))
ALL_OBJECTS=$(subst .cc,.o,$(ALL_OBJECTS0))
ifeq ($(BUILD_FOR),Linux)
LIBPATH=LD_LIBRARY_PATH
else
LIBPATH=DYLD_LIBRARY_PATH
endif
ifeq ($(BUILD_FOR),Linux)
LD_EAGER_VAR=LD_BIND_NOW=placeholder
else
LD_EAGER_VAR=DYLD_BIND_AT_LAUNCH=placeholder
endif
# Create a list of the extra library paths for the loader.
# Note that += can not be used here, as it changes the amount of whitespace
EXTRA_LIB_PATHS=$(PREFIX)/lib:
ifdef BOOST_LIB
EXTRA_LIB_PATHS:=$(EXTRA_LIB_PATHS)$(patsubst -L%,%,$(BOOST_LIB)):
endif
ifdef ENGINE_LIB
EXTRA_LIB_PATHS:=$(EXTRA_LIB_PATHS)$(patsubst -L%,%,$(ENGINE_LIB)):
endif
ifdef ETPAN_LIB
EXTRA_LIB_PATHS:=$(EXTRA_LIB_PATHS)$(patsubst -L%,%,$(ETPAN_LIB)):
endif
ifdef GPGME_LIB
EXTRA_LIB_PATHS:=$(EXTRA_LIB_PATHS)$(patsubst -L%,%,$(GPGME_LIB)):
endif
ifdef UUID_LIB
EXTRA_LIB_PATHS:=$(EXTRA_LIB_PATHS)$(patsubst -L%,%,$(UUID_LIB)):
endif
# Remove trailing ':'
EXTRA_LIB_PATHS:=$(EXTRA_LIB_PATHS::=)
CMD_PFX=$(LIBPATH)=$(EXTRA_LIB_PATHS)
ifdef DEBUG
CMD_PFX+= $(LD_EAGER_VAR)
endif
.PHONY: all lib
all: $(TARGET) $(TARGET_TEST) $(TARGET_GTEST) parse_mail
lib: libjson-adapter.a
$(TARGET): mini-adapter-main.o mini-adapter-impl.o libjson-adapter.a
$(CXX) $(CPPFLAGS) $^ $(LDFLAGS) $(LDLIBS) -o $@
$(TARGET)-static: mini-adapter-main.o mini-adapter-impl.o libjson-adapter.a
$(CXX) $(CPPFLAGS) $(LDFLAGS) $^ \
/Users/lars/local/lib/libpEpEngine.a \
/Users/lars/local/lib/libpEpAdapter.a \
/Users/lars/local/lib/libetpan.a \
/Users/lars/hg/pEpEngine/asn.1/libasn1.a \
/usr/local/Cellar/libiconv/1.16/lib/libiconv.a \
/usr/local/lib/libboost_system-mt.a \
/usr/local/lib/libboost_filesystem-mt.a \
/usr/local/lib/libboost_program_options-mt.a \
/usr/local/lib/libboost_thread-mt.a \
/usr/local/lib/libboost_regex-mt.a /Users/lars/local/lib/libpEpwebserver.a \
/usr/local/Cellar/sqlite/3.33.0/lib/libsqlite3.a \
/usr/local/Cellar/zlib/1.2.11/lib/libz.a \
/usr/local/Cellar/libiconv/1.16/lib/libiconv.a \
/Users/lars/local/lib/libsequoia_ffi.a \
-o $@
$(TARGET_TEST): servertest.o libjson-adapter.a
$(CXX) $(CPPFLAGS) $^ $(LDFLAGS) $(LDLIBS) -o $@
$(TARGET_GTEST): unittest_json.o unittest_nfc.o unittest_decompose.o unittest_rpc.o \
unittest_logger.o unittest_pEp.o unittest_string.o \
gtest-all.o gtest_main.o libjson-adapter.a
$(CXX) $(CPPFLAGS) $^ $(LDFLAGS) $(LDLIBS) -o $@
parse_mail: parse_mail.o libjson-adapter.a
$(CXX) $(CPPFLAGS) $^ $(LDFLAGS) $(LDLIBS) -o $@
libjson-adapter.a: $(ALL_OBJECTS)
$(AR) rcs $@ $^
gtest-all.o: $(GTEST_DIR)/src/gtest-all.cc
$(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -o $@ -c $<
gtest_main.o: $(GTEST_DIR)/src/gtest_main.cc
$(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -o $@ -c $<
%.o: %.cc %.hh
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $<
%.d: %.cpp
@set -e; rm -f $@; \
$(CXX) -MM $(CPPFLAGS) $(CXXFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
%.d: %.cc
@set -e; rm -f $@; \
$(CXX) -MM $(CPPFLAGS) $(CXXFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
# If only the goal 'clean' is given, do not generate and include the '%.d' files.
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPENDS)
endif
.PHONY: install
install: all
mkdir -v -p "$(PREFIX)/bin" "$(PREFIX)/lib"
mkdir -v -p "$(HTML_DIRECTORY)"
cp -v ../html/* "$(HTML_DIRECTORY)"
cp -v libjson-adapter.a "$(PREFIX)/lib"
cp -v "$(TARGET)" "$(TARGET_TEST)" "$(TARGET_GTEST)" "$(PREFIX)/bin"
.PHONY: clean
clean:
rm -vf "$(TARGET)" "$(TARGET_TEST)" "$(TARGET_GTEST)" parse_mail
rm -vf *.o json_spirit/*.o
rm -vf *.a json_spirit/*.a
rm -vf *.d json_spirit/*.d
.PHONY: run
run:
@echo "The adapter must be installed for $< to work"
$(CMD_PFX) "$(PREFIX)/bin/$(TARGET)"
.PHONY: test
test:
@echo "The adapter must be installed for $< to work"
$(CMD_PFX) "$(PREFIX)/bin/$(TARGET_TEST)"
$(CMD_PFX) "$(PREFIX)/bin/$(TARGET_GTEST)"

+ 0
- 191
server/Makefile.Linux View File

@ -1,191 +0,0 @@
# this ifeq is not optional, because otherwise local.conf would always be built
ifeq ($(wildcard local.conf),local.conf)
-include local.conf
endif
# default config
# path to installed libraries
PREFIX=$(HOME)/local
PEP_INCLUDE=$(PREFIX)/include
LIBRARY_PATH=$(PREFIX)/lib
BOOST_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
AR?=ar
CC?=cc
CXX?=c++
CFLAGS+=-std=c14
CXXFLAGS+=-I$(PEP_INCLUDE) -I$(GTEST_DIR)/include -std=c++14
LDFLAGS+=-std=c++14
ifdef NDEBUG
CFLAGS+=-O3 -DNDEBUG -fvisibility=hidden -fno-stack-check
CXXFLAGS+=-O3 -DNDEBUG -fvisibility=hidden -fno-stack-check
else
CFLAGS+=-O0 -g -DDEBUG_ENABLED -fvisibility=hidden -fno-stack-check
CXXFLAGS+=-O0 -g -DDEBUG_ENABLED -fvisibility=hidden -fno-stack-check
endif
TARGET=pEp-mini-json-adapter
LIB_TARGET=libjson-adapter.a
ALL_SOURCE=$(filter-out unittest_%.cc,$(wildcard *.cc))
LIB_SOURCE=$(filter-out mini-adapter-%.cc,$(ALL_SOURCE))
MA_SOURCE=$(wildcard mini-adapter-*.cc)
DEPENDS=$(subst .cc,.d,$(ALL_SOURCE))
ALL_OBJECTS=$(subst .d,.o,$(DEPENDS))
LIB_OBJECTS=$(subst .cc,.o,$(LIB_SOURCE))
MA_OBJECTS=$(subst .cc,.o,$(MA_SOURCE))
SPIRIT_SOURCE=$(wildcard json_spirit/*.cpp)
SPIRIT_OBJECTS=$(subst .cpp,.o,$(SPIRIT_SOURCE))
GTEST_SOURCE=$(wildcard unittest_*.cc)
GTEST_OBJECTS=$(subst .cc,.o,$(TEST_SOURCE))
# Filename of the unittest binary
TARGET_GTEST=unittests
all: $(TARGET) $(TARGET_GTEST)
%.d: %.cc
@set -e; rm -f $@; \
$(CC) -MM $(CPPFLAGS) $(CFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
# If only the goal 'clean' is given, do not generate and include the '%.d' files.
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPENDS)
endif
$(LIB_TARGET): $(LIB_OBJECTS)
$(AR) -cr $@ $^
$(TARGET): $(LIB_TARGET) $(MA_OBJECTS) $(SPIRIT_OBJECTS)
$(CXX) -static $(LDFLAGS) \
$(MA_OBJECTS) $(SPIRIT_OBJECTS) $(LIB_TARGET) \
$(LIBRARY_PATH)/libpEpEngine.a \
$(LIBRARY_PATH)/libpEpAdapter.a \
$(LIBRARY_PATH)/libpEpwebserver.a \
$(BOOST_LIBRARY_PATH)/libboost_filesystem$(BOOST_MT).a \
$(BOOST_LIBRARY_PATH)/libboost_program_options$(BOOST_MT).a \
$(BOOST_LIBRARY_PATH)/libboost_system$(BOOST_MT).a \
$(BOOST_LIBRARY_PATH)/libboost_thread$(BOOST_MT).a \
$(BOOST_LIBRARY_PATH)/libboost_regex$(BOOST_MT).a \
$(LIBRARY_PATH)/libsequoia_openpgp_ffi.a \
$(LIBRARY_PATH)/libetpan.a \
$(LIBRARY_PATH)/libasn1.a \
/usr/lib/x86_64-linux-gnu/liblockfile.a \
/usr/lib/x86_64-linux-gnu/libz.a \
/usr/lib/x86_64-linux-gnu/libsqlite3.a \
/usr/lib/x86_64-linux-gnu/libhogweed.a \
/usr/lib/x86_64-linux-gnu/libnettle.a \
/usr/lib/x86_64-linux-gnu/libgmp.a \
/usr/lib/x86_64-linux-gnu/libpthread.a \
/usr/lib/x86_64-linux-gnu/libuuid.a \
/usr/lib/x86_64-linux-gnu/libdl.a \
/usr/lib/x86_64-linux-gnu/libc.a \
-o "$@"
%.o: %.cc
$(CXX) $(CXXFLAGS) -c -o $@ $^
gtest-all.o: $(GTEST_DIR)/src/gtest-all.cc
$(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -o $@ -c $<
gtest_main.o: $(GTEST_DIR)/src/gtest_main.cc
$(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -o $@ -c $<
$(TARGET_GTEST): unittest_json.o unittest_nfc.o unittest_decompose.o unittest_rpc.o \
unittest_logger.o unittest_pEp.o unittest_string.o \
gtest-all.o gtest_main.o libjson-adapter.a
$(CXX) $(CPPFLAGS) $^ $(LDFLAGS) $(LDLIBS) -o $@
.PHONY: clean uninstall install
install: $(TARGET)
mkdir -p $(PREFIX)/include/pEp
cp -v *.hh $(PREFIX)/include/pEp
cp -v lib*.a $(PREFIX)/lib/
uninstall:
for i in *.hh; do rm -f $(PREFIX)/include/pEp/\$i ; done
clean:
rm -vf *.o *.d *.d.* $(TARGET) $(TESTS)
local.conf:
@echo "# the following are directories with the source build" >> local.conf
@echo "# ---------------------------------------------------" >> local.conf
@echo >> local.conf
@echo "# path to pEp webserver" >> local.conf
@echo >> local.conf
@echo "PEP_WEBSERVER=$(PEP_WEBSERVER)" >> local.conf
@echo >> local.conf
@echo "# path to pEp adapter library" >> local.conf
@echo >> local.conf
@echo "PEP_ADAPTER_LIBRARY=$(PEP_ADAPTER_LIBRARY)" >> local.conf
@echo >> local.conf
@echo "# path to pEp engine" >> local.conf
@echo >> local.conf
@echo "PEP_ENGINE=$(PEP_ENGINE)" >> local.conf
@echo >> local.conf
@echo "# path to fdik fork of libetpan" >> local.conf
@echo >> local.conf
@echo "LIBETPAN_FDIK=$(LIBETPAN_FDIK)" >> local.conf
@echo >> local.conf
@echo "# path to Sequoia PGP" >> local.conf
@echo >> local.conf
@echo "SEQUOIA_PGP=$(SEQUOIA_PGP)" >> local.conf
@echo >> local.conf
@echo "# path to nettle and hogweed crypto libraries" >> local.conf
@echo >> local.conf
@echo "NETTLE=$(NETTLE)" >> local.conf
@echo >> local.conf
@echo "# path where to find boost" >> local.conf
@echo >> local.conf
@echo "BOOST_INCLUDE_PATH=$(BOOST_INCLUDE_PATH)" >> local.conf
@echo "BOOST_LIBRARY_PATH=$(BOOST_LIBRARY_PATH)" >> local.conf
@echo >> local.conf
@echo >> local.conf
@echo "# these are installation directories" >> local.conf
@echo "# ----------------------------------" >> local.conf
@echo >> local.conf
@echo "# pEp installation header file directory" >> local.conf
@echo >> local.conf
@echo "PEP_INCLUDE=$(PEP_INCLUDE)" >> local.conf
@echo >> local.conf
@echo "# path where to find GMP" >> local.conf
@echo >> local.conf
@echo "GMP_LIBRARY_PATH=$(GMP_LIBRARY_PATH)" >> local.conf
@echo >> local.conf
@echo "# path where to find SQLite3" >> local.conf
@echo >> local.conf
@echo "SQLITE3_LIBRARY_PATH=$(SQLITE3_LIBRARY_PATH)" >> local.conf
@echo >> local.conf
@echo "# path where to find libz" >> local.conf
@echo >> local.conf
@echo "LIBZ_LIBRARY_PATH=$(LIBZ_LIBRARY_PATH)" >> local.conf
@echo >> local.conf
@echo "# path where to find GNU iconv" >> local.conf
@echo >> local.conf
@echo "ICONV_LIBRARY_PATH=$(ICONV_LIBRARY_PATH)" >> local.conf
help:
@echo "usage:"
@echo " make local.conf # optional"
@echo " generate a local.conf with default paths"
@echo
@echo " make libjson-adapter.a"
@echo " build adapter library"
@echo
@echo " make pEp-mini-json-adapter # default"
@echo " compile and link mini adapter"
@echo

+ 0
- 163
server/Makefile.conf-old View File

@ -1,163 +0,0 @@
# Copyright 2017 pEp Security SA
#
# This file is part of pEp JSON Server Adapter.
#
# pEp JSON Server Adapter is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License, version 3, as
# published by the Free Software Foundation.
#
# pEp JSON Server Adapter is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with pEp JSON Server Adapter. If not, see <http://www.gnu.org/licenses/>.
HERE:=$(dir $(lastword $(MAKEFILE_LIST)))
######### General #########
BUILD_ON:=$(shell uname)
# This variable specifies the platform that the engine should be cross-compiled for.
BUILD_FOR=$(BUILD_ON)
# Cross-compiling is currently not supported.
# Maybe you can hack something with `local.conf`.
ifneq ($(BUILD_ON),$(BUILD_FOR))
$(error "I don't know how to build for $(BUILD_FOR) on $(BUILD_ON).")
endif
# Installation path prefix for libraries and binaries, except for HTML files
PREFIX=/usr
# Installation path for HTML files
HTML_DIRECTORY=$(PREFIX)/share/pEp/json-adapter/html
# Filename of the pEp JSON Server Adapter binary
TARGET=pEp-mini-json-adapter
# Filename of the pEp JSON Server Adapter testing binary
TARGET_TEST=servertest
# Filename of the unittest binary
TARGET_GTEST=unittests
# If empty, create a release build.
# Otherwise, create a debug build.
# This variable is ineffective in your local.conf file.
DEBUG=placeholder
# If empty, suppress compiler warnings.
# Otherwise, print warnings.
# This variable is ineffective in your local.conf file.
WARN=placeholder
######### C++ #########
TARGET_ARCH=
ifeq ($(BUILD_FOR),Linux)
CXX=g++ -std=c++14 -pthread -fPIC
else ifeq ($(BUILD_FOR),Darwin)
# clang issues a warning when "-pthread" is used for linking. So, include it in CXXFLAGS, and not in CXX
# "c++" != "clang"
CXX=c++ -std=c++14 -fPIC
endif
HTML_DIR ?= "html"
CPPFLAGS=-isystem $(GTEST_DIR)/include -DHTML_DIR=$(HTML_DIR)
ifeq ($(BUILD_FOR),Linux)
CXXFLAGS=-fstack-protector-all # -fdiagnostics-color=always
ifdef WARN
CXXFLAGS+= -Wall
else
CXXFLAGS+= -w
endif
ifdef DEBUG
CXXFLAGS+= -O0 -g -ggdb -DDEBUG_ENABLED
else
CXXFLAGS+= -O3 -DNDEBUG
endif
CXXFLAGS+=-fvisibility=hidden
else ifeq ($(BUILD_FOR),Darwin)
CXXFLAGS=-pthread -fstack-protector-all # -fcolor-diagnostics
ifdef WARN
CXXFLAGS+= -Wall
else
CXXFLAGS+= -w
endif
ifdef DEBUG
CXXFLAGS+= -O0 -g -DDEBUG_ENABLED
else
CXXFLAGS+= -O3 -DNDEBUG
endif
CXXFLAGS+=-fvisibility=hidden
endif
CXXFLAGS+= -Ijson_spirit $(BOOST_INC) $(ENGINE_INC) $(ETPAN_INC) $(GPGME_INC) $(UUID_INC)
LDFLAGS+= $(BOOST_LIB) $(ENGINE_LIB) $(ETPAN_LIB) $(GPGME_LIB) $(UUID_LIB)
LDLIBS+=$(WEBSERVER_LIB)
ifeq ($(MIME_LIB),etpan)
LDLIBS+=-letpan
else ifeq ($(MIME_LIB),pEpMIME)
LDLIBS+=-lpEpMIME
else
$(error "You must set MIME_LIB to 'etpan' or 'pEpMIME'!" )
endif
ifeq ($(BUILD_FOR),Linux)
LDLIBS+= -lpEpEngine -lpEpAdapter -lboost_system -lboost_filesystem -lboost_program_options -lboost_thread -lboost_regex
GTEST_DIR=/usr/src/googletest/googletest/
else ifeq ($(BUILD_FOR),Darwin)
LDLIBS+= -lpEpEngine -lpEpAdapter -lboost_system-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_thread-mt -lboost_regex-mt
endif
######### Google Test #########
#GTEST_DIR=
######### boost #########
BOOST_INC=
BOOST_LIB=
######### Engine #########
ENGINE_INC=-I$(HOME)/code/engine/build/include
ENGINE_LIB=-L$(HOME)/code/engine/build/lib
######### Etpan #########
ETPAN_INC=-I$(HOME)/code/libetpan/build/include
ETPAN_LIB=-L$(HOME)/code/libetpan/build/lib
######### pEp::Webserver #########
WEBSERVER_LIB=$(HOME)/local/lib/libpEpwebserver.a
######### GPGME #########
GPGME_INC=
GPGME_LIB=
######### OSSP uuid #########
UUID_INC=
UUID_LIB=
######### Footer #########
-include $(HERE)/local.conf-old
ifdef BUILD_CONFIG
-include $(BUILD_CONFIG)
endif

Loading…
Cancel
Save