github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/src/third_party/gflags/Makefile.am (about)

     1  ## Process this file with automake to produce Makefile.in
     2  
     3  # Make sure that when we re-make ./configure, we get the macros we need
     4  ACLOCAL_AMFLAGS = -I m4
     5  
     6  # This is so we can #include <gflags/foo>
     7  AM_CPPFLAGS = -I$(top_srcdir)/src
     8  
     9  # This is mostly based on configure options
    10  AM_CXXFLAGS =
    11  
    12  # These are good warnings to turn on by default,
    13  if GCC
    14  AM_CXXFLAGS += -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare
    15  endif
    16  
    17  # The -no-undefined flag allows libtool to generate shared libraries for
    18  # Cygwin and MinGW.  LIBSTDCXX_LA_LINKER_FLAG is used to fix a Solaris bug.
    19  AM_LDFLAGS = -no-undefined $(LIBSTDCXX_LA_LINKER_FLAG)
    20  
    21  gflagsincludedir = $(includedir)/gflags
    22  ## The .h files you want to install (that is, .h files that people
    23  ## who install this package can include in their own applications.)
    24  gflagsinclude_HEADERS = src/gflags/gflags.h src/gflags/gflags_declare.h \
    25                          src/gflags/gflags_completions.h
    26  
    27  # This is for backwards compatibility only.
    28  googleincludedir = $(includedir)/google
    29  googleinclude_HEADERS = src/google/gflags.h src/google/gflags_completions.h
    30  
    31  bin_SCRIPTS = src/gflags_completions.sh
    32  
    33  docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
    34  ## This is for HTML and other documentation you want to install.
    35  ## Add your documentation files (in doc/) in addition to these
    36  ## top-level boilerplate files.  Also add a TODO file if you have one.
    37  dist_doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README \
    38  	README_windows.txt doc/designstyle.css doc/gflags.html
    39  
    40  ## The libraries (.so's) you want to install
    41  lib_LTLIBRARIES =
    42  ## The location of the windows project file for each binary we make
    43  WINDOWS_PROJECTS = gflags.sln
    44  
    45  ## unittests you want to run when people type 'make check'.
    46  ## TESTS is for binary unittests, check_SCRIPTS for script-based unittests.
    47  ## TESTS_ENVIRONMENT sets environment variables for when you run unittest,
    48  ## but it only seems to take effect for *binary* unittests (argh!)
    49  TESTS =
    50  TESTS_ENVIRONMENT = SRCDIR="$(top_srcdir)"
    51  check_SCRIPTS =
    52  # Every time you add a unittest to check_SCRIPTS, add it here too
    53  noinst_SCRIPTS =
    54  # Used for auto-generated source files
    55  CLEANFILES =
    56  
    57  ## vvvv RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
    58  
    59  GFLAGS_SOURCES = $(gflagsinclude_HEADERS) src/mutex.h src/util.h \
    60                   src/gflags.cc src/gflags_reporting.cc \
    61                   src/gflags_completions.cc
    62  
    63  lib_LTLIBRARIES += libgflags.la
    64  WINDOWS_PROJECTS += vsprojects/libgflags/libgflags.vcproj
    65  libgflags_la_SOURCES = $(GFLAGS_SOURCES)
    66  libgflags_la_CXXFLAGS = $(PTHREAD_CFLAGS) -DNDEBUG
    67  # -version-info gets passed to libtool
    68  libgflags_la_LDFLAGS = $(PTHREAD_CFLAGS) -version-info @SO_VERSION@
    69  libgflags_la_LIBADD = $(PTHREAD_LIBS)
    70  
    71  lib_LTLIBRARIES += libgflags_nothreads.la
    72  libgflags_nothreads_la_SOURCES = $(GFLAGS_SOURCES)
    73  libgflags_nothreads_la_CXXFLAGS = -DNDEBUG -DNO_THREADS
    74  libgflags_nothreads_la_LDFLAGS = -version-info @SO_VERSION@
    75  
    76  TESTS += gflags_unittest
    77  WINDOWS_PROJECTS += vsprojects/gflags_unittest/gflags_unittest.vcproj
    78  gflags_unittest_SOURCES = $(gflagsinclude_HEADERS) \
    79                            src/config_for_unittests.h \
    80                            src/gflags_unittest.cc
    81  gflags_unittest_CXXFLAGS = $(PTHREAD_CFLAGS)
    82  gflags_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
    83  gflags_unittest_LDADD = libgflags.la
    84  
    85  # Also make sure this works when we don't link in pthreads
    86  TESTS += gflags_nothreads_unittest
    87  gflags_nothreads_unittest_SOURCES = $(gflags_unittest_SOURCES)
    88  gflags_nothreads_unittest_LDADD = libgflags_nothreads.la
    89  
    90  # We also want to test that things work properly when the file that
    91  # holds main() has a name ending with -main or _main.  To keep the
    92  # Makefile small :-), we test the no-threads version of these.
    93  TESTS += gflags_unittest2
    94  gflags_unittest2_SOURCES = $(gflagsinclude_HEADERS) \
    95                             src/gflags_unittest-main.cc
    96  gflags_unittest2_LDADD = libgflags_nothreads.la
    97  src/gflags_unittest-main.cc: src/gflags_unittest.cc
    98  	rm -f src/gflags_unittest-main.cc
    99  	cp -p $(top_srcdir)/src/gflags_unittest.cc src/gflags_unittest-main.cc
   100  CLEANFILES += src/gflags_unittest-main.cc
   101  
   102  TESTS += gflags_unittest3
   103  gflags_unittest3_SOURCES = $(gflagsinclude_HEADERS) \
   104  	                   src/gflags_unittest_main.cc
   105  gflags_unittest3_LDADD = libgflags_nothreads.la
   106  src/gflags_unittest_main.cc: src/gflags_unittest.cc
   107  	rm -f src/gflags_unittest_main.cc
   108  	cp -p $(top_srcdir)/src/gflags_unittest.cc src/gflags_unittest_main.cc
   109  CLEANFILES += src/gflags_unittest_main.cc
   110  
   111  # Some buggy sh's ignore "" instead of treating it as a positional
   112  # parameter.  Since we use "" in this script, we prefer bash if we
   113  # can.  If there's no bash, we fall back to sh.
   114  check_SCRIPTS += gflags_unittest_sh
   115  noinst_SCRIPTS += src/gflags_unittest.sh
   116  dist_noinst_DATA = src/gflags_unittest_flagfile
   117  gflags_unittest_sh: gflags_unittest$(EXEEXT) \
   118                      gflags_unittest2$(EXEEXT) \
   119                      gflags_unittest3$(EXEEXT)
   120  	bash --version >/dev/null 2>&1 && export SH=bash || export SH=sh; \
   121  	$$SH "$(top_srcdir)/src/gflags_unittest.sh" \
   122  	     "`pwd`/gflags_unittest" "$(top_srcdir)" "@TEST_TMPDIR@"
   123  
   124  # Test the STRIP_FLAGS #define.
   125  TESTS += gflags_strip_flags_test
   126  gflags_strip_flags_test_SOURCES = $(gflagsinclude_HEADERS) \
   127                                    src/config_for_unittests.h \
   128                                    src/gflags_strip_flags_test.cc
   129  gflags_strip_flags_test_CXXFLAGS = $(PTHREAD_CFLAGS)
   130  gflags_strip_flags_test_LDFLAGS = $(PTHREAD_CFLAGS)
   131  gflags_strip_flags_test_LDADD = libgflags.la
   132  
   133  check_SCRIPTS += gflags_strip_flags_test_sh
   134  noinst_SCRIPTS += src/gflags_strip_flags_test.sh
   135  gflags_strip_flags_test_sh: gflags_strip_flags_test$(EXEEXT)
   136  	sh "$(top_srcdir)/src/gflags_strip_flags_test.sh" \
   137             "`pwd`/gflags_strip_flags_test$(EXEEXT)"
   138  
   139  # These are negative-compilation tests.  We want to make sure these
   140  # erroneous use of the flags macros correctly fail to compile.
   141  # Again, we just bother testing with the no-threads version of the library.
   142  check_SCRIPTS += gflags_nc_test1
   143  gflags_nc_test1: $(gflagsinclude_HEADERS) src/gflags_nc.cc
   144  	if $(CXX) -DTEST_SWAPPED_ARGS $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test1.o $(srcdir)/src/gflags_nc.cc; then echo "Compile succeeded but should have failed"; exit 1; else echo "Compile failed, like it was supposed to"; fi
   145  
   146  check_SCRIPTS += gflags_nc_test2
   147  gflags_nc_test2: $(gflagsinclude_HEADERS) src/gflags_nc.cc
   148  	if $(CXX) -DTEST_INT_INSTEAD_OF_BOOL $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test2.o $(srcdir)/src/gflags_nc.cc; then echo "Compile succeeded but should have failed"; exit 1; else echo "Compile failed, like it was supposed to"; fi
   149  
   150  check_SCRIPTS += gflags_nc_test3
   151  gflags_nc_test3: $(gflagsinclude_HEADERS) src/gflags_nc.cc
   152  	if $(CXX) -DTEST_BOOL_IN_QUOTES $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test3.o $(srcdir)/src/gflags_nc.cc; then echo "Compile succeeded but should have failed"; exit 1; else echo "Compile failed, like it was supposed to"; fi
   153  
   154  # This one, on the other hand, should succeed.
   155  check_SCRIPTS += gflags_nc_test4
   156  gflags_nc_test4: $(gflagsinclude_HEADERS) src/gflags_nc.cc
   157  	$(CXX) -DSANITY $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gflags_nc_test4.o $(srcdir)/src/gflags_nc.cc
   158  
   159  # This file isn't covered under any rule that would cause it to be distributed.
   160  dist_noinst_DATA += src/gflags_nc.cc
   161  
   162  
   163  ## ^^^^ END OF RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
   164  
   165  
   166  ## This should always include $(TESTS), but may also include other
   167  ## binaries that you compile but don't want automatically installed.
   168  noinst_PROGRAMS = $(TESTS)
   169  
   170  rpm: dist-gzip packages/rpm.sh packages/rpm/rpm.spec
   171  	@cd packages && ./rpm.sh ${PACKAGE} ${VERSION}
   172  
   173  deb: dist-gzip packages/deb.sh packages/deb/*
   174  	@cd packages && ./deb.sh ${PACKAGE} ${VERSION}
   175  
   176  # http://linux.die.net/man/1/pkg-config, http://pkg-config.freedesktop.org/wiki
   177  pkgconfigdir = $(libdir)/pkgconfig
   178  pkgconfig_DATA = lib${PACKAGE}.pc lib${PACKAGE}_nothreads.pc
   179  CLEANFILES += $(pkgconfig_DATA)
   180  
   181  # I get the description and URL lines from the rpm spec. I use sed to
   182  # try to rewrite exec_prefix, libdir, and includedir in terms of
   183  # prefix, if possible.
   184  lib${PACKAGE}.pc: Makefile packages/rpm/rpm.spec
   185  	echo 'prefix=$(prefix)' > "$@".tmp
   186  	echo 'exec_prefix='`echo '$(exec_prefix)' | sed 's@^$(prefix)@$${prefix}@'` >> "$@".tmp
   187  	echo 'libdir='`echo '$(libdir)' | sed 's@^$(exec_prefix)@$${exec_prefix}@'` >> "$@".tmp
   188  	echo 'includedir='`echo '$(includedir)' | sed 's@^$(prefix)@$${prefix}@'` >> "$@".tmp
   189  	echo '' >> "$@".tmp
   190  	echo 'Name: $(PACKAGE)' >> "$@".tmp
   191  	echo 'Version: $(VERSION)' >> "$@".tmp
   192  	-grep '^Summary:' $(top_srcdir)/packages/rpm/rpm.spec | sed s/^Summary:/Description:/ | head -n1 >> "$@".tmp
   193  	-grep '^URL: ' $(top_srcdir)/packages/rpm/rpm.spec >> "$@".tmp
   194  	echo 'Requires:' >> "$@".tmp
   195  	echo 'Libs: -L$${libdir} -l$(PACKAGE)' >> "$@".tmp
   196  	echo 'Libs.private: $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)' >> "$@".tmp
   197  	echo 'Cflags: -I$${includedir}' >> "$@".tmp
   198  	mv -f "$@".tmp "$@"
   199  
   200  # The nothreads version is mostly the same
   201  lib${PACKAGE}_nothreads.pc: lib${PACKAGE}.pc
   202  	grep -v Libs.private lib${PACKAGE}.pc | sed s/-l$(PACKAGE)/-l$(PACKAGE)_nothreads/ > "$@"
   203  
   204  libtool: $(LIBTOOL_DEPS)
   205  	$(SHELL) ./config.status --recheck
   206  
   207  EXTRA_DIST = packages/rpm.sh packages/rpm/rpm.spec packages/deb.sh packages/deb \
   208  	libtool $(SCRIPTS) \
   209  	src/windows/config.h src/windows/port.h src/windows/port.cc \
   210  	src/windows/gflags/gflags.h src/windows/gflags/gflags_declare.h \
   211          src/windows/gflags/gflags_completions.h \
   212  	$(WINDOWS_PROJECTS) \
   213          src/solaris/libstdc++.la