diff options
author | lloyd <[email protected]> | 2006-09-08 01:47:05 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-09-08 01:47:05 +0000 |
commit | b5893bb80ba9327c9a71b03da770187f909137eb (patch) | |
tree | 615d7c268699b78b45863cd41e245737d26bd789 /misc | |
parent | 662fccf63e1063d45cd9de6e8860cdb8a28c9e90 (diff) |
Generate the Unix makefiles by processing templates and replacing
variables, rather than hardcoding the entire Makefile into the script.
Diffstat (limited to 'misc')
-rw-r--r-- | misc/config/makefile/unix.in | 119 | ||||
-rw-r--r-- | misc/config/makefile/unix_shr.in | 134 |
2 files changed, 253 insertions, 0 deletions
diff --git a/misc/config/makefile/unix.in b/misc/config/makefile/unix.in new file mode 100644 index 000000000..241c0a662 --- /dev/null +++ b/misc/config/makefile/unix.in @@ -0,0 +1,119 @@ +################################################## +# Compiler Options # +################################################## +CXX = @{var:cc} +LIB_OPT = @{var:lib_opt} +CHECK_OPT = @{var:check_opt} +MACH_OPT = @{var:mach_opt} +LANG_FLAGS = @{var:lang_flags} +WARN_FLAGS = @{var:warn_flags} +LINK_TO = @{var:link_to} + +################################################## +# Version Numbers # +################################################## +MAJOR = @{var:version_major} +MINOR = @{var:version_minor} +PATCH = @{var:version_patch} + +VERSION = $(MAJOR).$(MINOR).$(PATCH) + +################################################## +# Installation Settings # +################################################## +INSTALLROOT = @{var:prefix} + +BINDIR = $(INSTALLROOT)/bin +LIBDIR = $(INSTALLROOT)/@{var:libdir} +HEADERDIR = $(INSTALLROOT)/@{var:includedir}/botan +DOCDIR = $(INSTALLROOT)/@{var:docdir}/Botan-$(VERSION) + +OWNER = @{var:install_user} +GROUP = @{var:install_group} +DATA_MODE = 644 +EXEC_MODE = 755 + +CONFIG_SCRIPT = botan-config + +################################################## +# Aliases for Common Programs # +################################################## +AR = @{var:ar_command} +CD = @cd +ECHO = @echo +INSTALL_CMD_EXEC = @{var:install_cmd_exec} +INSTALL_CMD_DATA = @{var:install_cmd_data} +LN = ln -fs +MKDIR = @mkdir +MKDIR_INSTALL = @umask 022; mkdir -p -m $(EXEC_MODE) +RANLIB = @ranlib +RM = @rm -f +RM_R = @rm -rf + +################################################## +# File Lists # +################################################## +CHECK = check + +DOCS = @{var:doc_files} + +HEADERS = @{var:include_files} + +LIBOBJS = @{var:lib_objs} + +CHECKOBJS = @{var:check_objs} + +LIB_FLAGS = $(LIB_OPT) $(MACH_OPT) $(LANG_FLAGS) $(WARN_FLAGS) +CHECK_FLAGS = $(CHECK_OPT) $(LANG_FLAGS) $(WARN_FLAGS) + +LIBRARIES = $(STATIC_LIB) + +LIBNAME = libbotan +STATIC_LIB = $(LIBNAME).a + +all: $(LIBRARIES) + +################################################## +# Build Commands # +################################################## +@{var:lib_build_cmds} +@{var:check_build_cmds} +################################################## +# Link Commands # +################################################## +$(CHECK): $(LIBRARIES) $(CHECKOBJS) + $(CXX) $(CHECKOBJS) -L. -lbotan $(LINK_TO) -o $(CHECK) + +$(STATIC_LIB): $(LIBOBJS) + $(RM) $(STATIC_LIB) + $(AR) $(STATIC_LIB) $(LIBOBJS) + +################################################## +# Fake Targets # +################################################## +.PHONY = clean distclean install static + +static: $(STATIC_LIB) + +clean: + $(RM_R) @{var:build}/lib/* @{var:build}/checks/* + $(RM) $(LIBRARIES) $(SYMLINK) $(CHECK) + +distclean: clean + $(RM_R) @{var:build} + $(RM) Makefile $(CONFIG_SCRIPT) + +install: $(LIBRARIES) + $(ECHO) "Installing Botan into $(INSTALLROOT)... " + $(MKDIR_INSTALL) $(DOCDIR) + $(MKDIR_INSTALL) $(HEADERDIR) + $(MKDIR_INSTALL) $(LIBDIR) + $(MKDIR_INSTALL) $(BINDIR) + @for i in $(DOCS); do \ + $(INSTALL_CMD_DATA) $$i $(DOCDIR); \ + done + @for i in $(HEADERS); do \ + $(INSTALL_CMD_DATA) $$i $(HEADERDIR); \ + done + @$(INSTALL_CMD_DATA) $(STATIC_LIB) $(LIBDIR) + @$(INSTALL_CMD_EXEC) $(CONFIG_SCRIPT) $(BINDIR) diff --git a/misc/config/makefile/unix_shr.in b/misc/config/makefile/unix_shr.in new file mode 100644 index 000000000..0962e1722 --- /dev/null +++ b/misc/config/makefile/unix_shr.in @@ -0,0 +1,134 @@ +################################################## +# Compiler Options # +################################################## +CXX = @{var:cc} +LIB_OPT = @{var:lib_opt} +CHECK_OPT = @{var:check_opt} +MACH_OPT = @{var:mach_opt} +LANG_FLAGS = @{var:lang_flags} +WARN_FLAGS = @{var:warn_flags} +SO_OBJ_FLAGS = @{var:so_obj_flags} +SO_LINK_CMD = @{var:so_link} +LINK_TO = @{var:link_to} + +################################################## +# Version Numbers # +################################################## +MAJOR = @{var:version_major} +MINOR = @{var:version_minor} +PATCH = @{var:version_patch} + +VERSION = $(MAJOR).$(MINOR).$(PATCH) + +################################################## +# Installation Settings # +################################################## +INSTALLROOT = @{var:prefix} + +BINDIR = $(INSTALLROOT)/bin +LIBDIR = $(INSTALLROOT)/@{var:libdir} +HEADERDIR = $(INSTALLROOT)/@{var:includedir}/botan +DOCDIR = $(INSTALLROOT)/@{var:docdir}/Botan-$(VERSION) + +OWNER = @{var:install_user} +GROUP = @{var:install_group} +DATA_MODE = 644 +EXEC_MODE = 755 + +CONFIG_SCRIPT = botan-config + +################################################## +# Aliases for Common Programs # +################################################## +AR = @{var:ar_command} +CD = @cd +ECHO = @echo +INSTALL_CMD_EXEC = @{var:install_cmd_exec} +INSTALL_CMD_DATA = @{var:install_cmd_data} +LN = ln -fs +MKDIR = @mkdir +MKDIR_INSTALL = @umask 022; mkdir -p -m $(EXEC_MODE) +RANLIB = @ranlib +RM = @rm -f +RM_R = @rm -rf + +################################################## +# File Lists # +################################################## +CHECK = check + +DOCS = @{var:doc_files} + +HEADERS = @{var:include_files} + +LIBOBJS = @{var:lib_objs} + +CHECKOBJS = @{var:check_objs} + +LIB_FLAGS = $(LIB_OPT) $(MACH_OPT) $(LANG_FLAGS) $(WARN_FLAGS) $(SO_OBJ_FLAGS) +CHECK_FLAGS = $(CHECK_OPT) $(LANG_FLAGS) $(WARN_FLAGS) + +LIBRARIES = $(STATIC_LIB) $(SHARED_LIB) + +LIBNAME = libbotan +STATIC_LIB = $(LIBNAME).a + +SHARED_LIB = $(LIBNAME)-$(MAJOR).$(MINOR).$(PATCH).@{var:so_suffix} +SONAME = $(LIBNAME)-$(MAJOR).$(MINOR).$(PATCH).@{var:so_suffix} + +SYMLINK = $(LIBNAME).@{var:so_suffix} + +all: $(LIBRARIES) + +################################################## +# Build Commands # +################################################## +@{var:lib_build_cmds} +@{var:check_build_cmds} +################################################## +# Link Commands # +################################################## +$(CHECK): $(LIBRARIES) $(CHECKOBJS) + $(CXX) $(CHECKOBJS) -L. -lbotan $(LINK_TO) -o $(CHECK) + +$(STATIC_LIB): $(LIBOBJS) + $(RM) $(STATIC_LIB) + $(AR) $(STATIC_LIB) $(LIBOBJS) + +$(SHARED_LIB): $(LIBOBJS) + $(SO_LINK_CMD) $(LINK_TO) $(LIBOBJS) -o $(SHARED_LIB) + $(LN) $(SHARED_LIB) $(SYMLINK) + +################################################## +# Fake Targets # +################################################## +.PHONY = clean distclean install static shared + +static: $(STATIC_LIB) + +shared: $(SHARED_LIB) + +clean: + $(RM_R) @{var:build}/lib/* @{var:build}/checks/* + $(RM) $(LIBRARIES) $(SYMLINK) $(CHECK) + +distclean: clean + $(RM_R) @{var:build} + $(RM) Makefile $(CONFIG_SCRIPT) + +install: $(LIBRARIES) + $(ECHO) "Installing Botan into $(INSTALLROOT)... " + $(MKDIR_INSTALL) $(DOCDIR) + $(MKDIR_INSTALL) $(HEADERDIR) + $(MKDIR_INSTALL) $(LIBDIR) + $(MKDIR_INSTALL) $(BINDIR) + @for i in $(DOCS); do \ + $(INSTALL_CMD_DATA) $$i $(DOCDIR); \ + done + @for i in $(HEADERS); do \ + $(INSTALL_CMD_DATA) $$i $(HEADERDIR); \ + done + @$(INSTALL_CMD_DATA) $(STATIC_LIB) $(LIBDIR) + @$(INSTALL_CMD_EXEC) $(CONFIG_SCRIPT) $(BINDIR) + @$(INSTALL_CMD_EXEC) $(SHARED_LIB) $(LIBDIR) + $(CD) $(LIBDIR); $(LN) $(SHARED_LIB) $(SYMLINK) |