| 1 | # Makefile.am -- Automake makefile for remctl. |
|---|
| 2 | # |
|---|
| 3 | # Written by Russ Allbery <rra@stanford.edu> |
|---|
| 4 | # Copyright 2006, 2007, 2008, 2009 |
|---|
| 5 | # Board of Trustees, Leland Stanford Jr. University |
|---|
| 6 | # |
|---|
| 7 | # See LICENSE for licensing terms. |
|---|
| 8 | |
|---|
| 9 | # These three lists of files are needed for Perl builds, Python builds, and |
|---|
| 10 | # for the test suite and are not generated or touched by configure. They're |
|---|
| 11 | # listed here to be added to EXTRA_DIST and so that they can be copied over |
|---|
| 12 | # properly for builddir != srcdir builds. |
|---|
| 13 | PERL_FILES = perl/Remctl.xs perl/typemap perl/t/pod.t perl/t/stanford-netdb.t |
|---|
| 14 | PHP_FILES = php/README php/php_remctl.c php/test-wrapper php/tests/001.phpt \ |
|---|
| 15 | php/tests/002.phpt php/tests/003.phpt |
|---|
| 16 | PYTHON_FILES = python/MANIFEST.in python/README python/_remctlmodule.c |
|---|
| 17 | |
|---|
| 18 | AUTOMAKE_OPTIONS = foreign subdir-objects |
|---|
| 19 | ACLOCAL_AMFLAGS = -I m4 |
|---|
| 20 | EXTRA_DIST = LICENSE Makefile.w32 autogen client/libremctl.rc client/mapfile \ |
|---|
| 21 | client/remctl.rc config.h.w32 configure.bat docs/api/remctl.pod \ |
|---|
| 22 | docs/api/remctl_close.pod docs/api/remctl_command.pod \ |
|---|
| 23 | docs/api/remctl_error.pod docs/api/remctl_new.pod \ |
|---|
| 24 | docs/api/remctl_open.pod docs/api/remctl_output.pod docs/design.html \ |
|---|
| 25 | docs/extending docs/protocol-v3 docs/protocol.txt docs/protocol.html \ |
|---|
| 26 | docs/protocol.xml docs/remctl.pod docs/remctld.8.in docs/remctld.pod \ |
|---|
| 27 | examples/remctl.conf examples/rsh-wrapper examples/xinetd \ |
|---|
| 28 | java/.classpath java/.project java/Makefile java/README \ |
|---|
| 29 | java/bcsKeytab.conf java/gss_jaas.conf java/j3.conf java/k5.conf \ |
|---|
| 30 | java/org/eyrie/eagle/remctl/Remctl.java \ |
|---|
| 31 | java/org/eyrie/eagle/remctl/RemctlClient.java \ |
|---|
| 32 | java/org/eyrie/eagle/remctl/RemctlServer.java java/t5.java \ |
|---|
| 33 | java/t7.java portable/getaddrinfo.h portable/getnameinfo.h \ |
|---|
| 34 | portable/getopt.h portable/gssapi.h portable/macros.h \ |
|---|
| 35 | portable/socket.h portable/stdbool.h portable/system.h \ |
|---|
| 36 | portable/uio.h portable/winsock.c remctl.spec \ |
|---|
| 37 | tests/TESTS tests/client/remctl-t tests/data/README \ |
|---|
| 38 | tests/data/acl-bad-include tests/data/acl-bad-syntax \ |
|---|
| 39 | tests/data/acl-nonexistant tests/data/acl-recursive \ |
|---|
| 40 | tests/data/acl-simple tests/data/acl-too-long tests/data/acl-valid-3 \ |
|---|
| 41 | tests/data/acls/VALID_09 tests/data/acls/val\#id \ |
|---|
| 42 | tests/data/acls/val.id tests/data/acls/valid tests/data/acls/valid-2 \ |
|---|
| 43 | tests/data/acls/val~id tests/data/acls2/valid-4 tests/data/cmd-argv \ |
|---|
| 44 | tests/data/cmd-env tests/data/cmd-hello tests/data/cmd-status \ |
|---|
| 45 | tests/data/conf-simple tests/data/conf-test \ |
|---|
| 46 | tests/data/configs/bad-logmask-1 tests/data/configs/bad-logmask-2 \ |
|---|
| 47 | tests/data/configs/bad-logmask-3 tests/data/configs/bad-logmask-4 \ |
|---|
| 48 | tests/data/configs/bad-option-1 tests/data/gput \ |
|---|
| 49 | tests/docs/pod-spelling-t tests/docs/pod-t tests/tap/kerberos.sh \ |
|---|
| 50 | tests/tap/libtap.sh tests/tap/remctl.sh tests/server/misc-t \ |
|---|
| 51 | tests/util/xmalloc-t $(PERL_FILES) $(PHP_FILES) $(PYTHON_FILES) |
|---|
| 52 | |
|---|
| 53 | # Set this globally, since we have too many header files that include the |
|---|
| 54 | # GSS-API headers even if the code itself doesn't call GSS-API functions. |
|---|
| 55 | AM_CPPFLAGS = $(GSSAPI_CPPFLAGS) |
|---|
| 56 | |
|---|
| 57 | lib_LTLIBRARIES = client/libremctl.la |
|---|
| 58 | client_libremctl_la_SOURCES = client/api.c client/client-v1.c \ |
|---|
| 59 | client/client-v2.c client/error.c client/internal.h client/open.c |
|---|
| 60 | client_libremctl_la_LDFLAGS = -version-info 1:2:0 $(VERSION_LDFLAGS) \ |
|---|
| 61 | $(GSSAPI_LDFLAGS) |
|---|
| 62 | client_libremctl_la_LIBADD = util/libutil.la $(GSSAPI_LIBS) |
|---|
| 63 | include_HEADERS = client/remctl.h |
|---|
| 64 | |
|---|
| 65 | noinst_LTLIBRARIES = portable/libportable.la util/libutil.la |
|---|
| 66 | portable_libportable_la_SOURCES = portable/dummy.c |
|---|
| 67 | portable_libportable_la_LIBADD = $(LTLIBOBJS) |
|---|
| 68 | util_libutil_la_SOURCES = util/concat.c util/fdflag.c util/gss-errors.c \ |
|---|
| 69 | util/gss-tokens.c util/messages-die.c util/messages.c util/network.c \ |
|---|
| 70 | util/tokens.c util/util.h util/vector.c util/xmalloc.c util/xwrite.c |
|---|
| 71 | util_libutil_la_LDFLAGS = $(GSSAPI_LDFLAGS) |
|---|
| 72 | util_libutil_la_LIBADD = portable/libportable.la $(GSSAPI_LIBS) |
|---|
| 73 | |
|---|
| 74 | bin_PROGRAMS = client/remctl |
|---|
| 75 | client_remctl_SOURCES = client/remctl.c |
|---|
| 76 | client_remctl_LDADD = client/libremctl.la util/libutil.la |
|---|
| 77 | |
|---|
| 78 | sbin_PROGRAMS = server/remctld |
|---|
| 79 | server_remctld_SOURCES = server/commands.c server/config.c server/generic.c \ |
|---|
| 80 | server/logging.c server/internal.h server/remctld.c \ |
|---|
| 81 | server/server-v1.c server/server-v2.c |
|---|
| 82 | server_remctld_CPPFLAGS = -DCONFIG_FILE=\"$(sysconfdir)/remctl.conf\" \ |
|---|
| 83 | $(GSSAPI_CPPFLAGS) $(GPUT_CPPFLAGS) |
|---|
| 84 | server_remctld_LDFLAGS = $(GSSAPI_LDFLAGS) $(GPUT_LDFLAGS) |
|---|
| 85 | server_remctld_LDADD = util/libutil.la $(GSSAPI_LIBS) $(GPUT_LIBS) |
|---|
| 86 | |
|---|
| 87 | dist_man_MANS = docs/api/remctl.3 docs/api/remctl_close.3 \ |
|---|
| 88 | docs/api/remctl_command.3 docs/api/remctl_error.3 \ |
|---|
| 89 | docs/api/remctl_new.3 docs/api/remctl_open.3 \ |
|---|
| 90 | docs/api/remctl_output.3 docs/remctl.1 |
|---|
| 91 | man_MANS = docs/remctld.8 |
|---|
| 92 | |
|---|
| 93 | docs/remctld.8: $(srcdir)/docs/remctld.8.in |
|---|
| 94 | [ -d docs ] || mkdir docs |
|---|
| 95 | sed 's%\(\\f(CI\)*\@sysconfdir\(\\fI\)*\@%$(sysconfdir)%' \ |
|---|
| 96 | < $(srcdir)/docs/remctld.8.in > $@ |
|---|
| 97 | |
|---|
| 98 | # Add symlinks for the man pages that document multiple functions. |
|---|
| 99 | install-data-hook: |
|---|
| 100 | rm -f $(DESTDIR)$(man3dir)/remctl_result_free.3 |
|---|
| 101 | $(LN_S) remctl.3 $(DESTDIR)$(man3dir)/remctl_result_free.3 |
|---|
| 102 | rm -f $(DESTDIR)$(man3dir)/remctl_commandv.3 |
|---|
| 103 | $(LN_S) remctl_command.3 $(DESTDIR)$(man3dir)/remctl_commandv.3 |
|---|
| 104 | |
|---|
| 105 | CLEANFILES = docs/remctld.8 stamp-python |
|---|
| 106 | DISTCLEANFILES = perl/Makefile python/MANIFEST |
|---|
| 107 | MAINTAINERCLEANFILES = Makefile.in aclocal.m4 build-aux/compile \ |
|---|
| 108 | build-aux/config.guess build-aux/config.sub build-aux/depcomp \ |
|---|
| 109 | build-aux/install-sh build-aux/ltmain.sh build-aux/missing \ |
|---|
| 110 | config.h.in config.h.in~ configure docs/api/*.3 docs/protocol.html \ |
|---|
| 111 | docs/protocol.txt docs/remctl.1 docs/remctld.8.in \ |
|---|
| 112 | m4/libtool.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 \ |
|---|
| 113 | m4/lt~obsolete.m4 |
|---|
| 114 | |
|---|
| 115 | # Automake should deal with the first part of this automatically, but it |
|---|
| 116 | # doesn't. Probably a bug in the non-recursive support. Also run make clean |
|---|
| 117 | # in the perl and php directories if needed and clean up after Python. |
|---|
| 118 | clean-local: |
|---|
| 119 | -rm -rf server/.libs tests/.libs tests/client/.libs tests/data/.libs \ |
|---|
| 120 | tests/portable/.libs tests/server/.libs tests/util/.libs |
|---|
| 121 | set -e; if [ -f "perl/Makefile" ] ; then \ |
|---|
| 122 | cd perl && $(MAKE) clean ; \ |
|---|
| 123 | cd perl && [ ! -f Makefile.old ] || mv Makefile.old Makefile ; \ |
|---|
| 124 | fi |
|---|
| 125 | set -e; if [ -f "php/Makefile" ] ; then \ |
|---|
| 126 | cd php && $(MAKE) clean ; \ |
|---|
| 127 | fi |
|---|
| 128 | rm -rf python/build python/dist python/*.pyc |
|---|
| 129 | |
|---|
| 130 | # Remove the test files we copied over if srcdir != builddir. Also clean the |
|---|
| 131 | # Perl, PHP, and Python directories on make distclean if needed. |
|---|
| 132 | # |
|---|
| 133 | # phpize --clean is stupid and requires that config.m4 exist, but it was |
|---|
| 134 | # already deleted by the regular distclean target. Hack around that. |
|---|
| 135 | distclean-local: |
|---|
| 136 | set -e; if [ x"$(builddir)" != x"$(srcdir)" ] ; then \ |
|---|
| 137 | rm -rf php ; \ |
|---|
| 138 | for f in $(PERL_FILES) ; do \ |
|---|
| 139 | rm -f "$(builddir)/$$f" ; \ |
|---|
| 140 | done ; \ |
|---|
| 141 | rmdir perl/t 2>/dev/null || true ; \ |
|---|
| 142 | for f in $(PYTHON_FILES) ; do \ |
|---|
| 143 | rm -f "$(builddir)/$$f" ; \ |
|---|
| 144 | done \ |
|---|
| 145 | else \ |
|---|
| 146 | if [ -n "$(PHPIZE)" ] ; then \ |
|---|
| 147 | cd php && touch config.m4 && $(PHPIZE) --clean ; \ |
|---|
| 148 | fi ; \ |
|---|
| 149 | rm -f php/config.h.in~ php/config.m4 ; \ |
|---|
| 150 | fi |
|---|
| 151 | |
|---|
| 152 | # A set of flags for warnings. Add -O because gcc won't find some warnings |
|---|
| 153 | # without optimization turned on, and add -DDEBUG=1 so we'll also compile all |
|---|
| 154 | # debugging code and test it. |
|---|
| 155 | WARNINGS = -g -O -DDEBUG=1 -Wall -W -Wendif-labels -Wpointer-arith \ |
|---|
| 156 | -Wbad-function-cast -Wwrite-strings -Wstrict-prototypes \ |
|---|
| 157 | -Wmissing-prototypes -Wnested-externs -Werror |
|---|
| 158 | |
|---|
| 159 | # Suppress some warnings for Perl, PHP, and Python code because the |
|---|
| 160 | # auto-generated code doesn't pass them. |
|---|
| 161 | PERL_WARNINGS = -Wno-write-strings -Wno-nested-externs -Wno-strict-prototypes |
|---|
| 162 | PHP_WARNINGS = -Wno-strict-prototypes -Wno-write-strings \ |
|---|
| 163 | -Wno-missing-prototypes -Wno-unused-parameter |
|---|
| 164 | PYTHON_WARNINGS = -Wno-unused-parameter |
|---|
| 165 | |
|---|
| 166 | warnings: |
|---|
| 167 | $(MAKE) CFLAGS='$(WARNINGS)' |
|---|
| 168 | $(MAKE) CFLAGS='$(WARNINGS)' $(check_PROGRAMS) |
|---|
| 169 | |
|---|
| 170 | # The bits below are for the test suite, not for the main package. |
|---|
| 171 | check_PROGRAMS = tests/runtests tests/client/api-t tests/client/large-t \ |
|---|
| 172 | tests/client/open-t tests/data/cmd-background tests/data/cmd-closed \ |
|---|
| 173 | tests/data/cmd-stdin tests/data/cmd-streaming \ |
|---|
| 174 | tests/portable/asprintf-t tests/portable/daemon-t \ |
|---|
| 175 | tests/portable/getaddrinfo-t tests/portable/getnameinfo-t \ |
|---|
| 176 | tests/portable/getopt-t tests/portable/inet_aton-t \ |
|---|
| 177 | tests/portable/inet_ntoa-t tests/portable/inet_ntop-t \ |
|---|
| 178 | tests/portable/setenv-t tests/portable/snprintf-t \ |
|---|
| 179 | tests/portable/strlcat-t tests/portable/strlcpy-t \ |
|---|
| 180 | tests/server/accept-t tests/server/acl-t tests/server/config-t \ |
|---|
| 181 | tests/server/continue-t tests/server/env-t tests/server/errors-t \ |
|---|
| 182 | tests/server/invalid-t tests/server/logging-t tests/server/stdin-t \ |
|---|
| 183 | tests/server/streaming-t tests/server/version-t tests/util/concat-t \ |
|---|
| 184 | tests/util/fdflag-t tests/util/gss-tokens-t tests/util/messages-t \ |
|---|
| 185 | tests/util/network-t tests/util/tokens-t tests/util/vector-t \ |
|---|
| 186 | tests/util/xmalloc tests/util/xwrite-t |
|---|
| 187 | check_LIBRARIES = tests/tap/libtap.a |
|---|
| 188 | tests_runtests_CPPFLAGS = -DSOURCE='"$(abs_top_srcdir)/tests"' \ |
|---|
| 189 | -DBUILD='"$(abs_top_builddir)/tests"' |
|---|
| 190 | tests_tap_libtap_a_CPPFLAGS = -I$(abs_top_srcdir)/tests |
|---|
| 191 | tests_tap_libtap_a_SOURCES = tests/tap/basic.c tests/tap/basic.h \ |
|---|
| 192 | tests/tap/kerberos.h tests/tap/kinit.c tests/tap/messages.c \ |
|---|
| 193 | tests/tap/messages.h tests/tap/remctl.c tests/tap/remctl.h |
|---|
| 194 | |
|---|
| 195 | # Used for server tests. |
|---|
| 196 | SERVER_FILES = server/commands.c server/config.c server/generic.c \ |
|---|
| 197 | server/logging.c server/server-v1.c server/server-v2.c |
|---|
| 198 | |
|---|
| 199 | # All of the test programs. |
|---|
| 200 | tests_client_api_t_LDADD = client/libremctl.la tests/tap/libtap.a \ |
|---|
| 201 | util/libutil.la |
|---|
| 202 | tests_client_open_t_LDFLAGS = $(GSSAPI_LDFLAGS) |
|---|
| 203 | tests_client_open_t_LDADD = client/libremctl.la tests/tap/libtap.a \ |
|---|
| 204 | util/libutil.la $(GSSAPI_LIBS) |
|---|
| 205 | tests_client_large_t_LDADD = client/libremctl.la tests/tap/libtap.a \ |
|---|
| 206 | util/libutil.la |
|---|
| 207 | tests_data_cmd_stdin_LDADD = util/libutil.la |
|---|
| 208 | tests_portable_asprintf_t_SOURCES = tests/portable/asprintf-t.c \ |
|---|
| 209 | tests/portable/asprintf.c |
|---|
| 210 | tests_portable_asprintf_t_LDADD = tests/tap/libtap.a util/libutil.la |
|---|
| 211 | tests_portable_daemon_t_SOURCES = tests/portable/daemon-t.c \ |
|---|
| 212 | tests/portable/daemon.c |
|---|
| 213 | tests_portable_daemon_t_LDADD = tests/tap/libtap.a util/libutil.la |
|---|
| 214 | tests_portable_getaddrinfo_t_SOURCES = tests/portable/getaddrinfo-t.c \ |
|---|
| 215 | tests/portable/getaddrinfo.c |
|---|
| 216 | tests_portable_getaddrinfo_t_LDADD = tests/tap/libtap.a util/libutil.la |
|---|
| 217 | tests_portable_getnameinfo_t_SOURCES = tests/portable/getnameinfo-t.c \ |
|---|
| 218 | tests/portable/getnameinfo.c |
|---|
| 219 | tests_portable_getnameinfo_t_LDADD = tests/tap/libtap.a util/libutil.la |
|---|
| 220 | tests_portable_getopt_t_SOURCES = tests/portable/getopt-t.c \ |
|---|
| 221 | tests/portable/getopt.c |
|---|
| 222 | tests_portable_getopt_t_LDADD = tests/tap/libtap.a util/libutil.la |
|---|
| 223 | tests_portable_inet_aton_t_SOURCES = tests/portable/inet_aton-t.c \ |
|---|
| 224 | tests/portable/inet_aton.c |
|---|
| 225 | tests_portable_inet_aton_t_LDADD = tests/tap/libtap.a util/libutil.la |
|---|
| 226 | tests_portable_inet_ntoa_t_SOURCES = tests/portable/inet_ntoa-t.c \ |
|---|
| 227 | tests/portable/inet_ntoa.c |
|---|
| 228 | tests_portable_inet_ntoa_t_LDADD = tests/tap/libtap.a util/libutil.la |
|---|
| 229 | tests_portable_inet_ntop_t_SOURCES = tests/portable/inet_ntop-t.c \ |
|---|
| 230 | tests/portable/inet_ntop.c |
|---|
| 231 | tests_portable_inet_ntop_t_LDADD = tests/tap/libtap.a util/libutil.la |
|---|
| 232 | tests_portable_setenv_t_SOURCES = tests/portable/setenv-t.c \ |
|---|
| 233 | tests/portable/setenv.c |
|---|
| 234 | tests_portable_setenv_t_LDADD = tests/tap/libtap.a util/libutil.la |
|---|
| 235 | tests_portable_snprintf_t_SOURCES = tests/portable/snprintf-t.c \ |
|---|
| 236 | tests/portable/snprintf.c |
|---|
| 237 | tests_portable_snprintf_t_LDADD = tests/tap/libtap.a util/libutil.la |
|---|
| 238 | tests_portable_strlcat_t_SOURCES = tests/portable/strlcat-t.c \ |
|---|
| 239 | tests/portable/strlcat.c |
|---|
| 240 | tests_portable_strlcat_t_LDADD = tests/tap/libtap.a util/libutil.la |
|---|
| 241 | tests_portable_strlcpy_t_SOURCES = tests/portable/strlcpy-t.c \ |
|---|
| 242 | tests/portable/strlcpy.c |
|---|
| 243 | tests_portable_strlcpy_t_LDADD = tests/tap/libtap.a util/libutil.la |
|---|
| 244 | tests_server_accept_t_SOURCES = tests/server/accept-t.c $(SERVER_FILES) |
|---|
| 245 | tests_server_accept_t_LDFLAGS = $(GSSAPI_LDFLAGS) $(GPUT_LDFLAGS) |
|---|
| 246 | tests_server_accept_t_LDADD = tests/tap/libtap.a util/libutil.la \ |
|---|
| 247 | $(GSSAPI_LIBS) $(GPUT_LIBS) |
|---|
| 248 | tests_server_acl_t_SOURCES = tests/server/acl-t.c $(SERVER_FILES) |
|---|
| 249 | tests_server_acl_t_LDFLAGS = $(GPUT_LDFLAGS) |
|---|
| 250 | tests_server_acl_t_LDADD = tests/tap/libtap.a util/libutil.la $(GPUT_LIBS) |
|---|
| 251 | tests_server_config_t_SOURCES = tests/server/config-t.c $(SERVER_FILES) |
|---|
| 252 | tests_server_config_t_LDFLAGS = $(GPUT_LDFLAGS) |
|---|
| 253 | tests_server_config_t_LDADD = tests/tap/libtap.a util/libutil.la $(GPUT_LIBS) |
|---|
| 254 | tests_server_continue_t_LDADD = client/libremctl.la tests/tap/libtap.a \ |
|---|
| 255 | util/libutil.la |
|---|
| 256 | tests_server_env_t_LDADD = client/libremctl.la tests/tap/libtap.a \ |
|---|
| 257 | util/libutil.la |
|---|
| 258 | tests_server_errors_t_LDADD = client/libremctl.la tests/tap/libtap.a \ |
|---|
| 259 | util/libutil.la |
|---|
| 260 | tests_server_invalid_t_LDADD = client/libremctl.la tests/tap/libtap.a \ |
|---|
| 261 | util/libutil.la |
|---|
| 262 | tests_server_logging_t_SOURCES = tests/server/logging-t.c $(SERVER_FILES) |
|---|
| 263 | tests_server_logging_t_LDFLAGS = $(GPUT_LDFLAGS) |
|---|
| 264 | tests_server_logging_t_LDADD = tests/tap/libtap.a util/libutil.la \ |
|---|
| 265 | $(GSSAPI_LIBS) $(GPUT_LIBS) |
|---|
| 266 | tests_server_stdin_t_LDADD = client/libremctl.la tests/tap/libtap.a \ |
|---|
| 267 | util/libutil.la |
|---|
| 268 | tests_server_streaming_t_LDADD = client/libremctl.la tests/tap/libtap.a \ |
|---|
| 269 | util/libutil.la |
|---|
| 270 | tests_server_version_t_LDFLAGS = $(GSSAPI_LDFLAGS) |
|---|
| 271 | tests_server_version_t_LDADD = client/libremctl.la tests/tap/libtap.a \ |
|---|
| 272 | util/libutil.la $(GSSAPI_LIBS) |
|---|
| 273 | tests_util_concat_t_LDADD = tests/tap/libtap.a util/libutil.la |
|---|
| 274 | tests_util_fdflag_t_LDADD = tests/tap/libtap.a util/libutil.la |
|---|
| 275 | tests_util_gss_tokens_t_SOURCES = tests/util/faketoken.c \ |
|---|
| 276 | tests/util/gss-tokens.c tests/util/gss-tokens-t.c |
|---|
| 277 | tests_util_gss_tokens_t_LDFLAGS = $(GSSAPI_LDFLAGS) |
|---|
| 278 | tests_util_gss_tokens_t_LDADD = tests/tap/libtap.a util/libutil.la \ |
|---|
| 279 | $(GSSAPI_LIBS) |
|---|
| 280 | tests_util_messages_t_LDADD = tests/tap/libtap.a util/libutil.la |
|---|
| 281 | tests_util_network_t_LDADD = tests/tap/libtap.a util/libutil.la |
|---|
| 282 | tests_util_tokens_t_LDFLAGS = $(GSSAPI_LDFLAGS) |
|---|
| 283 | tests_util_tokens_t_LDADD = tests/tap/libtap.a util/libutil.la $(GSSAPI_LIBS) |
|---|
| 284 | tests_util_vector_t_LDADD = tests/tap/libtap.a util/libutil.la |
|---|
| 285 | tests_util_xmalloc_LDADD = util/libutil.la |
|---|
| 286 | tests_util_xwrite_t_SOURCES = tests/util/fakewrite.c tests/util/xwrite.c \ |
|---|
| 287 | tests/util/xwrite-t.c |
|---|
| 288 | tests_util_xwrite_t_LDADD = tests/tap/libtap.a util/libutil.la |
|---|
| 289 | |
|---|
| 290 | check-local: $(check_PROGRAMS) |
|---|
| 291 | cd tests && ./runtests $(abs_top_srcdir)/tests/TESTS |
|---|
| 292 | @set -e; if [ -f perl/Makefile ] ; then \ |
|---|
| 293 | echo '' ; \ |
|---|
| 294 | cd perl && LD_LIBRARY_PATH=$(abs_top_builddir)/client/.libs \ |
|---|
| 295 | $(MAKE) test ; \ |
|---|
| 296 | fi |
|---|
| 297 | @set -e; if [ -f php/Makefile ] ; then \ |
|---|
| 298 | echo '' ; \ |
|---|
| 299 | cd php && ./test-wrapper "$(abs_top_builddir)" \ |
|---|
| 300 | "$(abs_top_srcdir)"; \ |
|---|
| 301 | fi |
|---|
| 302 | @set -e; if [ -f python/setup.py ] ; then \ |
|---|
| 303 | echo '' ; \ |
|---|
| 304 | echo 'Testing Python extension' ; \ |
|---|
| 305 | cd python && LD_LIBRARY_PATH=$(abs_top_builddir)/client/.libs \ |
|---|
| 306 | PYTHONPATH="`ls -d build/lib.*`" python test_remctl.py ; \ |
|---|
| 307 | fi |
|---|
| 308 | |
|---|
| 309 | # Used for hooking in the build of optional language bindings. |
|---|
| 310 | BINDINGS = |
|---|
| 311 | BINDINGS_INSTALL = |
|---|
| 312 | |
|---|
| 313 | # The following section sets up the Perl module build properly. Most of the |
|---|
| 314 | # complexity is here to handle building outside of the source directory, in |
|---|
| 315 | # which case we need to copy various files from the source directory and make |
|---|
| 316 | # sure they're up to date since Perl can't handle VPATH builds. |
|---|
| 317 | |
|---|
| 318 | perl/Remctl.o: perl/Remctl.pm $(srcdir)/perl/Remctl.xs $(srcdir)/perl/typemap |
|---|
| 319 | set -e; if [ x"$(builddir)" != x"$(srcdir)" ] ; then \ |
|---|
| 320 | for f in $(PERL_FILES) ; do \ |
|---|
| 321 | cp "$(srcdir)/$$f" "$(builddir)/$$f" ; \ |
|---|
| 322 | done \ |
|---|
| 323 | fi |
|---|
| 324 | cd perl && perl Makefile.PL |
|---|
| 325 | cd perl && $(MAKE) OPTIMIZE="$(CFLAGS) $(PERL_WARNINGS)" |
|---|
| 326 | |
|---|
| 327 | install-data-local-perl: perl/Remctl.o |
|---|
| 328 | cd perl && $(MAKE) install DESTDIR=$(DESTDIR) |
|---|
| 329 | |
|---|
| 330 | # Build and install the Perl bindings if desired. |
|---|
| 331 | if BUILD_PERL |
|---|
| 332 | BINDINGS += perl/Remctl.o |
|---|
| 333 | BINDINGS_INSTALL += install-data-local-perl |
|---|
| 334 | endif |
|---|
| 335 | |
|---|
| 336 | # The following section sets up the PECL extension for PHP. |
|---|
| 337 | |
|---|
| 338 | php/modules/remctl.so: php/config.m4 php/php_remctl.h \ |
|---|
| 339 | $(srcdir)/php/php_remctl.c |
|---|
| 340 | set -e; if [ x"$(builddir)" != x"$(srcdir)" ] ; then \ |
|---|
| 341 | mkdir php/tests 2>/dev/null || true ; \ |
|---|
| 342 | for f in $(PHP_FILES) ; do \ |
|---|
| 343 | cp "$(srcdir)/$$f" "$(builddir)/$$f" ; \ |
|---|
| 344 | done \ |
|---|
| 345 | fi |
|---|
| 346 | cd php && $(PHPIZE) --clean && $(PHPIZE) |
|---|
| 347 | cd php && ./configure CPPFLAGS="$(CPPFLAGS)" \ |
|---|
| 348 | CFLAGS="$(CFLAGS) $(PHP_WARNINGS)" LDFLAGS="$(LDFLAGS)" |
|---|
| 349 | cd php && $(MAKE) CFLAGS="$(CFLAGS) $(PHP_WARNINGS)" |
|---|
| 350 | |
|---|
| 351 | # PHP's build system uses INSTALL_ROOT where everyone else uses DESTDIR. |
|---|
| 352 | install-data-local-php: php/modules/remctl.so |
|---|
| 353 | cd php && $(MAKE) install INSTALL_ROOT=$(DESTDIR) |
|---|
| 354 | |
|---|
| 355 | # Build and install the PHP bindings if desired. |
|---|
| 356 | if BUILD_PHP |
|---|
| 357 | BINDINGS += php/modules/remctl.so |
|---|
| 358 | BINDINGS_INSTALL += install-data-local-php |
|---|
| 359 | endif |
|---|
| 360 | |
|---|
| 361 | # The following section sets up the Python extension build properly. Most of |
|---|
| 362 | # the complexity is here to handle building outside of the source directory, |
|---|
| 363 | # in which case we need to copy various files from the source directory and |
|---|
| 364 | # make sure they're up to date. |
|---|
| 365 | |
|---|
| 366 | stamp-python: $(srcdir)/python/_remctlmodule.c python/remctl.py |
|---|
| 367 | set -e; if [ x"$(builddir)" != x"$(srcdir)" ] ; then \ |
|---|
| 368 | for f in $(PYTHON_FILES) ; do \ |
|---|
| 369 | cp "$(srcdir)/$$f" "$(builddir)/$$f" ; \ |
|---|
| 370 | done \ |
|---|
| 371 | fi |
|---|
| 372 | cd python && CFLAGS="$(CFLAGS) $(PYTHON_WARNINGS)" \ |
|---|
| 373 | python setup.py build |
|---|
| 374 | touch stamp-python |
|---|
| 375 | |
|---|
| 376 | install-data-local-python: stamp-python |
|---|
| 377 | if [ -n "$(DESTDIR)" ] ; then \ |
|---|
| 378 | cd python && python setup.py install --root $(DESTDIR) ; \ |
|---|
| 379 | else \ |
|---|
| 380 | cd python && python setup.py install ; \ |
|---|
| 381 | fi |
|---|
| 382 | |
|---|
| 383 | # Build and install the Python bindings if desired. |
|---|
| 384 | if BUILD_PYTHON |
|---|
| 385 | BINDINGS += stamp-python |
|---|
| 386 | BINDINGS_INSTALL += install-data-local-python |
|---|
| 387 | endif |
|---|
| 388 | |
|---|
| 389 | |
|---|
| 390 | all-local: $(BINDINGS) |
|---|
| 391 | install-data-local: $(BINDINGS_INSTALL) |
|---|