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`/m4
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 \
31 ## The libraries (.so's) you want to install
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!)
39 TESTS_ENVIRONMENT = CMOCKERY_ROOTDIR = $(top_srcdir)
41 # Every time you add a unittest to check_SCRIPTS, add it here too
45 ## vvvv RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
47 lib_LTLIBRARIES += libcmockery.la
48 libcmockery_la_SOURCES = src/config.h src/cmockery.c src/google/cmockery.h
49 libcmockery_la_CFLAGS = -I$(top_srcdir)/src/google
51 noinst_PROGRAMS = calculator
52 calculator_SOURCES = src/example/calculator.c src/config.h
55 unit_test_CFLAGS = -I$(top_srcdir)/src/google \
56 -I$(top_srcdir)/src/example -DUNIT_TESTING=1
58 noinst_PROGRAMS += calculator_test
59 calculator_test_SOURCES = src/example/calculator_test.c \
61 calculator_test_CFLAGS = $(unit_test_CFLAGS)
62 calculator_test_LDADD = libcmockery.la
64 noinst_PROGRAMS += allocate_module_test
65 allocate_module_test_SOURCES = src/example/allocate_module_test.c \
66 src/example/allocate_module.c
67 allocate_module_test_CFLAGS = $(unit_test_CFLAGS)
68 allocate_module_test_LDADD = libcmockery.la
70 noinst_PROGRAMS += assert_macro_test
71 assert_macro_test_SOURCES = src/example/assert_macro_test.c \
72 src/example/assert_macro.c
73 assert_macro_test_CFLAGS = $(unit_test_CFLAGS)
74 assert_macro_test_LDADD = libcmockery.la
76 noinst_PROGRAMS += customer_database_test
77 customer_database_test_SOURCES = src/example/customer_database_test.c \
78 src/example/customer_database.c \
79 src/example/database.h
80 customer_database_test_CFLAGS = $(unit_test_CFLAGS)
81 customer_database_test_LDADD = libcmockery.la
83 noinst_PROGRAMS += key_value_test
84 key_value_test_SOURCES = src/example/key_value_test.c \
85 src/example/key_value.c
86 key_value_test_CFLAGS = $(unit_test_CFLAGS)
87 key_value_test_LDADD = libcmockery.la
89 noinst_PROGRAMS += product_database_test
90 product_database_testdir = src/example
91 product_database_test_SOURCES = src/example/product_database_test.c \
92 src/example/product_database.c \
93 src/example/database.h
94 product_database_test_CFLAGS = $(unit_test_CFLAGS)
95 product_database_test_LDADD = libcmockery.la
97 noinst_PROGRAMS += run_tests
98 run_tests_SOURCES = src/example/run_tests.c
99 run_tests_CFLAGS = $(unit_test_CFLAGS)
100 run_tests_LDADD = libcmockery.la
102 ## ^^^^ END OF RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
105 ## This should always include $(TESTS), but may also include other
106 ## binaries that you compile but don't want automatically installed.
107 noinst_PROGRAMS += $(TESTS)
109 rpm: dist-gzip packages/rpm.sh packages/rpm/rpm.spec
110 @cd packages && ./rpm.sh ${PACKAGE} ${VERSION}
112 deb: dist-gzip packages/deb.sh packages/deb/*
113 @cd packages && ./deb.sh ${PACKAGE} ${VERSION}
115 ## If you're using libtool, add 'libtool' here. Also add this rule:
116 libtool: $(LIBTOOL_DEPS)
117 $(SHELL) ./config.status --recheck
118 EXTRA_DIST = packages/rpm.sh packages/rpm/rpm.spec packages/deb.sh packages/deb \