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.
6 ## Process this file with automake to produce Makefile.in
8 # Make sure that when we re-make ./configure, we get the macros we need
9 ACLOCAL_AMFLAGS = -I `pwd`/../autoconf
11 # This is so we can #include <google/foo>
12 AM_CPPFLAGS = -I$(top_srcdir)/src
14 # These are good warnings to turn on by default
16 AM_CXXFLAGS = -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare
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
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
30 ## The libraries (.so's) you want to install
33 ## unittests you want to run when people type 'make check'.
34 ## TESTS is for binary unittests, check_SCRIPTS for script-based unittests.
35 ## TESTS_ENVIRONMENT sets environment variables for when you run unittest,
36 ## but it only seems to take effect for *binary* unittests (argh!)
38 TESTS_ENVIRONMENT = CMOCKERY_ROOTDIR = $(top_srcdir)
40 # Every time you add a unittest to check_SCRIPTS, add it here too
44 ## vvvv RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
46 lib_LTLIBRARIES += libcmockery.la
47 libcmockery_la_SOURCES = src/config.h src/cmockery.c src/google/cmockery.h
48 libcmockery_la_CFLAGS = -Isrc/google
50 noinst_PROGRAMS = calculator
51 calculator_SOURCES = src/example/calculator.c src/config.h
54 unit_test_CFLAGS = -Isrc/google -Isrc/example -DUNIT_TESTING=1
56 noinst_PROGRAMS += calculator_test
57 calculator_test_SOURCES = src/example/calculator_test.c \
59 calculator_test_CFLAGS = $(unit_test_CFLAGS)
60 calculator_test_LDADD = libcmockery.la
62 noinst_PROGRAMS += allocate_module_test
63 allocate_module_test_SOURCES = src/example/allocate_module_test.c \
64 src/example/allocate_module.c
65 allocate_module_test_CFLAGS = $(unit_test_CFLAGS)
66 allocate_module_test_LDADD = libcmockery.la
68 noinst_PROGRAMS += assert_macro_test
69 assert_macro_test_SOURCES = src/example/assert_macro_test.c \
70 src/example/assert_macro.c
71 assert_macro_test_CFLAGS = $(unit_test_CFLAGS)
72 assert_macro_test_LDADD = libcmockery.la
74 noinst_PROGRAMS += customer_database_test
75 customer_database_test_SOURCES = src/example/customer_database_test.c \
76 src/example/customer_database.c \
77 src/example/database.h
78 customer_database_test_CFLAGS = $(unit_test_CFLAGS)
79 customer_database_test_LDADD = libcmockery.la
81 noinst_PROGRAMS += key_value_test
82 key_value_test_SOURCES = src/example/key_value_test.c \
83 src/example/key_value.c
84 key_value_test_CFLAGS = $(unit_test_CFLAGS)
85 key_value_test_LDADD = libcmockery.la
87 noinst_PROGRAMS += product_database_test
88 product_database_testdir = src/example
89 product_database_test_SOURCES = src/example/product_database_test.c \
90 src/example/product_database.c \
91 src/example/database.h
92 product_database_test_CFLAGS = $(unit_test_CFLAGS)
93 product_database_test_LDADD = libcmockery.la
95 noinst_PROGRAMS += run_tests
96 run_tests_SOURCES = src/example/run_tests.c
97 run_tests_CFLAGS = $(unit_test_CFLAGS)
98 run_tests_LDADD = libcmockery.la
100 ## ^^^^ END OF RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
103 ## This should always include $(TESTS), but may also include other
104 ## binaries that you compile but don't want automatically installed.
105 noinst_PROGRAMS += $(TESTS)
107 rpm: dist-gzip packages/rpm.sh packages/rpm/rpm.spec
108 @cd packages && ./rpm.sh ${PACKAGE} ${VERSION}
110 deb: dist-gzip packages/deb.sh packages/deb/*
111 @cd packages && ./deb.sh ${PACKAGE} ${VERSION}
113 ## If you're using libtool, add 'libtool' here. Also add this rule:
114 libtool: $(LIBTOOL_DEPS)
115 $(SHELL) ./config.status --recheck
116 EXTRA_DIST = packages/rpm.sh packages/rpm/rpm.spec packages/deb.sh packages/deb \