[PATCH 30/31] build: Directly reference libraries in tests

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Oct 8 10:43:32 UTC 2018


Remove use of TMPINSTALL_FILES.
---
 cpukit/Makefile.am              | 41 -----------------------------------------
 testsuites/automake/compile.am  | 18 +++++++++++++-----
 testsuites/fstests/Makefile.am  | 18 +++++++++---------
 testsuites/libtests/Makefile.am |  8 ++++----
 testsuites/samples/Makefile.am  |  2 +-
 5 files changed, 27 insertions(+), 60 deletions(-)

diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
index f12fd02434..cfe1f58fab 100644
--- a/cpukit/Makefile.am
+++ b/cpukit/Makefile.am
@@ -4,14 +4,9 @@ include $(top_srcdir)/automake/compile.am
 include $(top_srcdir)/automake/multilib.am
 
 project_lib_LIBRARIES =
-TMPINSTALL_FILES =
 
 project_lib_LIBRARIES += librtemscpu.a
 
-$(PROJECT_LIB)/librtemscpu.a: librtemscpu.a
-	$(INSTALL_DATA) $< $(PROJECT_LIB)/librtemscpu.a
-TMPINSTALL_FILES += $(PROJECT_LIB)/librtemscpu.a
-
 librtemscpu_a_SOURCES =
 librtemscpu_a_SOURCES += dev/i2c/eeprom.c
 librtemscpu_a_SOURCES += dev/i2c/fpga-i2c-slave.c
@@ -1813,38 +1808,22 @@ _SUBDIRS += libnetworking
 
 project_lib_LIBRARIES += libftpd.a
 
-$(PROJECT_LIB)/libftpd.a: libftpd.a
-	$(INSTALL_DATA) $< $(PROJECT_LIB)/libftpd.a
-TMPINSTALL_FILES += $(PROJECT_LIB)/libftpd.a
-
 libftpd_a_SOURCES =
 libftpd_a_SOURCES += ftpd/ftpd.c
 libftpd_a_SOURCES += ftpd/ftpd-init.c
 
 project_lib_LIBRARIES += libftpfs.a
 
-$(PROJECT_LIB)/libftpfs.a: libftpfs.a
-	$(INSTALL_DATA) $< $(PROJECT_LIB)/libftpfs.a
-TMPINSTALL_FILES += $(PROJECT_LIB)/libftpfs.a
-
 libftpfs_a_SOURCES =
 libftpfs_a_SOURCES += libnetworking/lib/ftpfs.c
 
 project_lib_LIBRARIES += libtftpfs.a
 
-$(PROJECT_LIB)/libtftpfs.a: libtftpfs.a
-	$(INSTALL_DATA) $< $(PROJECT_LIB)/libtftpfs.a
-TMPINSTALL_FILES += $(PROJECT_LIB)/libtftpfs.a
-
 libtftpfs_a_SOURCES =
 libtftpfs_a_SOURCES += libnetworking/lib/tftpDriver.c
 
 project_lib_LIBRARIES += libtelnetd.a
 
-$(PROJECT_LIB)/libtelnetd.a: libtelnetd.a
-	$(INSTALL_DATA) $< $(PROJECT_LIB)/libtelnetd.a
-TMPINSTALL_FILES += $(PROJECT_LIB)/libtelnetd.a
-
 libtelnetd_a_SOURCES =
 libtelnetd_a_SOURCES += telnetd/check_passwd.c
 libtelnetd_a_SOURCES += telnetd/des.c
@@ -1856,10 +1835,6 @@ if LIBDEBUGGER
 
 project_lib_LIBRARIES += libdebugger.a
 
-$(PROJECT_LIB)/libdebugger.a: libdebugger.a
-	$(INSTALL_DATA) $< $(PROJECT_LIB)/libdebugger.a
-TMPINSTALL_FILES += $(PROJECT_LIB)/libdebugger.a
-
 libdebugger_a_SOURCES =
 libdebugger_a_SOURCES += libdebugger/rtems-debugger-block.c
 libdebugger_a_SOURCES += libdebugger/rtems-debugger-cmd.c
@@ -1874,10 +1849,6 @@ endif
 
 project_lib_LIBRARIES += libjffs2.a
 
-$(PROJECT_LIB)/libjffs2.a: libjffs2.a
-	$(INSTALL_DATA) $< $(PROJECT_LIB)/libjffs2.a
-TMPINSTALL_FILES += $(PROJECT_LIB)/libjffs2.a
-
 libjffs2_a_SOURCES =
 libjffs2_a_SOURCES += libfs/src/jffs2/src/build.c
 libjffs2_a_SOURCES += libfs/src/jffs2/src/compat-crc32.c
@@ -1905,10 +1876,6 @@ libjffs2_a_CPPFLAGS += -I$(srcdir)/libfs/src/jffs2/include
 
 project_lib_LIBRARIES += libz.a
 
-$(PROJECT_LIB)/libz.a: libz.a
-	$(INSTALL_DATA) $< $(PROJECT_LIB)/libz.a
-TMPINSTALL_FILES += $(PROJECT_LIB)/libz.a
-
 libz_a_SOURCES =
 libz_a_SOURCES += zlib/adler32.c
 libz_a_SOURCES += zlib/compress.c
@@ -1930,10 +1897,6 @@ if LIBNETWORKING
 
 project_lib_LIBRARIES += libpppd.a
 
-$(PROJECT_LIB)/libpppd.a: libpppd.a
-	$(INSTALL_DATA) $< $(PROJECT_LIB)/libpppd.a
-TMPINSTALL_FILES += $(PROJECT_LIB)/libpppd.a
-
 libpppd_a_SOURCES =
 libpppd_a_SOURCES += pppd/auth.c
 libpppd_a_SOURCES += pppd/ccp.c
@@ -1956,10 +1919,6 @@ if HAS_PTHREADS
 
 project_lib_LIBRARIES += libmghttpd.a
 
-$(PROJECT_LIB)/libmghttpd.a: libmghttpd.a
-	$(INSTALL_DATA) $< $(PROJECT_LIB)/libmghttpd.a
-TMPINSTALL_FILES += $(PROJECT_LIB)/libmghttpd.a
-
 libmghttpd_a_SOURCES =
 libmghttpd_a_SOURCES += mghttpd/mongoose.c
 
diff --git a/testsuites/automake/compile.am b/testsuites/automake/compile.am
index 3cd08c4b9e..f7f0fb623f 100644
--- a/testsuites/automake/compile.am
+++ b/testsuites/automake/compile.am
@@ -8,13 +8,21 @@ NM = @NM@
 SIZE = @SIZE@
 STRIP = @STRIP@
 
-##
+TEST_LD_FLAGS = -Wl,--wrap=printf -Wl,--wrap=puts -Wl,--wrap=putchar
+
 AM_CPPFLAGS = $(TEST_FLAGS) @RTEMS_CPPFLAGS@ @RTEMS_BSP_CPPFLAGS@
 AM_CFLAGS   = $(TEST_C_FLAGS)
 AM_CXXFLAGS = $(TEST_CXX_FLAGS)
-AM_LDFLAGS  = -B$(RTEMS_BSP_LIBBSP_PATH) $(GCCSPECS) \
-              -L$(PROJECT_LIB) \
-              -L$(RTEMS_BSP_ARCH_LINKCMDS_PATH) \
-              $(TEST_LD_FLAGS)
+
+AM_LDFLAGS =
+AM_LDFLAGS += -B$(RTEMS_ROOT)lib/libbsp/@RTEMS_CPU@/@RTEMS_BSP_FAMILY@
+AM_LDFLAGS += $(GCCSPECS)
+AM_LDFLAGS += -L$(RTEMS_ROOT)cpukit
+AM_LDFLAGS += -L$(RTEMS_BSP_ARCH_LINKCMDS_PATH)
+AM_LDFLAGS += $(TEST_LD_FLAGS)
+
+LDADD =
+LDADD += $(RTEMS_ROOT)lib/libbsp/@RTEMS_CPU@/@RTEMS_BSP_FAMILY@/librtemsbsp.a
+LDADD += $(RTEMS_ROOT)cpukit/librtemscpu.a
 
 CLEANFILES = *.num *.nxe *.elf *.srec* *.bin *.bt *.ralf
diff --git a/testsuites/fstests/Makefile.am b/testsuites/fstests/Makefile.am
index 51ab587475..81ce635dd7 100644
--- a/testsuites/fstests/Makefile.am
+++ b/testsuites/fstests/Makefile.am
@@ -133,7 +133,7 @@ fsjffs2gc01_SOURCES = fsjffs2gc01/init.c support/fstest_support.c \
 	jffs2_support/fs_config.h
 fsjffs2gc01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_fsjffs2gc01) \
 	$(support_includes) $(test_includes) -I$(top_srcdir)/jffs2_support
-fsjffs2gc01_LDADD = -ljffs2
+fsjffs2gc01_LDADD = $(RTEMS_ROOT)cpukit/libjffs2.a $(LDADD)
 endif
 
 if TEST_fsnofs01
@@ -267,7 +267,7 @@ jffs2_fserror_SOURCES = fserror/test.c support/fstest_support.c \
 	jffs2_support/fs_config.h
 jffs2_fserror_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_jffs2_fserror) \
 	$(support_includes) $(test_includes) -I$(top_srcdir)/jffs2_support
-jffs2_fserror_LDADD = -ljffs2
+jffs2_fserror_LDADD = $(RTEMS_ROOT)cpukit/libjffs2.a $(LDADD)
 endif
 
 if TEST_jffs2_fslink
@@ -279,7 +279,7 @@ jffs2_fslink_SOURCES = fslink/test.c support/fstest_support.c \
 	jffs2_support/fs_config.h
 jffs2_fslink_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_jffs2_fslink) \
 	$(support_includes) $(test_includes) -I$(top_srcdir)/jffs2_support
-jffs2_fslink_LDADD = -ljffs2
+jffs2_fslink_LDADD = $(RTEMS_ROOT)cpukit/libjffs2.a $(LDADD)
 endif
 
 if TEST_jffs2_fspatheval
@@ -292,7 +292,7 @@ jffs2_fspatheval_SOURCES = fspatheval/test.c support/fstest_support.c \
 jffs2_fspatheval_CPPFLAGS = $(AM_CPPFLAGS) \
 	$(TEST_FLAGS_jffs2_fspatheval) $(support_includes) $(test_includes) \
 	-I$(top_srcdir)/jffs2_support
-jffs2_fspatheval_LDADD = -ljffs2
+jffs2_fspatheval_LDADD = $(RTEMS_ROOT)cpukit/libjffs2.a $(LDADD)
 endif
 
 if TEST_jffs2_fspermission
@@ -305,7 +305,7 @@ jffs2_fspermission_SOURCES = fspermission/test.c \
 jffs2_fspermission_CPPFLAGS = $(AM_CPPFLAGS) \
 	$(TEST_FLAGS_jffs2_fspermission) $(support_includes) $(test_includes) \
 	-I$(top_srcdir)/jffs2_support
-jffs2_fspermission_LDADD = -ljffs2
+jffs2_fspermission_LDADD = $(RTEMS_ROOT)cpukit/libjffs2.a $(LDADD)
 endif
 
 if TEST_jffs2_fsrdwr
@@ -317,7 +317,7 @@ jffs2_fsrdwr_SOURCES = fsrdwr/init.c support/fstest_support.c \
 	jffs2_support/fs_config.h
 jffs2_fsrdwr_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_jffs2_fsrdwr) \
 	$(support_includes) $(test_includes) -I$(top_srcdir)/jffs2_support
-jffs2_fsrdwr_LDADD = -ljffs2
+jffs2_fsrdwr_LDADD = $(RTEMS_ROOT)cpukit/libjffs2.a $(LDADD)
 endif
 
 if TEST_jffs2_fsscandir01
@@ -330,7 +330,7 @@ jffs2_fsscandir01_SOURCES = fsscandir01/init.c \
 jffs2_fsscandir01_CPPFLAGS = $(AM_CPPFLAGS) \
 	$(TEST_FLAGS_jffs2_fsscandir01) $(support_includes) $(test_includes) \
 	-I$(top_srcdir)/jffs2_support
-jffs2_fsscandir01_LDADD = -ljffs2
+jffs2_fsscandir01_LDADD = $(RTEMS_ROOT)cpukit/libjffs2.a $(LDADD)
 endif
 
 if TEST_jffs2_fssymlink
@@ -343,7 +343,7 @@ jffs2_fssymlink_SOURCES = fssymlink/test.c support/fstest_support.c \
 jffs2_fssymlink_CPPFLAGS = $(AM_CPPFLAGS) \
 	$(TEST_FLAGS_jffs2_fssymlink) $(support_includes) $(test_includes) \
 	-I$(top_srcdir)/jffs2_support
-jffs2_fssymlink_LDADD = -ljffs2
+jffs2_fssymlink_LDADD = $(RTEMS_ROOT)cpukit/libjffs2.a $(LDADD)
 endif
 
 if TEST_jffs2_fstime
@@ -355,7 +355,7 @@ jffs2_fstime_SOURCES = fstime/test.c support/fstest_support.c \
 	jffs2_support/fs_config.h
 jffs2_fstime_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_jffs2_fstime) \
 	$(support_includes) $(test_includes) -I$(top_srcdir)/jffs2_support
-jffs2_fstime_LDADD = -ljffs2
+jffs2_fstime_LDADD = $(RTEMS_ROOT)cpukit/libjffs2.a $(LDADD)
 endif
 
 if TEST_mdosfs_fserror
diff --git a/testsuites/libtests/Makefile.am b/testsuites/libtests/Makefile.am
index 36f7a2f84c..25c0499f8b 100644
--- a/testsuites/libtests/Makefile.am
+++ b/testsuites/libtests/Makefile.am
@@ -246,7 +246,7 @@ debugger01_SOURCES = debugger01/init.c debugger01/remote.c \
 	debugger01/system.h
 debugger01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_debugger01) \
 	$(support_includes)
-debugger01_LDADD = -ldebugger
+debugger01_LDADD = $(RTEMS_ROOT)cpukit/libdebugger.a $(LDADD)
 endif
 endif
 
@@ -582,7 +582,7 @@ lib_docs += ftp01/ftp01.doc
 ftp01_SOURCES = ftp01/init.c
 ftp01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_ftp01) \
 	$(support_includes) -I$(RTEMS_SOURCE_ROOT)/cpukit/libnetworking
-ftp01_LDADD = -lftpd -lftpfs
+ftp01_LDADD = $(RTEMS_ROOT)cpukit/libftpd.a $(RTEMS_ROOT)cpukit/libftpfs.a $(LDADD)
 endif
 endif
 
@@ -794,7 +794,7 @@ mghttpd01_SOURCES = mghttpd01/init.c mghttpd01_tar.c \
 	mghttpd01/test-http-client.h
 mghttpd01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mghttpd01) \
 	$(support_includes) -I$(RTEMS_SOURCE_ROOT)/cpukit/libnetworking
-mghttpd01_LDADD = -lmghttpd
+mghttpd01_LDADD = $(RTEMS_ROOT)cpukit/libmghttpd.a $(LDADD)
 mghttpd01_tar.c: mghttpd01/mghttpd01.tar
 	$(AM_V_GEN)$(BIN2C) -C $< $@
 mghttpd01_tar.h: mghttpd01/mghttpd01.tar
@@ -1056,7 +1056,7 @@ tar01_SOURCES += tar01_tar_xz.c tar01_tar_xz.h
 endif
 tar01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_tar01) \
 	$(support_includes) $(test_includes) -I$(top_srcdir)/include
-tar01_LDADD = -lrtemscpu -lz
+tar01_LDADD = $(RTEMS_ROOT)cpukit/librtemscpu.a $(RTEMS_ROOT)cpukit/libz.a $(LDADD)
 tar01.tar: Makefile
 	$(AM_V_GEN)rm -rf tar01_fs
 	$(AM_V_GEN)$(MKDIR_P) tar01_fs/home
diff --git a/testsuites/samples/Makefile.am b/testsuites/samples/Makefile.am
index dbb4a5bd39..0d3121ab14 100644
--- a/testsuites/samples/Makefile.am
+++ b/testsuites/samples/Makefile.am
@@ -132,7 +132,7 @@ pppd_SOURCES = pppd/init.c pppd/pppdapp.c pppd/netconfig.h \
 	pppd/system.h
 pppd_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_pppd) $(support_includes) \
 	-I$(RTEMS_SOURCE_ROOT)/cpukit/libnetworking
-pppd_LDADD = -lpppd
+pppd_LDADD = $(RTEMS_ROOT)cpukit/libpppd.a $(LDADD)
 endif
 endif
 endif
-- 
2.16.4




More information about the devel mailing list