# PLEASE adhere to the alphabetical ordering in this Makefile! # Also indentation by a single tab AM_LDFLAGS = $(BOOST_THREAD_LDFLAGS) -ldl AM_CPPFLAGS = -I$(top_srcdir)/src/ $(BOOST_CPPFLAGS) SUBDIRS = Helpers Patterns Observer unittests ## config utility ### bin_PROGRAMS = codepatterns-config codepatterns-debug-config CONFIGSOURCES = \ codepatterns-config-main.cpp \ codepatterns-config.hpp \ version.hpp codepatterns_config_SOURCES = \ $(CONFIGSOURCES) \ codepatterns-config.cpp codepatterns_config_CPPFLAGS = \ $(AM_CPPFLAGS) \ $(BOOST_CPPFLAGS) codepatterns_config_LDFLAGS = \ $(AM_LDFLAGS) \ $(BOOST_PROGRAM_OPTIONS_LDFLAGS) \ $(BOOST_PROGRAM_OPTIONS_LIBS) codepatterns_config_LDADD = \ libcodepatterns.la codepatterns_debug_config_SOURCES = \ $(CONFIGSOURCES) \ codepatterns-debug-config.cpp codepatterns_debug_config_CPPFLAGS = \ $(AM_CPPFLAGS) \ $(BOOST_CPPFLAGS) codepatterns_debug_config_LDFLAGS = \ $(AM_LDFLAGS) \ $(BOOST_PROGRAM_OPTIONS_LDFLAGS) \ $(BOOST_PROGRAM_OPTIONS_LIBS) codepatterns_debug_config_LDADD = \ libcodepatterns.la dist_man_MANS = \ manpages/codepatterns-config.1 \ manpages/codepatterns-debug-config.1 include_HEADERS = \ version.hpp CLEANFILES = \ codepatterns-config.cpp \ codepatterns-debug-config.cpp # this includes source files that need to be present at multiple points SOURCE = \ version.cpp SOURCEDEBUG = \ $(SOURCE) HEADER = \ version.hpp ##-@CODEPATTERNS_API_VERSION@ lib_LTLIBRARIES = libcodepatterns.la libcodepatterns-debug.la libcodepatterns_la_LDFLAGS = \ $(AM_LDFLAGS) \ $(LIBRT) libcodepatterns_debug_la_LDFLAGS = \ $(AM_LDFLAGS) \ $(LIBRT) libcodepatterns_la_LIBADD = \ Patterns/libcodepatterns-Patterns.la \ Observer/libcodepatterns-Observer.la \ Helpers/libcodepatterns-Helpers.la libcodepatterns_debug_la_LIBADD = \ Patterns/libcodepatterns-Patterns-debug.la \ Observer/libcodepatterns-Observer-debug.la \ Helpers/libcodepatterns-Helpers-debug.la libcodepatterns_la_CPPFLAGS = -DNDEBUG -DNO_MEMDEBUG $(AM_CPPFLAGS) libcodepatterns_debug_la_CPPFLAGS = -DMEMDEBUG -DLOG_OBSERVER $(AM_CPPFLAGS) ## Define the source file list for the "libexample-@CODEPATTERNS_API_VERSION@.la" ## target. Note that @CODEPATTERNS_API_VERSION@ is not interpreted by Automake and ## will therefore be treated as if it were literally part of the target name, ## and the variable name derived from that. ## The file extension .cc is recognized by Automake, and makes it produce ## rules which invoke the C++ compiler to produce a libtool object file (.lo) ## from each source file. Note that it is not necessary to list header files ## which are already listed elsewhere in a _HEADERS variable assignment. #-$(CODEPATTERNS_API_VERSION) libcodepatterns_la_SOURCES = $(SOURCE) libcodepatterns_debug_la_SOURCES = $(SOURCEDEBUG) ## Instruct libtool to include ABI version information in the generated shared ## library file (.so). The library ABI version is defined in configure.ac, so ## that all version information is kept in one place. #-$(CODEPATTERNS_API_VERSION) libcodepatterns_la_LDFLAGS += -version-info $(CODEPATTERNS_SO_VERSION) libcodepatterns_debug_la_LDFLAGS += -version-info $(CODEPATTERNS_SO_VERSION) ## The generated configuration header is installed in its own subdirectory of ## $(libdir). The reason for this is that the configuration information put ## into this header file describes the target platform the installed library ## has been built for. Thus the file must not be installed into a location ## intended for architecture-independent files, as defined by the Filesystem ## Hierarchy Standard (FHS). ## The nodist_ prefix instructs Automake to not generate rules for including ## the listed files in the distribution on 'make dist'. Files that are listed ## in _HEADERS variables are normally included in the distribution, but the ## configuration header file is generated at configure time and should not be ## shipped with the source tarball. libcodepatterns_libincludedir = $(includedir)/CodePatterns/ #-$(CODEPATTERNS_API_VERSION) libcodepatterns_libinclude_HEADERS = $(HEADER) $(top_builddir)/libcodepatterns_config.h ## Install the generated pkg-config file (.pc) into the expected location for ## architecture-dependent package configuration information. Occasionally, ## pkg-config files are also used for architecture-independent data packages, ## in which case the correct install location would be $(datadir)/pkgconfig. pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = $(top_builddir)/libcodepatterns.pc $(top_builddir)/libcodepatterns-debug.pc FORCE: $(srcdir)/.git-version: FORCE @if (test -d $(top_srcdir)/../../.git && cd $(srcdir) \ && { git describe --abbrev=0 | sed -e "s#^v##" ; } ) > .git-version-t 2>/dev/null \ && ! diff .git-version-t $(srcdir)/.git-version >/dev/null 2>&1; then \ mv -f .git-version-t $(srcdir)/.git-version; \ else \ rm -f .git-version-t; \ fi EXTRA_DIST = $(srcdir)/.git-version version.cpp: $(srcdir)/.git-version echo -e "const char *CODEPATTERNSVERSION = \"`cat <$(srcdir)/.git-version`\";\nconst char *CODEPATTERNSFULLVERSION = \"$(PACKAGE_NAME) version "`cat $(srcdir)/.git-version`"\";\n" > $@ codepatterns-config.cpp: echo -e "const char *CODEPATTERNSCFLAGS=\"-I$(includedir) ${BOOST_CPPFLAGS}\";\nconst char *CODEPATTERNSLDFLAGS=\"-L$(libdir) $(BOOST_LDFLAGS)\";\nconst char *CODEPATTERNSLIBS=\"-lcodepatterns $(BOOST_THREAD_LIB)\";\n" > $@ codepatterns-debug-config.cpp: echo -e "const char *CODEPATTERNSCFLAGS=\"-I$(includedir) ${BOOST_CPPFLAGS}\";\nconst char *CODEPATTERNSLDFLAGS=\"-L$(libdir) $(BOOST_LDFLAGS)\";\nconst char *CODEPATTERNSLIBS=\"-lcodepatterns-debug $(BOOST_THREAD_LIB)\";\n" > $@