Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 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 |
Craig Silverstein | 2b66a84 | 2007-06-12 23:59:42 +0000 | [diff] [blame] | 4 | ACLOCAL_AMFLAGS = -I m4 |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 5 | |
Craig Silverstein | 6791468 | 2008-08-21 00:50:59 +0000 | [diff] [blame^] | 6 | # This is so we can #include <gflags/foo> |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 7 | AM_CPPFLAGS = -I$(top_srcdir)/src |
| 8 | |
Craig Silverstein | c79c32d | 2008-07-22 23:29:39 +0000 | [diff] [blame] | 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 | |
Craig Silverstein | 6791468 | 2008-08-21 00:50:59 +0000 | [diff] [blame^] | 17 | gflagsincludedir = $(includedir)/gflags |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 18 | ## The .h files you want to install (that is, .h files that people |
| 19 | ## who install this package can include in their own applications.) |
Craig Silverstein | 6791468 | 2008-08-21 00:50:59 +0000 | [diff] [blame^] | 20 | gflagsinclude_HEADERS = src/gflags/gflags.h src/gflags/gflags_completions.h |
| 21 | |
| 22 | # This is for backwards compatibility only. |
| 23 | googleincludedir = $(includedir)/google |
Craig Silverstein | c79c32d | 2008-07-22 23:29:39 +0000 | [diff] [blame] | 24 | googleinclude_HEADERS = src/google/gflags.h src/google/gflags_completions.h |
| 25 | |
| 26 | bin_SCRIPTS = src/gflags_completions.sh |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 27 | |
| 28 | docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION) |
| 29 | ## This is for HTML and other documentation you want to install. |
| 30 | ## Add your documentation files (in doc/) in addition to these |
| 31 | ## top-level boilerplate files. Also add a TODO file if you have one. |
| 32 | dist_doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README \ |
Craig Silverstein | 690172b | 2007-04-20 21:16:33 +0000 | [diff] [blame] | 33 | doc/designstyle.css doc/gflags.html |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 34 | |
| 35 | ## The libraries (.so's) you want to install |
| 36 | lib_LTLIBRARIES = |
| 37 | |
| 38 | ## unittests you want to run when people type 'make check'. |
| 39 | ## TESTS is for binary unittests, check_SCRIPTS for script-based unittests. |
| 40 | ## TESTS_ENVIRONMENT sets environment variables for when you run unittest, |
| 41 | ## but it only seems to take effect for *binary* unittests (argh!) |
| 42 | TESTS = |
Craig Silverstein | eb20839 | 2007-08-15 19:44:54 +0000 | [diff] [blame] | 43 | TESTS_ENVIRONMENT = SRCDIR="$(top_srcdir)" |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 44 | check_SCRIPTS = |
| 45 | # Every time you add a unittest to check_SCRIPTS, add it here too |
| 46 | noinst_SCRIPTS = |
Craig Silverstein | 585a44a | 2007-10-18 20:08:26 +0000 | [diff] [blame] | 47 | # Used for auto-generated source files |
| 48 | CLEANFILES = |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 49 | |
| 50 | ## vvvv RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS |
| 51 | |
| 52 | lib_LTLIBRARIES += libgflags.la |
Craig Silverstein | 6791468 | 2008-08-21 00:50:59 +0000 | [diff] [blame^] | 53 | libgflags_la_SOURCES = $(gflagsinclude_HEADERS) src/config.h \ |
Craig Silverstein | c79c32d | 2008-07-22 23:29:39 +0000 | [diff] [blame] | 54 | src/gflags.cc src/gflags_reporting.cc \ |
| 55 | src/gflags_completions.cc |
| 56 | libgflags_la_CXXFLAGS = $(PTHREAD_CFLAGS) -DNDEBUG |
| 57 | libgflags_la_LDFLAGS = $(PTHREAD_CFLAGS) |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 58 | libgflags_la_LIBADD = $(PTHREAD_LIBS) |
| 59 | |
Craig Silverstein | 6791468 | 2008-08-21 00:50:59 +0000 | [diff] [blame^] | 60 | TESTS += gflags_unittest$(EXEEXT) |
| 61 | gflags_unittest_SOURCES = $(gflagsinclude_HEADERS) src/config.h \ |
Craig Silverstein | 585a44a | 2007-10-18 20:08:26 +0000 | [diff] [blame] | 62 | src/gflags_unittest.cc |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 63 | gflags_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) |
| 64 | gflags_unittest_LDFLAGS = $(PTHREAD_CFLAGS) |
| 65 | gflags_unittest_LDADD = libgflags.la $(PTHREAD_LIBS) |
| 66 | |
Craig Silverstein | eb20839 | 2007-08-15 19:44:54 +0000 | [diff] [blame] | 67 | # Also make sure this works when we don't link in pthreads |
Craig Silverstein | 6791468 | 2008-08-21 00:50:59 +0000 | [diff] [blame^] | 68 | TESTS += gflags_nothreads_unittest$(EXEEXT) |
Craig Silverstein | eb20839 | 2007-08-15 19:44:54 +0000 | [diff] [blame] | 69 | gflags_nothreads_unittest_SOURCES = $(gflags_unittest_SOURCES) |
| 70 | gflags_nothreads_unittest_LDADD = libgflags.la |
| 71 | |
Craig Silverstein | 585a44a | 2007-10-18 20:08:26 +0000 | [diff] [blame] | 72 | # We also want to test that things work properly when the file that |
| 73 | # holds main() has a name ending with -main or _main. To keep the |
| 74 | # Makefile small :-), we test the no-threads version of these. |
Craig Silverstein | 6791468 | 2008-08-21 00:50:59 +0000 | [diff] [blame^] | 75 | TESTS += gflags_unittest2$(EXEEXT) |
| 76 | gflags_unittest2_SOURCES = $(gflagsinclude_HEADERS) src/config.h \ |
Craig Silverstein | 585a44a | 2007-10-18 20:08:26 +0000 | [diff] [blame] | 77 | src/gflags_unittest-main.cc |
| 78 | gflags_unittest2_LDADD = libgflags.la |
| 79 | src/gflags_unittest-main.cc: src/gflags_unittest.cc |
| 80 | rm -f src/gflags_unittest-main.cc |
| 81 | cp -p src/gflags_unittest.cc src/gflags_unittest-main.cc |
| 82 | CLEANFILES += src/gflags_unittest-main.cc |
| 83 | |
Craig Silverstein | 6791468 | 2008-08-21 00:50:59 +0000 | [diff] [blame^] | 84 | TESTS += gflags_unittest3$(EXEEXT) |
| 85 | gflags_unittest3_SOURCES = $(gflagsinclude_HEADERS) src/config.h \ |
Craig Silverstein | 585a44a | 2007-10-18 20:08:26 +0000 | [diff] [blame] | 86 | src/gflags_unittest_main.cc |
| 87 | gflags_unittest3_LDADD = libgflags.la |
| 88 | src/gflags_unittest_main.cc: src/gflags_unittest.cc |
| 89 | rm -f src/gflags_unittest_main.cc |
| 90 | cp -p src/gflags_unittest.cc src/gflags_unittest_main.cc |
| 91 | CLEANFILES += src/gflags_unittest_main.cc |
| 92 | |
Craig Silverstein | 6791468 | 2008-08-21 00:50:59 +0000 | [diff] [blame^] | 93 | # Some buggy sh's ignore "" instead of treating it as a positional |
| 94 | # parameter. Since we use "" in this script, we prefer bash if we |
| 95 | # can. If there's no bash, we fall back to sh. |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 96 | check_SCRIPTS += gflags_unittest_sh |
| 97 | noinst_SCRIPTS += src/gflags_unittest.sh |
Craig Silverstein | 6791468 | 2008-08-21 00:50:59 +0000 | [diff] [blame^] | 98 | dist_noinst_DATA = src/gflags_unittest_flagfile |
| 99 | gflags_unittest_sh: gflags_unittest$(EXEEXT) \ |
| 100 | gflags_unittest2$(EXEEXT) \ |
| 101 | gflags_unittest3$(EXEEXT) |
| 102 | bash --version >/dev/null && export SH=bash || export SH=sh; \ |
| 103 | $$SH "$(top_srcdir)/src/gflags_unittest.sh" "$(PWD)/gflags_unittest" \ |
| 104 | "$(top_srcdir)" |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 105 | |
Craig Silverstein | 290da38 | 2007-03-28 21:54:07 +0000 | [diff] [blame] | 106 | # These aren't part of the c++ source, but we want them to be distributed |
| 107 | PYTHON = python/setup.py \ |
| 108 | python/gflags.py \ |
| 109 | python/gflags2man.py \ |
| 110 | python/gflags_unittest.py |
| 111 | |
| 112 | |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 113 | ## ^^^^ END OF RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS |
| 114 | |
| 115 | |
| 116 | ## This should always include $(TESTS), but may also include other |
| 117 | ## binaries that you compile but don't want automatically installed. |
| 118 | noinst_PROGRAMS = $(TESTS) |
| 119 | |
| 120 | rpm: dist-gzip packages/rpm.sh packages/rpm/rpm.spec |
| 121 | @cd packages && ./rpm.sh ${PACKAGE} ${VERSION} |
| 122 | |
| 123 | deb: dist-gzip packages/deb.sh packages/deb/* |
| 124 | @cd packages && ./deb.sh ${PACKAGE} ${VERSION} |
| 125 | |
| 126 | libtool: $(LIBTOOL_DEPS) |
| 127 | $(SHELL) ./config.status --recheck |
| 128 | EXTRA_DIST = packages/rpm.sh packages/rpm/rpm.spec packages/deb.sh packages/deb \ |
Craig Silverstein | 290da38 | 2007-03-28 21:54:07 +0000 | [diff] [blame] | 129 | libtool $(SCRIPTS) $(PYTHON) |