-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile.am
58 lines (43 loc) · 1.84 KB
/
Makefile.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
AM_CFLAGS = # CFLAGS applicable to all executables (products)
AM_CPPFLAGS = -I$(top_srcdir)/src # so that tests also find header files
# Convenience library so that it can be resued
# between my_executable and the tests
noinst_LIBRARIES = libcommon.a
libcommon_a_SOURCES = src/common.h src/common.c
# src/common.h appear in SOURCES to that it gets copied to
# distribution tgz.
# The main product
bin_PROGRAMS = myexecutable # make all will generate ./my_executable
#include .c and .h in SOURCES so that both appear in dist
myexecutable_SOURCES = \
src/add.c \
src/add.h \
src/main.c
myexecutable_CFLAGS = $(AM_CFLAGS) $(CODE_COVERAGE_CFLAGS) #--std=c11 # CFLAGS applicable to myexecutable_SOURCES
myexecutable_LDADD = libcommon.a
myexecutable_LDFLAGS = $(CODE_COVERAGE_LDFLAGS)
# myexecutable_CFLAGS = $(CODE_COVERAGE_CFLAGS)
# Tests
# 'check' comes from 'make check'
@VALGRIND_CHECK_RULES@
@CODE_COVERAGE_RULES@
# See all code_coverage_* options in the Makefile or m4/ax_code_coverage.m4
CODE_COVERAGE_IGNORE_PATTERN = tests/*
CODE_COVERAGE_IGNORE_PATTERN += stdio2.h
TESTS = add.ctaptest
check_PROGRAMS = add.ctaptest
add_ctaptest_SOURCES = tests/add.c src/add.c src/add.h
add_ctaptest_CPPFLAGS = $(AM_CPPFLAGS) # so that tests find the header files
add_ctaptest_LDFLAGS = $(CODE_COVERAGE_LDFLAGS)
add_ctaptest_CFLAGS = $(CODE_COVERAGE_CFLAGS)
# See http://www.gnu.org/software/automake/manual/html_node/Use-TAP-with-the-Automake-test-harness.html
# TESTS ending in .ctaptest should produce TAP output
# 1..2
# ok 1 - message
# not ok 2 - message
AUTOMAKE_OPTIONS = parallel-tests
TEST_EXTENSIONS = .ctaptest
CTAPTEST_LOG_DRIVER = env AM_TAP_HAWK='$(AWK)' $(SHELL) $(top_srcdir)/build-aux/tap-driver.sh
# TESTS_ENVIRONMENT = $(VALGRIND)
# CTAPTEST_TESTS_ENVIRONMENT = $(VALGRIND)
# CTAPTEST_LOG_COMPILER = $(VALGRIND)