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 9ACLOCAL_AMFLAGS = -I `pwd`/m4 10 11# This is so we can #include <google/foo> 12AM_CPPFLAGS = -I$(top_srcdir)/src 13 14# These are good warnings to turn on by default 15if GCC 16AM_CXXFLAGS = -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare 17endif 18 19googleincludedir = $(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.) 22googleinclude_HEADERS = src/google/cmockery.h 23 24docdir = $(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. 28dist_doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README doc/index.html \ 29 windows/makefile 30 31## The libraries (.so's) you want to install 32lib_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!) 38TESTS = 39TESTS_ENVIRONMENT = CMOCKERY_ROOTDIR = $(top_srcdir) 40check_SCRIPTS = 41# Every time you add a unittest to check_SCRIPTS, add it here too 42noinst_SCRIPTS = 43 44 45## vvvv RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS 46 47lib_LTLIBRARIES += libcmockery.la 48libcmockery_la_SOURCES = src/config.h src/cmockery.c src/google/cmockery.h 49libcmockery_la_CFLAGS = -Isrc/google 50 51noinst_PROGRAMS = calculator 52calculator_SOURCES = src/example/calculator.c src/config.h 53calculator_CFLAGS = 54 55unit_test_CFLAGS = -Isrc/google -Isrc/example -DUNIT_TESTING=1 56 57noinst_PROGRAMS += calculator_test 58calculator_test_SOURCES = src/example/calculator_test.c \ 59 $(calculator_SOURCES) 60calculator_test_CFLAGS = $(unit_test_CFLAGS) 61calculator_test_LDADD = libcmockery.la 62 63noinst_PROGRAMS += allocate_module_test 64allocate_module_test_SOURCES = src/example/allocate_module_test.c \ 65 src/example/allocate_module.c 66allocate_module_test_CFLAGS = $(unit_test_CFLAGS) 67allocate_module_test_LDADD = libcmockery.la 68 69noinst_PROGRAMS += assert_macro_test 70assert_macro_test_SOURCES = src/example/assert_macro_test.c \ 71 src/example/assert_macro.c 72assert_macro_test_CFLAGS = $(unit_test_CFLAGS) 73assert_macro_test_LDADD = libcmockery.la 74 75noinst_PROGRAMS += customer_database_test 76customer_database_test_SOURCES = src/example/customer_database_test.c \ 77 src/example/customer_database.c \ 78 src/example/database.h 79customer_database_test_CFLAGS = $(unit_test_CFLAGS) 80customer_database_test_LDADD = libcmockery.la 81 82noinst_PROGRAMS += key_value_test 83key_value_test_SOURCES = src/example/key_value_test.c \ 84 src/example/key_value.c 85key_value_test_CFLAGS = $(unit_test_CFLAGS) 86key_value_test_LDADD = libcmockery.la 87 88noinst_PROGRAMS += product_database_test 89product_database_testdir = src/example 90product_database_test_SOURCES = src/example/product_database_test.c \ 91 src/example/product_database.c \ 92 src/example/database.h 93product_database_test_CFLAGS = $(unit_test_CFLAGS) 94product_database_test_LDADD = libcmockery.la 95 96noinst_PROGRAMS += run_tests 97run_tests_SOURCES = src/example/run_tests.c 98run_tests_CFLAGS = $(unit_test_CFLAGS) 99run_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. 106noinst_PROGRAMS += $(TESTS) 107 108rpm: dist-gzip packages/rpm.sh packages/rpm/rpm.spec 109 @cd packages && ./rpm.sh ${PACKAGE} ${VERSION} 110 111deb: 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: 115libtool: $(LIBTOOL_DEPS) 116 $(SHELL) ./config.status --recheck 117EXTRA_DIST = packages/rpm.sh packages/rpm/rpm.spec packages/deb.sh packages/deb \ 118 libtool $(SCRIPTS) 119