aboutsummaryrefslogtreecommitdiff
path: root/test/miscellaneous/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'test/miscellaneous/Makefile.am')
-rw-r--r--test/miscellaneous/Makefile.am33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/miscellaneous/Makefile.am b/test/miscellaneous/Makefile.am
index e8bcf48de..c728784ee 100644
--- a/test/miscellaneous/Makefile.am
+++ b/test/miscellaneous/Makefile.am
@@ -13,3 +13,36 @@ if ODP_ABI_COMPAT
odp_api_headers_CFLAGS += -Wconversion
endif
odp_api_headers_SOURCES = odp_api_headers.c
+
+PKGCONFIG = PKG_CONFIG_PATH=$(libdir)/pkgconfig:$$PKG_CONFIG_PATH pkg-config --cflags --libs
+
+if enable_shared
+
+PROGRAM_shared = odp_api_headers_shared
+
+installcheck-local: $(PROGRAM_shared)
+
+$(PROGRAM_shared): $(srcdir)/$(odp_api_headers_SOURCES)
+ $(CC) $(AM_CFLAGS) $(CFLAGS) $^ -o $@ \
+ `$(PKGCONFIG) libodphelper` `$(PKGCONFIG) lib$(ODP_LIB_NAME)`
+if ! cross_compile
+ LD_LIBRARY_PATH=$(libdir) ./$@
+endif
+endif
+
+if enable_static
+
+PROGRAM_static = odp_api_headers_static
+
+installcheck-local: $(PROGRAM_static)
+
+$(PROGRAM_static): $(srcdir)/$(odp_api_headers_SOURCES)
+ $(CC) $(AM_CFLAGS) $(CFLAGS) $^ -o $@ \
+ `$(PKGCONFIG) --static libodphelper | sed "s/-lodphelper/-l:libodphelper.a/"` \
+ `$(PKGCONFIG) --static lib$(ODP_LIB_NAME) | sed "s/-l$(ODP_LIB_NAME)/-l:lib$(ODP_LIB_NAME).a/"`
+if ! cross_compile
+ ./$@
+endif
+endif
+
+DISTCLEANFILES = $(PROGRAM_shared) $(PROGRAM_static)