diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2016-03-15 12:47:13 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2016-03-15 19:15:25 +0100 |
commit | 3b8361eb0635e2a56f8db11823d0b5837f1bb6de (patch) | |
tree | 197abc191bd4d69bb5ee9ed473386208c3aca1ca /src/tests | |
parent | 3bac0a17f5187aa22d433470146875cac15944bf (diff) |
build,core: update build rules
We try to combine in common envvars the compiler and linker flags shared by the
different components, and where possible, also re-using the implicit AM_CFLAGS
and AM_LDFLAGS variables that automake provides, and which apply to all objects
being built in the same Makefile.am.
The internal libmodem-helpers.la library is also renamed to libhelpers.la
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/Makefile.am | 203 |
1 files changed, 35 insertions, 168 deletions
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index 0804b14f..53b17456 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -1,190 +1,57 @@ -include $(top_srcdir)/gtester.make - -AM_CFLAGS = $(CODE_COVERAGE_CFLAGS) -AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS) - -noinst_PROGRAMS = \ - test-modem-helpers \ - test-charsets \ - test-qcdm-serial-port \ - test-at-serial-port \ - test-sms-part-3gpp \ - test-sms-part-cdma - -if WITH_QMI -noinst_PROGRAMS += test-modem-helpers-qmi -endif - -TEST_PROGS += $(noinst_PROGRAMS) - -################ - -test_modem_helpers_SOURCES = \ - test-modem-helpers.c - -test_modem_helpers_CPPFLAGS = \ - $(MM_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/libmm-glib \ - -I$(top_srcdir)/libmm-glib/generated \ - -I$(top_builddir)/libmm-glib/generated - -test_modem_helpers_LDADD = \ - $(top_builddir)/src/libmodem-helpers.la \ - $(MM_LIBS) - -if WITH_QMI -test_modem_helpers_CPPFLAGS += $(QMI_CFLAGS) -test_modem_helpers_LDADD += $(QMI_LIBS) -endif - -################ - -if WITH_QMI -test_modem_helpers_qmi_SOURCES = \ - test-modem-helpers-qmi.c - -test_modem_helpers_qmi_CPPFLAGS = \ - $(MM_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/libmm-glib \ - -I$(top_srcdir)/libmm-glib/generated \ - -I$(top_builddir)/libmm-glib/generated \ - $(QMI_CFLAGS) - -test_modem_helpers_qmi_LDADD = \ - $(top_builddir)/src/libmodem-helpers.la \ - $(MM_LIBS) \ - $(QMI_LIBS) -endif - -################ - -test_charsets_SOURCES = \ - test-charsets.c - -test_charsets_CPPFLAGS = \ - $(MM_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/libmm-glib \ - -I$(top_srcdir)/libmm-glib/generated \ - -I$(top_builddir)/libmm-glib/generated - -test_charsets_LDADD = \ - $(top_builddir)/src/libmodem-helpers.la \ - $(MM_LIBS) - -if WITH_QMI -test_charsets_CPPFLAGS += $(QMI_CFLAGS) -test_charsets_LDADD += $(QMI_LIBS) -endif -################ +include $(top_srcdir)/gtester.make -test_qcdm_serial_port_SOURCES = \ - test-qcdm-serial-port.c +################################################################################ +# common +################################################################################ -test_qcdm_serial_port_CPPFLAGS = \ +AM_CFLAGS = \ $(MM_CFLAGS) \ + $(CODE_COVERAGE_CFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/src \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ + -I$(top_srcdir)/libqcdm/src \ -I$(top_srcdir)/libmm-glib \ - -I$(top_srcdir)/libmm-glib/generated \ - -I$(top_builddir)/libmm-glib/generated + -I${top_builddir}/libmm-glib/generated \ + -I${top_srcdir}/src/ \ + -I${top_builddir}/src/ \ + $(NULL) -test_qcdm_serial_port_LDADD = \ +AM_LDFLAGS = \ $(MM_LIBS) \ + $(CODE_COVERAGE_LDFLAGS) \ + $(top_builddir)/src/libhelpers.la \ $(top_builddir)/src/libport.la \ - $(top_builddir)/src/libmodem-helpers.la \ - $(top_builddir)/libqcdm/src/libqcdm.la \ - -lutil + -lutil \ + $(NULL) if WITH_QMI -test_qcdm_serial_port_CPPFLAGS += $(QMI_CFLAGS) -test_qcdm_serial_port_LDADD += $(QMI_LIBS) +AM_CFLAGS += $(QMI_CFLAGS) +AM_LDFLAGS += $(QMI_LIBS) endif -################ - -test_at_serial_port_SOURCES = \ - test-at-serial-port.c - -test_at_serial_port_CPPFLAGS = \ - $(MM_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/libmm-glib \ - -I$(top_srcdir)/libmm-glib/generated \ - -I$(top_builddir)/libmm-glib/generated - -test_at_serial_port_LDADD = \ - $(MM_LIBS) \ - $(top_builddir)/src/libport.la \ - $(top_builddir)/src/libmodem-helpers.la \ - -lutil - -if WITH_QMI -test_at_serial_port_CPPFLAGS += $(QMI_CFLAGS) -test_at_serial_port_LDADD += $(QMI_LIBS) +if WITH_MBIM +AM_CFLAGS += $(MBIM_CFLAGS) +AM_LDFLAGS += $(MBIM_LIBS) endif -################ - -test_sms_part_3gpp_SOURCES = \ - test-sms-part-3gpp.c +################################################################################ +# tests +# note: we abuse AM_LDFLAGS to include libhelpers and libport. +################################################################################ -test_sms_part_3gpp_CPPFLAGS = \ - $(MM_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/libmm-glib \ - -I$(top_srcdir)/libmm-glib/generated \ - -I$(top_builddir)/libmm-glib/generated - -test_sms_part_3gpp_LDADD = \ - $(top_builddir)/src/libmodem-helpers.la \ - $(MM_LIBS) +noinst_PROGRAMS = \ + test-modem-helpers \ + test-charsets \ + test-qcdm-serial-port \ + test-at-serial-port \ + test-sms-part-3gpp \ + test-sms-part-cdma \ + $(NULL) if WITH_QMI -test_sms_part_3gpp_CPPFLAGS += $(QMI_CFLAGS) -test_sms_part_3gpp_LDADD += $(QMI_LIBS) +noinst_PROGRAMS += test-modem-helpers-qmi endif -################ - -test_sms_part_cdma_SOURCES = \ - test-sms-part-cdma.c - -test_sms_part_cdma_CPPFLAGS = \ - $(MM_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/libmm-glib \ - -I$(top_srcdir)/libmm-glib/generated \ - -I$(top_builddir)/libmm-glib/generated - -test_sms_part_cdma_LDADD = \ - $(top_builddir)/src/libmodem-helpers.la \ - $(MM_LIBS) - -if WITH_QMI -test_sms_part_cdma_CPPFLAGS += $(QMI_CFLAGS) -test_sms_part_cdma_LDADD += $(QMI_LIBS) -endif +TEST_PROGS += $(noinst_PROGRAMS) |