@@ -54,10 +54,6 @@ SHLIB_EXPORTS = exports.txt
5454# Disable -bundle_loader on macOS.
5555BE_DLLLIBS =
5656
57- # By default, a library without an SONAME doesn't get a static library, so we
58- # add it to the build explicitly.
59- all : all-lib all-static-lib
60-
6157# Shared library stuff
6258include $(top_srcdir ) /src/Makefile.shlib
6359
@@ -66,6 +62,28 @@ include $(top_srcdir)/src/Makefile.shlib
6662% _shlib.o : % .c % .o
6763 $(CC ) $(CFLAGS ) $(CFLAGS_SL ) $(CPPFLAGS ) $(CPPFLAGS_SHLIB ) -c $< -o $@
6864
65+ .PHONY : all-tests
66+ all-tests : oauth_tests$(X )
67+
68+ oauth_tests$(X ) : test-oauth-curl.o oauth-utils.o $(WIN32RES ) | submake-libpgport submake-libpq
69+ $(CC ) $(CFLAGS ) $^ $(LDFLAGS ) $(LDFLAGS_EX ) $(SHLIB_LINK ) -o $@
70+
71+ #
72+ # Top-Level Targets
73+ #
74+ # The existence of a t/ folder induces the buildfarm to run Make directly on
75+ # this subdirectory, bypassing the recursion skip in src/interfaces/Makefile.
76+ # Wrap the standard build targets in a with_libcurl conditional to avoid
77+ # building OAuth code on platforms that haven't requested it. (The "clean"-style
78+ # targets remain available.)
79+ #
80+
81+ ifeq ($(with_libcurl ) , yes)
82+
83+ # By default, a library without an SONAME doesn't get a static library, so we
84+ # add it to the build explicitly.
85+ all : all-lib all-static-lib
86+
6987# Ignore the standard rules for SONAME-less installation; we want both the
7088# static and shared libraries to go into libdir.
7189install : all installdirs $(stlib ) $(shlib )
@@ -75,9 +93,19 @@ install: all installdirs $(stlib) $(shlib)
7593installdirs :
7694 $(MKDIR_P ) ' $(DESTDIR)$(libdir)'
7795
96+ check : all-tests
97+ $(prove_check )
98+
99+ installcheck : all-tests
100+ $(prove_installcheck )
101+
102+ endif # with_libcurl
103+
78104uninstall :
79105 rm -f ' $(DESTDIR)$(libdir)/$(stlib)'
80106 rm -f ' $(DESTDIR)$(libdir)/$(shlib)'
81107
82108clean distclean : clean-lib
83109 rm -f $(OBJS ) $(OBJS_STATIC ) $(OBJS_SHLIB )
110+ rm -f test-oauth-curl.o oauth_tests$(X )
111+ rm -rf tmp_check
0 commit comments