2015-02-07 21:34:36 +01:00
|
|
|
include $(top_srcdir)/build-aux/glib-tap.mk
|
2015-02-07 21:02:22 +01:00
|
|
|
|
2015-01-31 20:37:04 +01:00
|
|
|
AM_CFLAGS = # CFLAGS applicable to all executables (products)
|
|
|
|
|
2015-02-09 22:21:18 +01:00
|
|
|
# Convenience library so that it can be resued
|
|
|
|
# between my_executable and the tests
|
|
|
|
noinst_LIBRARIES = libcommon.a
|
2015-02-09 22:35:26 +01:00
|
|
|
libcommon_a_SOURCES = src/common.h src/common.c
|
|
|
|
# src/common.h appear in SOURCES to that it gets copied to
|
|
|
|
# distribution tgz.
|
2015-02-09 22:21:18 +01:00
|
|
|
|
|
|
|
# The main product
|
2015-02-06 20:25:03 +01:00
|
|
|
bin_PROGRAMS = myexecutable # make all will generate ./my_executable
|
2015-01-28 23:05:38 +01:00
|
|
|
myexecutable_SOURCES = \
|
|
|
|
src/main.c
|
2015-02-09 22:34:11 +01:00
|
|
|
myexecutable_CFLAGS = $(AM_CFLAGS) #--std=c11 # CFLAGS applicable to myexecutable_SOURCES
|
2015-02-09 22:21:18 +01:00
|
|
|
myexecutable_LDADD = libcommon.a
|
|
|
|
|
|
|
|
|
2015-02-06 17:10:11 +01:00
|
|
|
|
|
|
|
# Tests
|
|
|
|
# 'check' comes from 'make check'
|
2015-02-07 21:02:22 +01:00
|
|
|
|
2015-02-07 22:16:45 +01:00
|
|
|
test_programs = testsuite
|
2015-02-06 17:10:11 +01:00
|
|
|
|
2015-02-06 20:25:03 +01:00
|
|
|
testsuite_SOURCES = tests/test.c
|
|
|
|
|
|
|
|
# In this case the testsuite (test.c) requires glib2.0
|
|
|
|
# for the g_test_* test harness. glib2.0 requires specific
|
|
|
|
# CFLAGS and -l options that are retrieved from pkg-config (configure.ac)
|
|
|
|
# DEPS_CFLAGS and DEPS_LIBS are filled by PKG_CHECK_MODULES (configure.ac)
|
2015-02-07 21:02:22 +01:00
|
|
|
|
2015-02-09 22:21:18 +01:00
|
|
|
testsuite_CPPFLAGS = -I$(top_srcdir)/src
|
2015-02-09 22:34:11 +01:00
|
|
|
testsuite_CFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS) # DEPS_* are filled by PKG_CHECK_MODULES
|
2015-02-09 22:21:18 +01:00
|
|
|
testsuite_LDADD = $(GLIB_LIBS) libcommon.a # in configure.ac
|
2015-02-06 17:10:11 +01:00
|
|
|
|
|
|
|
|