diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2021-03-02 16:34:01 +0100 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2021-03-02 17:02:18 +0100 |
commit | cd80f4ce927a59634894c983471aa0db78ad93a0 (patch) | |
tree | 9dd27ccd5ca48bdf67da581596de374529a4347f /samsung-ipc | |
parent | 3bcc9e2a31c970ee3e6a6a5c57f1df83ddb77857 (diff) | |
download | hardware_replicant_libsamsung-ipc-cd80f4ce927a59634894c983471aa0db78ad93a0.tar.gz hardware_replicant_libsamsung-ipc-cd80f4ce927a59634894c983471aa0db78ad93a0.tar.bz2 hardware_replicant_libsamsung-ipc-cd80f4ce927a59634894c983471aa0db78ad93a0.zip |
test: reuse libsamsung-ipc source files
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Diffstat (limited to 'samsung-ipc')
-rw-r--r-- | samsung-ipc/Makefile.am | 12 | ||||
-rw-r--r-- | samsung-ipc/common/Makefile.am | 18 | ||||
-rw-r--r-- | samsung-ipc/partitions/Makefile.am | 8 | ||||
-rw-r--r-- | samsung-ipc/tests/Makefile.am | 59 |
4 files changed, 30 insertions, 67 deletions
diff --git a/samsung-ipc/Makefile.am b/samsung-ipc/Makefile.am index 2bb18d9..ab33bba 100644 --- a/samsung-ipc/Makefile.am +++ b/samsung-ipc/Makefile.am @@ -14,20 +14,16 @@ lib_LTLIBRARIES = \ libsamsung-ipc.la \ $(NULL) -libsamsung_ipc_la_SOURCES = \ - $(NULL) - +# This defines libsamsung_ipc_la_SOURCES so we can reuse it in +# samsung-ipc/test/Makefile.am include $(top_srcdir)/samsung-ipc/common/Makefile.am -include $(top_srcdir)/samsung-ipc/devices/Makefile.am -include $(top_srcdir)/samsung-ipc/modems/Makefile.am -include $(top_srcdir)/samsung-ipc/partitions/Makefile.am libsamsung_ipc_la_LIBADD = \ $(OPENSSL_LIBS) \ $(NULL) -# As we reuse $(libsamsung_ipc_la_SOURCES) in the libsamsung-ipc-test test -# program, we need to tell the autotools to separate the libsamsung-ipc and +# As we reuse $(libsamsung_ipc_la_SOURCES) in samsung-ipc/common/Makefile.am, +# we need to tell the autotools to separate the libsamsung-ipc and # libsamsung-ipc-test .o, otherwise libsamsung-ipc' .o will be linked # directoy in libsamsung-ipc-test. # As they need to be compiled with different options, this is an issue. diff --git a/samsung-ipc/common/Makefile.am b/samsung-ipc/common/Makefile.am index 801dfb9..631c31e 100644 --- a/samsung-ipc/common/Makefile.am +++ b/samsung-ipc/common/Makefile.am @@ -1,3 +1,17 @@ +# To be able to test internal functions of libsamsung-ipc we need to give +# access to them to a test program (libsamsung-ipc-test). To do that, we +# simply re-included all the library source code inside that test program. +# +# To achieve that, This Makefile.am is included by both samsung-ipc/Makefile.am +# which has rules to build the libsamsung-ipc library and +# samsung-ipc/test/Makefile.am which has rules to build the test utility +# (libsamsung-ipc-test). +# +# This way both Makefile.am have access to libsamsung_ipc_la_SOURCES but +# only samsung-ipc/Makefile.am uses it to build the library. + +libsamsung_ipc_la_SOURCES = $(NULL) + libsamsung_ipc_la_SOURCES += \ $(top_srcdir)/samsung-ipc/ipc.c \ $(top_srcdir)/samsung-ipc/ipc.h \ @@ -13,3 +27,7 @@ libsamsung_ipc_la_SOURCES += \ $(top_srcdir)/samsung-ipc/rfs.c \ $(top_srcdir)/samsung-ipc/gen.c \ $(NULL) + +include $(top_srcdir)/samsung-ipc/devices/Makefile.am +include $(top_srcdir)/samsung-ipc/modems/Makefile.am +include $(top_srcdir)/samsung-ipc/partitions/Makefile.am diff --git a/samsung-ipc/partitions/Makefile.am b/samsung-ipc/partitions/Makefile.am index 85296f3..7402c54 100644 --- a/samsung-ipc/partitions/Makefile.am +++ b/samsung-ipc/partitions/Makefile.am @@ -1,6 +1,6 @@ libsamsung_ipc_la_SOURCES += \ - $(top_srcdir)/samsung-ipc/$(top_srcdir)/samsung-ipc/partitions/android/android.c \ - $(top_srcdir)/samsung-ipc/$(top_srcdir)/samsung-ipc/partitions/android/android.h \ - $(top_srcdir)/samsung-ipc/$(top_srcdir)/samsung-ipc/partitions/toc/toc.c \ - $(top_srcdir)/samsung-ipc/$(top_srcdir)/samsung-ipc/partitions/toc/toc.h \ + $(top_srcdir)/samsung-ipc/partitions/android/android.c \ + $(top_srcdir)/samsung-ipc/partitions/android/android.h \ + $(top_srcdir)/samsung-ipc/partitions/toc/toc.c \ + $(top_srcdir)/samsung-ipc/partitions/toc/toc.h \ $(NULL) diff --git a/samsung-ipc/tests/Makefile.am b/samsung-ipc/tests/Makefile.am index 591dfc8..38580c1 100644 --- a/samsung-ipc/tests/Makefile.am +++ b/samsung-ipc/tests/Makefile.am @@ -1,5 +1,9 @@ NULL = +# This defines libsamsung_ipc_la_SOURCES so it can be shared between +# samsung-ipc/Makefile.am (for the libsamsung-ipc library) and this Makefile.am. +include $(top_srcdir)/samsung-ipc/common/Makefile.am + AM_CFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/samsung-ipc \ @@ -18,61 +22,6 @@ libsamsung_ipc_test_SOURCES = \ $(top_srcdir)/samsung-ipc/tests/main.c \ $(top_srcdir)/samsung-ipc/tests/partitions/android.c \ $(top_srcdir)/samsung-ipc/tests/partitions/android.h \ - $(top_srcdir)/samsung-ipc/ipc.c \ - $(top_srcdir)/samsung-ipc/ipc.h \ - $(top_srcdir)/samsung-ipc/ipc_utils.c \ - $(top_srcdir)/samsung-ipc/utils.c \ - $(top_srcdir)/samsung-ipc/call.c \ - $(top_srcdir)/samsung-ipc/sms.c \ - $(top_srcdir)/samsung-ipc/sec.c \ - $(top_srcdir)/samsung-ipc/net.c \ - $(top_srcdir)/samsung-ipc/misc.c \ - $(top_srcdir)/samsung-ipc/svc.c \ - $(top_srcdir)/samsung-ipc/gprs.c \ - $(top_srcdir)/samsung-ipc/rfs.c \ - $(top_srcdir)/samsung-ipc/gen.c \ - $(top_srcdir)/samsung-ipc/devices/ipc_devices.c \ - $(top_srcdir)/samsung-ipc/devices/ipc_devices.h \ - $(top_srcdir)/samsung-ipc/devices/crespo/crespo.c \ - $(top_srcdir)/samsung-ipc/devices/crespo/crespo.h \ - $(top_srcdir)/samsung-ipc/devices/crespo/crespo_modem_ctl.h \ - $(top_srcdir)/samsung-ipc/devices/aries/aries.c \ - $(top_srcdir)/samsung-ipc/devices/aries/aries.h \ - $(top_srcdir)/samsung-ipc/devices/aries/onedram.h \ - $(top_srcdir)/samsung-ipc/devices/aries/phonet.h \ - $(top_srcdir)/samsung-ipc/devices/galaxys2/galaxys2.c \ - $(top_srcdir)/samsung-ipc/devices/galaxys2/galaxys2.h \ - $(top_srcdir)/samsung-ipc/devices/maguro/maguro.c \ - $(top_srcdir)/samsung-ipc/devices/maguro/maguro.h \ - $(top_srcdir)/samsung-ipc/devices/piranha/piranha.c \ - $(top_srcdir)/samsung-ipc/devices/piranha/piranha.h \ - $(top_srcdir)/samsung-ipc/devices/i9300/i9300.c \ - $(top_srcdir)/samsung-ipc/devices/i9300/i9300.h \ - $(top_srcdir)/samsung-ipc/devices/n7100/n7100.c \ - $(top_srcdir)/samsung-ipc/devices/n7100/n7100.h \ - $(top_srcdir)/samsung-ipc/devices/n5100/n5100.c \ - $(top_srcdir)/samsung-ipc/devices/n5100/n5100.h \ - $(top_srcdir)/samsung-ipc/devices/herolte/herolte.c \ - $(top_srcdir)/samsung-ipc/devices/herolte/herolte.h \ - $(top_srcdir)/samsung-ipc/devices/generic/generic.c \ - $(top_srcdir)/samsung-ipc/devices/generic/generic.h \ - $(top_srcdir)/samsung-ipc/modems/xmm616/xmm616.c \ - $(top_srcdir)/samsung-ipc/modems/xmm616/xmm616.h \ - $(top_srcdir)/samsung-ipc/modems/xmm626/xmm626.c \ - $(top_srcdir)/samsung-ipc/modems/xmm626/xmm626.h \ - $(top_srcdir)/samsung-ipc/modems/xmm626/xmm626_hsic.c \ - $(top_srcdir)/samsung-ipc/modems/xmm626/xmm626_hsic.h \ - $(top_srcdir)/samsung-ipc/modems/xmm626/xmm626_kernel_smdk4412.c \ - $(top_srcdir)/samsung-ipc/modems/xmm626/xmm626_kernel_smdk4412.h \ - $(top_srcdir)/samsung-ipc/modems/xmm626/xmm626_mipi.c \ - $(top_srcdir)/samsung-ipc/modems/xmm626/xmm626_mipi.h \ - $(top_srcdir)/samsung-ipc/modems/xmm626/xmm626_modem_if.h \ - $(top_srcdir)/samsung-ipc/modems/xmm626/xmm626_modem_link_device_hsic.h \ - $(top_srcdir)/samsung-ipc/modems/xmm626/xmm626_modem_prj.h \ - $(top_srcdir)/samsung-ipc/partitions/android/android.c \ - $(top_srcdir)/samsung-ipc/partitions/android/android.h \ - $(top_srcdir)/samsung-ipc/partitions/toc/toc.c \ - $(top_srcdir)/samsung-ipc/partitions/toc/toc.h \ $(NULL) libsamsung_ipc_test_SOURCES += $(libsamsung_ipc_la_SOURCES) |