Heather Lee Wilson | bdd62c5 | 2013-12-28 15:12:39 -0800 | [diff] [blame] | 1 | ## This is a boilerplate file for Google opensource projects. |
| 2 | ## To make it useful, replace <<TEXT>> with actual text for your project. |
| 3 | ## Also, look at comments with "## double hashes" to see if any are worth |
| 4 | ## uncommenting or modifying. |
| 5 | |
| 6 | ## Process this file with automake to produce Makefile.in |
| 7 | |
| 8 | # Make sure that when we re-make ./configure, we get the macros we need |
| 9 | ACLOCAL_AMFLAGS = -I `pwd`/m4 |
| 10 | |
| 11 | # This is so we can #include <google/foo> |
| 12 | AM_CPPFLAGS = -I$(top_srcdir)/src |
| 13 | |
| 14 | # These are good warnings to turn on by default |
| 15 | if GCC |
| 16 | AM_CXXFLAGS = -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare |
| 17 | endif |
| 18 | |
| 19 | googleincludedir = $(includedir)/google |
| 20 | ## The .h files you want to install (that is, .h files that people |
| 21 | ## who install this package can include in their own applications.) |
| 22 | googleinclude_HEADERS = src/google/cmockery.h |
| 23 | |
| 24 | docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION) |
| 25 | ## This is for HTML and other documentation you want to install. |
| 26 | ## Add your documentation files (in doc/) in addition to these |
| 27 | ## top-level boilerplate files. Also add a TODO file if you have one. |
| 28 | dist_doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README doc/index.html \ |
| 29 | windows/makefile |
| 30 | |
| 31 | ## The libraries (.so's) you want to install |
| 32 | lib_LTLIBRARIES = |
| 33 | |
| 34 | ## unittests you want to run when people type 'make check'. |
| 35 | ## TESTS is for binary unittests, check_SCRIPTS for script-based unittests. |
| 36 | ## TESTS_ENVIRONMENT sets environment variables for when you run unittest, |
| 37 | ## but it only seems to take effect for *binary* unittests (argh!) |
| 38 | TESTS = |
| 39 | TESTS_ENVIRONMENT = CMOCKERY_ROOTDIR = $(top_srcdir) |
| 40 | check_SCRIPTS = |
| 41 | # Every time you add a unittest to check_SCRIPTS, add it here too |
| 42 | noinst_SCRIPTS = |
| 43 | |
| 44 | |
| 45 | ## vvvv RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS |
| 46 | |
| 47 | lib_LTLIBRARIES += libcmockery.la |
| 48 | libcmockery_la_SOURCES = src/config.h src/cmockery.c src/google/cmockery.h |
| 49 | libcmockery_la_CFLAGS = -Isrc/google |
| 50 | |
| 51 | noinst_PROGRAMS = calculator |
| 52 | calculator_SOURCES = src/example/calculator.c src/config.h |
| 53 | calculator_CFLAGS = |
| 54 | |
| 55 | unit_test_CFLAGS = -Isrc/google -Isrc/example -DUNIT_TESTING=1 |
| 56 | |
| 57 | noinst_PROGRAMS += calculator_test |
| 58 | calculator_test_SOURCES = src/example/calculator_test.c \ |
| 59 | $(calculator_SOURCES) |
| 60 | calculator_test_CFLAGS = $(unit_test_CFLAGS) |
| 61 | calculator_test_LDADD = libcmockery.la |
| 62 | |
| 63 | noinst_PROGRAMS += allocate_module_test |
| 64 | allocate_module_test_SOURCES = src/example/allocate_module_test.c \ |
| 65 | src/example/allocate_module.c |
| 66 | allocate_module_test_CFLAGS = $(unit_test_CFLAGS) |
| 67 | allocate_module_test_LDADD = libcmockery.la |
| 68 | |
| 69 | noinst_PROGRAMS += assert_macro_test |
| 70 | assert_macro_test_SOURCES = src/example/assert_macro_test.c \ |
| 71 | src/example/assert_macro.c |
| 72 | assert_macro_test_CFLAGS = $(unit_test_CFLAGS) |
| 73 | assert_macro_test_LDADD = libcmockery.la |
| 74 | |
| 75 | noinst_PROGRAMS += customer_database_test |
| 76 | customer_database_test_SOURCES = src/example/customer_database_test.c \ |
| 77 | src/example/customer_database.c \ |
| 78 | src/example/database.h |
| 79 | customer_database_test_CFLAGS = $(unit_test_CFLAGS) |
| 80 | customer_database_test_LDADD = libcmockery.la |
| 81 | |
| 82 | noinst_PROGRAMS += key_value_test |
| 83 | key_value_test_SOURCES = src/example/key_value_test.c \ |
| 84 | src/example/key_value.c |
| 85 | key_value_test_CFLAGS = $(unit_test_CFLAGS) |
| 86 | key_value_test_LDADD = libcmockery.la |
| 87 | |
| 88 | noinst_PROGRAMS += product_database_test |
| 89 | product_database_testdir = src/example |
| 90 | product_database_test_SOURCES = src/example/product_database_test.c \ |
| 91 | src/example/product_database.c \ |
| 92 | src/example/database.h |
| 93 | product_database_test_CFLAGS = $(unit_test_CFLAGS) |
| 94 | product_database_test_LDADD = libcmockery.la |
| 95 | |
| 96 | noinst_PROGRAMS += run_tests |
| 97 | run_tests_SOURCES = src/example/run_tests.c |
| 98 | run_tests_CFLAGS = $(unit_test_CFLAGS) |
| 99 | run_tests_LDADD = libcmockery.la |
| 100 | |
| 101 | ## ^^^^ END OF RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS |
| 102 | |
| 103 | |
| 104 | ## This should always include $(TESTS), but may also include other |
| 105 | ## binaries that you compile but don't want automatically installed. |
| 106 | noinst_PROGRAMS += $(TESTS) |
| 107 | |
| 108 | rpm: dist-gzip packages/rpm.sh packages/rpm/rpm.spec |
| 109 | @cd packages && ./rpm.sh ${PACKAGE} ${VERSION} |
| 110 | |
| 111 | deb: dist-gzip packages/deb.sh packages/deb/* |
| 112 | @cd packages && ./deb.sh ${PACKAGE} ${VERSION} |
| 113 | |
| 114 | ## If you're using libtool, add 'libtool' here. Also add this rule: |
| 115 | libtool: $(LIBTOOL_DEPS) |
| 116 | $(SHELL) ./config.status --recheck |
| 117 | EXTRA_DIST = packages/rpm.sh packages/rpm/rpm.spec packages/deb.sh packages/deb \ |
| 118 | libtool $(SCRIPTS) |