OLD | NEW |
(Empty) | |
| 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 gflagsincludedir = $(includedir)/gflags |
| 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.) |
| 20 gflagsinclude_HEADERS = src/gflags/gflags.h src/gflags/gflags_completions.h |
| 21 |
| 22 # This is for backwards compatibility only. |
| 23 googleincludedir = $(includedir)/google |
| 24 googleinclude_HEADERS = src/google/gflags.h src/google/gflags_completions.h |
| 25 |
| 26 bin_SCRIPTS = src/gflags_completions.sh |
| 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 \ |
| 33 doc/designstyle.css doc/gflags.html |
| 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 = |
| 43 TESTS_ENVIRONMENT = SRCDIR="$(top_srcdir)" |
| 44 check_SCRIPTS = |
| 45 # Every time you add a unittest to check_SCRIPTS, add it here too |
| 46 noinst_SCRIPTS = |
| 47 # Used for auto-generated source files |
| 48 CLEANFILES = |
| 49 |
| 50 ## vvvv RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS |
| 51 |
| 52 lib_LTLIBRARIES += libgflags.la |
| 53 libgflags_la_SOURCES = $(gflagsinclude_HEADERS) src/config.h \ |
| 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) |
| 58 libgflags_la_LIBADD = $(PTHREAD_LIBS) |
| 59 |
| 60 TESTS += gflags_unittest$(EXEEXT) |
| 61 gflags_unittest_SOURCES = $(gflagsinclude_HEADERS) src/config.h \ |
| 62 src/gflags_unittest.cc |
| 63 gflags_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) |
| 64 gflags_unittest_LDFLAGS = $(PTHREAD_CFLAGS) |
| 65 gflags_unittest_LDADD = libgflags.la $(PTHREAD_LIBS) |
| 66 |
| 67 # Also make sure this works when we don't link in pthreads |
| 68 TESTS += gflags_nothreads_unittest$(EXEEXT) |
| 69 gflags_nothreads_unittest_SOURCES = $(gflags_unittest_SOURCES) |
| 70 gflags_nothreads_unittest_LDADD = libgflags.la |
| 71 |
| 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. |
| 75 TESTS += gflags_unittest2$(EXEEXT) |
| 76 gflags_unittest2_SOURCES = $(gflagsinclude_HEADERS) src/config.h \ |
| 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 |
| 84 TESTS += gflags_unittest3$(EXEEXT) |
| 85 gflags_unittest3_SOURCES = $(gflagsinclude_HEADERS) src/config.h \ |
| 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 |
| 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. |
| 96 check_SCRIPTS += gflags_unittest_sh |
| 97 noinst_SCRIPTS += src/gflags_unittest.sh |
| 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)" |
| 105 |
| 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 |
| 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
\ |
| 129 libtool $(SCRIPTS) $(PYTHON) |
OLD | NEW |