Commit 56adb0fd by Maarten L. Hekkelman

new makefile setup

parent 1147b4c4
......@@ -23,10 +23,16 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
firstTarget: all
empty =
space = $(empty) $(empty)
CXX = @CXX@
CXXFLAGS = @CXXFLAGS@ @CPPFLAGS@ @PTHREAD_CFLAGS@ @CIFPP_CFLAGS@
LDFLAGS = @LDFLAGS@ @PTHREAD_CFLAGS@
CXXFLAGS = @CXXFLAGS@ \
@CPPFLAGS@ \
@PTHREAD_CFLAGS@ \
@CIFPP_CFLAGS@
LDFLAGS = @LDFLAGS@ \
@PTHREAD_CFLAGS@
LIBS = @CIFPP_LIBS@ \
@BOOST_IOSTREAMS_LIB@ \
@BOOST_PROGRAM_OPTIONS_LIB@ \
......@@ -44,23 +50,16 @@ mandir = @mandir@
GNUmakefile: config.status GNUmakefile.in
$(SHELL) ./config.status
ifneq "$(CHECK_CONFIG)" ""
# main build variables
PROGRAM = @PACKAGE_NAME@
config.status: configure
$(SHELL) ./config.status --recheck
VERSION = @PACKAGE_VERSION@
configure: configure.ac
autoconf
SEARCH_PATHS = src test @LIBCIFPP_DATA_DIR@
endif
OBJECTS = $(PROGRAM).o
# main build variables
VERSION = @PACKAGE_VERSION@.0
DEFINES += VERSION='"$(VERSION)"'
CXXFLAGS += -Wall -Wno-multichar
LIBCIFPP_DATA_DIR = @LIBCIFPP_DATA_DIR@
RESOURCES = mmcif_pdbx_v50.dic
# Use the DEBUG flag to build debug versions of the code
DEBUG = @DEBUG@
......@@ -77,10 +76,9 @@ endif
MRC = @MRC@
USE_RSRC = @USE_RSRC@
# targets
VPATH += src:test
VPATH += $(subst $(space),:,$(SEARCH_PATHS))
CXXFLAGS += -Wall -Wno-multichar
CXXFLAGS += $(DEFINES:%=-D%)
OBJDIR = obj
......@@ -105,7 +103,7 @@ REVISION_FILE = version-info-$(REVISION).txt
$(REVISION_FILE):
rm -f version-info-*.txt
@ echo dssp-version: $(VERSION) > $@
@ echo $(PROGRAM)-version: $(VERSION) > $@
@ git describe --match=build --dirty >> $@
@ git log --pretty=medium --date=iso8601 -1 >> $@
......@@ -118,45 +116,26 @@ else
src/revision.hpp:
@ echo 'const char kRevision[] = R"(' > $@
@ echo dssp-version: $(VERSION) >> $@
@ echo $(PROGRAM)-version: $(VERSION) >> $@
@ echo Date: $$(date --iso-8601) >> $@
@ echo ')";' >> $@
endif
ifneq "$(USE_RSRC)" "0"
rsrc/version.txt: $(REVISION_FILE)
cp $? $@
endif
# The program rules
OBJECTS = \
$(OBJDIR)/dssp.o
ifneq "$(USE_RSRC)" "0"
OBJECTS += $(OBJDIR)/dssp_rsrc.o
rsrc:
@ mkdir -p $@
rsrc/%.dic: $(LIBCIFPP_DATA_DIR)/%.dic.gz | rsrc
zcat $^ > $@
rsrc/%.dic: $(LIBCIFPP_DATA_DIR)/%.dic | rsrc
ln -fs $^ $@
OBJECTS += $(PROGRAM)_rsrc.o
$(OBJDIR)/dssp_rsrc.o: rsrc/mmcif_pdbx_v50.dic
$(OBJDIR)/$(PROGRAM)_rsrc.o: $(RESOURCES)
$(MRC) -o $@ $^
endif
$(OBJDIR)/dssp.o: src/revision.hpp
$(OBJDIR)/$(PROGRAM).o: src/revision.hpp
mkdssp: $(OBJECTS)
$(PROGRAM): $(OBJECTS:%.o=$(OBJDIR)/%.o)
@ echo '->' $@
@ $(CXX) -o $@ $^ $(CXXFLAGS) $(LDFLAGS) $(LIBS)
......@@ -166,17 +145,17 @@ $(OBJDIR)/%.d: $(OBJDIR)/%.o
.PHONY: clean all
clean:
rm -rf mkdssp $(OBJDIR)/* src/revision.hpp
rm -rf $(PROGRAM) $(OBJDIR)/* src/revision.hpp
all: mkdssp
all: $(PROGRAM)
.PHONY: install
install: mkdssp
install: $(PROGRAM)
install -d $(bindir)
install mkdssp $(bindir)/mkdssp
install $(PROGRAM) $(bindir)/$(PROGRAM)
install -d $(mandir)/man1
install -m 644 mkdssp.1 $(mandir)/man1/mkdssp.1;
gzip $(mandir)/man1/mkdssp.1;
install -m 644 doc/$(PROGRAM).1 $(mandir)/man1/$(PROGRAM).1;
gzip $(mandir)/man1/$(PROGRAM).1;
.PHONY: FORCE
FORCE:
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for dssp 4.0.
# Generated by GNU Autoconf 2.69 for mkdssp 4.0.0.
#
# Report bugs to <m.hekkelman@nki.nl>.
#
......@@ -578,10 +578,10 @@ MFLAGS=
MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='dssp'
PACKAGE_TARNAME='dssp'
PACKAGE_VERSION='4.0'
PACKAGE_STRING='dssp 4.0'
PACKAGE_NAME='mkdssp'
PACKAGE_TARNAME='mkdssp'
PACKAGE_VERSION='4.0.0'
PACKAGE_STRING='mkdssp 4.0.0'
PACKAGE_BUGREPORT='m.hekkelman@nki.nl'
PACKAGE_URL=''
......@@ -1309,7 +1309,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures dssp 4.0 to adapt to many kinds of systems.
\`configure' configures mkdssp 4.0.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1358,7 +1358,7 @@ Fine tuning of the installation directories:
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/dssp]
--docdir=DIR documentation root [DATAROOTDIR/doc/mkdssp]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
......@@ -1375,7 +1375,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of dssp 4.0:";;
short | recursive ) echo "Configuration of mkdssp 4.0.0:";;
esac
cat <<\_ACEOF
......@@ -1522,7 +1522,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
dssp configure 4.0
mkdssp configure 4.0.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -1945,7 +1945,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by dssp $as_me 4.0, which was
It was created by mkdssp $as_me 4.0.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -8095,7 +8095,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by dssp $as_me 4.0, which was
This file was extended by mkdssp $as_me 4.0.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -8157,7 +8157,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
dssp config.status 4.0
mkdssp config.status 4.0.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
AC_PREREQ([2.69])
AC_INIT([dssp], 4.0, [m.hekkelman@nki.nl])
m4_define([dssp_version_major],[4])
m4_define([dssp_version_minor],[0])
m4_define([dssp_version_micro],[0])
m4_define([dssp_version_extra],[])
m4_define([dssp_version],[dssp_version_major().dssp_version_minor().dssp_version_micro()dssp_version_extra])
AC_INIT([mkdssp], [dssp_version], [m.hekkelman@nki.nl])
dnl Switch to a C++ compiler, and check if it works.
AC_LANG(C++)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -76,7 +76,7 @@ void load_version_info()
const std::regex
rxVersionNr(R"(build-(\d+)-g[0-9a-f]{7}(-dirty)?)"),
rxVersionDate(R"(Date: +(\d{4}-\d{2}-\d{2}).*)"),
rxVersionNr2(R"(dssp-version: (\d+(?:\.\d+)+))");
rxVersionNr2(R"(mkdssp-version: (\d+(?:\.\d+)+))");
#include "revision.hpp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment