aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/build-data/makefile/gmake.in (renamed from src/build-data/makefile/unix_shr.in)45
-rw-r--r--src/build-data/makefile/nmake.in2
-rw-r--r--src/build-data/makefile/python.in3
-rw-r--r--src/build-data/makefile/shared.in10
-rw-r--r--src/build-data/makefile/unix.in110
5 files changed, 31 insertions, 139 deletions
diff --git a/src/build-data/makefile/unix_shr.in b/src/build-data/makefile/gmake.in
index cf4fd7fec..b5d14a601 100644
--- a/src/build-data/makefile/unix_shr.in
+++ b/src/build-data/makefile/gmake.in
@@ -5,22 +5,22 @@ APP_OPT = %{app_opt}
LANG_FLAGS = %{lang_flags}
WARN_FLAGS = %{warn_flags}
SO_OBJ_FLAGS = %{shared_flags}
-SO_LINK_CMD = %{so_link}
-LINK_TO = %{link_to}
+LIB_LINKS_TO = %{link_to}
+APP_LINKS_TO = $(LIB_LINKS_TO) -lboost_regex -lboost_thread
-LIB_FLAGS = $(SO_OBJ_FLAGS) $(LANG_FLAGS) $(LIB_OPT) $(WARN_FLAGS)
+LIB_FLAGS = $(SO_OBJ_FLAGS) $(LANG_FLAGS) $(LIB_OPT) $(WARN_FLAGS)
APP_FLAGS = $(LANG_FLAGS) $(APP_OPT) $(WARN_FLAGS)
# Version Numbers
VERSION = %{version}
-SERIES = %{version_major}.%{version_minor}
+BRANCH = %{version_major}.%{version_minor}
# Installation Settings
DESTDIR = %{prefix}
BINDIR = $(DESTDIR)/bin
LIBDIR = $(DESTDIR)/%{libdir}
-HEADERDIR = $(DESTDIR)/%{includedir}/botan-$(SERIES)/botan
+HEADERDIR = $(DESTDIR)/%{includedir}/botan-$(BRANCH)/botan
DOCDIR = $(DESTDIR)/%{docdir}/botan-$(VERSION)
PKGCONF_DIR = $(LIBDIR)/pkgconfig
@@ -43,16 +43,18 @@ RM = @rm -f
RM_R = @rm -rf
# Targets
-APP = %{app_prefix}botan
-LIBRARIES = $(STATIC_LIB) $(SHARED_LIB)
+APP = %{app_prefix}botan
+LIBRARIES = $(STATIC_LIB)
LIBNAME = %{lib_prefix}libbotan
-STATIC_LIB = $(LIBNAME)-$(SERIES).a
+STATIC_LIB = $(LIBNAME)-$(BRANCH).a
+
+LIBPATH = botan-$(BRANCH)
all: $(APP)
# File Lists
-HEADERS = %{include_files}
+INCLUDE_DIR = %{botan_include_dir}
LIBOBJS = %{lib_objs}
@@ -64,31 +66,20 @@ APPOBJS = %{app_objs}
%{app_build_cmds}
# Link Commands
+%{shared_makefile}
+
$(APP): $(LIBRARIES) $(APPOBJS)
- $(CXX) $(LDFLAGS) $(APPOBJS) $(SHARED_LIB) $(LINK_TO) -lboost_regex -lboost_thread -o $(APP)
+ $(CXX) $(LDFLAGS) $(APPOBJS) -L. -l$(LIBPATH) $(APP_LINKS_TO) -o $(APP)
$(STATIC_LIB): $(LIBOBJS)
$(RM) $(STATIC_LIB)
$(AR) $(STATIC_LIB) $(LIBOBJS)
$(RANLIB) $(STATIC_LIB)
-SONAME = $(LIBNAME)-$(SERIES).%{so_suffix}.%{so_abi_rev}
-SHARED_LIB = $(SONAME).%{version_patch}
-SYMLINK = $(LIBNAME)-$(SERIES).%{so_suffix}
-
-$(SHARED_LIB): $(LIBOBJS)
- $(SO_LINK_CMD) $(LDFLAGS) $(LIBOBJS) -o $(SHARED_LIB) $(LINK_TO)
- $(LN) $(SHARED_LIB) $(SONAME)
- $(LN) $(SHARED_LIB) $(SYMLINK)
-
%{python_makefile}
# Fake Targets
-.PHONY = docs clean distclean install static shared
-
-static: $(STATIC_LIB)
-
-shared: $(SHARED_LIB)
+.PHONY = docs clean distclean install
docs:
%{build_doc_commands}
@@ -103,20 +94,22 @@ distclean: clean
$(RM) botan_all.cpp botan_all.h
install: $(LIBRARIES) docs
- $(ECHO) "Installing Botan into $(DESTDIR)... "
$(MKDIR_INSTALL) $(DOCDIR)
$(COPY_R) %{doc_output_dir}/* $(DOCDIR)
$(MKDIR_INSTALL) $(HEADERDIR)
- for i in $(HEADERS); do \
+ for i in $(INCLUDE_DIR)/*.h; do \
$(INSTALL_CMD_DATA) $$i $(HEADERDIR); \
done
$(MKDIR_INSTALL) $(LIBDIR)
$(INSTALL_CMD_DATA) $(STATIC_LIB) $(LIBDIR)
+
+ ifdef $(SHARED_LIB)
$(INSTALL_CMD_EXEC) $(SHARED_LIB) $(LIBDIR)
$(CD) $(LIBDIR); $(LN) $(SHARED_LIB) $(SYMLINK)
$(CD) $(LIBDIR); $(LN) $(SHARED_LIB) $(SONAME)
+ endif
$(MKDIR_INSTALL) $(BINDIR)
$(INSTALL_CMD_EXEC) $(CONFIG_SCRIPT) $(BINDIR)
diff --git a/src/build-data/makefile/nmake.in b/src/build-data/makefile/nmake.in
index 3fbbf8263..392684214 100644
--- a/src/build-data/makefile/nmake.in
+++ b/src/build-data/makefile/nmake.in
@@ -33,8 +33,6 @@ RMDIR = @rmdir
### File Lists
APP = botan
-HEADERS = %{include_files}
-
LIBOBJS = %{lib_objs}
APPOBJS = %{app_objs}
diff --git a/src/build-data/makefile/python.in b/src/build-data/makefile/python.in
index 5b1d2379d..f6e49ee75 100644
--- a/src/build-data/makefile/python.in
+++ b/src/build-data/makefile/python.in
@@ -1,4 +1,5 @@
+# Build commands for Python wrapper
PYTHON_ROOT = /usr/lib/python%{python_version}/config
PYTHON_INC = -I/usr/include/python%{python_version}
PYTHON_SITE_PACKAGE_DIR = /usr/lib/python%{python_version}/site-packages/
@@ -17,7 +18,7 @@ PYTHON_FLAGS = $(LANG_FLAGS) $(WARN_FLAGS) $(SO_OBJ_FLAGS) -Os -ftemplate-dept
$(BOTAN_PYTHON_MODDIR)/_botan.so: $(PYTHON_OBJS)
cp %{python_dir}/*.py $(BOTAN_PYTHON_MODDIR)
- $(CXX) -shared -Wl,-soname,$@ $(PYTHON_OBJS) -L. -L$(PYTHON_ROOT) $(LDFLAGS) -lbotan-$(SERIES) -lboost_python-%{python_version} -o $@
+ $(CXX) -shared -Wl,-soname,$@ $(PYTHON_OBJS) -L. -L$(PYTHON_ROOT) $(LDFLAGS) -lbotan-$(BRANCH) -lboost_python-%{python_version} -o $@
install_python:
mkdir -p $(PYTHON_SITE_PACKAGE_DIR)/botan
diff --git a/src/build-data/makefile/shared.in b/src/build-data/makefile/shared.in
new file mode 100644
index 000000000..f4116cce4
--- /dev/null
+++ b/src/build-data/makefile/shared.in
@@ -0,0 +1,10 @@
+SONAME = $(LIBNAME)-$(BRANCH).%{so_suffix}.%{so_abi_rev}
+SHARED_LIB = $(SONAME).%{version_patch}
+SYMLINK = $(LIBNAME)-$(BRANCH).%{so_suffix}
+
+$(SHARED_LIB): $(LIBOBJS)
+ %{so_link} $(LDFLAGS) $(LIBOBJS) $(LIB_LINKS_TO) -o $(SHARED_LIB)
+ $(LN) $(SHARED_LIB) $(SONAME)
+ $(LN) $(SHARED_LIB) $(SYMLINK)
+
+LIBRARIES += $(SHARED_LIB)
diff --git a/src/build-data/makefile/unix.in b/src/build-data/makefile/unix.in
deleted file mode 100644
index a32cd30b3..000000000
--- a/src/build-data/makefile/unix.in
+++ /dev/null
@@ -1,110 +0,0 @@
-# Compiler Options
-CXX = %{cc}
-LIB_OPT = %{lib_opt}
-APP_OPT = %{app_opt}
-LANG_FLAGS = %{lang_flags}
-WARN_FLAGS = %{warn_flags}
-LINK_TO = %{link_to}
-
-LIB_FLAGS = $(LANG_FLAGS) $(LIB_OPT) $(WARN_FLAGS)
-APP_FLAGS = $(LANG_FLAGS) $(APP_OPT) $(WARN_FLAGS)
-
-# Version Numbers
-VERSION = %{version}
-SERIES = %{version_major}.%{version_minor}
-
-# Installation Settings
-DESTDIR = %{prefix}
-
-BINDIR = $(DESTDIR)/bin
-LIBDIR = $(DESTDIR)/%{libdir}
-HEADERDIR = $(DESTDIR)/%{includedir}/botan-$(SERIES)/botan
-DOCDIR = $(DESTDIR)/%{docdir}/botan-$(VERSION)
-PKGCONF_DIR = $(LIBDIR)/pkgconfig
-
-CONFIG_SCRIPT = %{botan_config}
-PKGCONFIG = %{botan_pkgconfig}
-
-# Aliases for Common Programs
-AR = %{ar_command}
-COPY = cp
-COPY_R = cp -r
-CD = @cd
-ECHO = @echo
-INSTALL_CMD_EXEC = %{install_cmd_exec}
-INSTALL_CMD_DATA = %{install_cmd_data}
-LN = ln -fs
-MKDIR = @mkdir
-MKDIR_INSTALL = @umask 022; mkdir -p -m 755
-RANLIB = %{ranlib_command}
-RM = @rm -f
-RM_R = @rm -rf
-
-# Targets
-APP = %{app_prefix}botan
-LIBRARIES = $(STATIC_LIB)
-
-LIBNAME = %{lib_prefix}libbotan
-STATIC_LIB = $(LIBNAME)-$(SERIES).a
-
-all: $(APP)
-
-# File Lists
-
-HEADERS = %{include_files}
-
-LIBOBJS = %{lib_objs}
-
-APPOBJS = %{app_objs}
-
-# Build Commands
-%{lib_build_cmds}
-
-%{app_build_cmds}
-
-# Link Commands
-$(APP): $(LIBRARIES) $(APPOBJS)
- $(CXX) $(APPOBJS) $(STATIC_LIB) $(LINK_TO) -o $(APP)
-
-$(STATIC_LIB): $(LIBOBJS)
- $(RM) $(STATIC_LIB)
- $(AR) $(STATIC_LIB) $(LIBOBJS)
- $(RANLIB) $(STATIC_LIB)
-
-%{python_makefile}
-
-# Fake Targets
-.PHONY = docs clean distclean install static
-
-static: $(STATIC_LIB)
-
-docs:
-%{build_doc_commands}
-
-clean:
- $(RM_R) %{build_dir}/lib/* %{build_dir}/tests/*
- $(RM) $(LIBRARIES) $(SYMLINK) $(APP)
-
-distclean: clean
- $(RM_R) %{build_dir}
- $(RM) Makefile* $(CONFIG_SCRIPT) $(PKGCONFIG)
- $(RM) botan_all.cpp botan_all.h
-
-install: $(LIBRARIES) docs
- $(ECHO) "Installing Botan into $(DESTDIR)... "
- $(MKDIR_INSTALL) $(DOCDIR)
- $(COPY_R) %{doc_output_dir}/* $(DOCDIR)
-
- $(MKDIR_INSTALL) $(HEADERDIR)
- for i in $(HEADERS); do \
- $(INSTALL_CMD_DATA) $$i $(HEADERDIR); \
- done
-
- $(MKDIR_INSTALL) $(LIBDIR)
- $(INSTALL_CMD_DATA) $(STATIC_LIB) $(LIBDIR)
-
- $(MKDIR_INSTALL) $(BINDIR)
- $(INSTALL_CMD_EXEC) $(CONFIG_SCRIPT) $(BINDIR)
-
- $(MKDIR_INSTALL) $(PKGCONF_DIR)
- $(INSTALL_CMD_DATA) $(PKGCONFIG) $(PKGCONF_DIR)