GNUmakefile.in 4.22 KB
Newer Older
1
#
2
# Copyright (c) 2004-2014 University of Utah and the Flux Group.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
22 23 24 25 26 27 28 29 30 31
#

SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= xmlrpc
UNIFIED         = @UNIFIED_BOSS_AND_OPS@

include $(OBJDIR)/Makeconf

32 33 34
BIN_SCRIPTS	= sslxmlrpc_client.py
SBIN_SCRIPTS	= xmlrpcbag sslxmlrpc_server.py 
LIB_STUFF	= emulabserver.py emulabclient.py libxmlrpc.pm
35
LIBEXEC_STUFF	= webxmlrpc
36
WWW_STUFF	= xmlrpcapi.php3
37
DOWNLOAD_STUFF  = emulabclient.py README \
38
                  script_wrapper.py sslxmlrpc_client.py
39
DEBUG_STUFF     = experiment node imageid osid fs user emulab server
40

41 42
EXPANDCOPYRIGHT	= /usr/site/lib/copyright/expand-copyr

43 44 45
#
# These are the ones installed on plastic (users, control, etc). 
# 
46 47
CLIENTBINS      = script_wrapper.py sslxmlrpc_client.py
USERLIBS	= emulabclient.py libxmlrpc.pm \
48
		  BasicXMLRPCServers.py
49
SYMLINKS        = node_admin node_reboot os_load create_image node_list \
50
		  delay_config wilink_config savelogs portstats eventsys_control \
51
		  readycount nscheck startexp batchexp startexp swapexp endexp \
52
		  modexp expinfo node_avail tbuisp expwait template_commit \
53
		  template_export template_swapin template_swapout \
54
		  template_stoprun template_instantiate template_startrun \
55
		  template_checkout node_avail_list mkblob rmblob \
56
		  createdataset deletedataset showdataset extenddataset
57

58 59 60 61 62 63 64 65 66 67 68 69 70
ifneq ($(UNIFIED),1)
LINKS		= cd $(INSTALL_BINDIR) && \
		  list='$(SYMLINKS)'; for file in $$list; do \
			rm -f $$file; \
			ln -s script_wrapper.py $$file; \
		  done;
OPSLINKS	= cd $(INSTALL_DIR)/opsdir/bin && \
		  list='$(SYMLINKS)'; for file in $$list; do \
			rm -f $$file; \
			ln -s script_wrapper.py $$file; \
		  done;
endif

71 72 73 74
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
# 
75
all:	$(BIN_SCRIPTS) $(SBIN_SCRIPTS) $(LIB_STUFF) $(LIBEXEC_STUFF) \
Leigh Stoller's avatar
Leigh Stoller committed
76
	$(DOWNLOAD_STUFF) $(DEBUG_STUFF) $(CLIENTBINS) BasicXMLRPCServers.py
77 78 79 80 81

include $(TESTBED_SRCDIR)/GNUmakerules

install: $(addprefix $(INSTALL_BINDIR)/, $(BIN_SCRIPTS)) \
	$(addprefix $(INSTALL_SBINDIR)/, $(SBIN_SCRIPTS)) \
82
	$(addprefix $(INSTALL_SBINDIR)/xmlrpc/, $(DEBUG_STUFF)) \
83
	$(addprefix $(INSTALL_LIBEXECDIR)/, $(LIBEXEC_STUFF)) \
84
	$(addprefix $(INSTALL_WWWDIR)/, $(WWW_STUFF)) \
85
	$(addprefix $(INSTALL_WWWDIR)/downloads/xmlrpc/, $(DOWNLOAD_STUFF)) \
86 87 88
	$(addprefix $(INSTALL_LIBDIR)/, $(LIB_STUFF)) \
	$(addprefix $(INSTALL_DIR)/opsdir/lib/, $(USERLIBS)) \
	$(addprefix $(INSTALL_DIR)/opsdir/bin/, $(CLIENTBINS))
89 90
	-rm -f $(INSTALL_SBINDIR)/paperbag
	ln -s xmlrpcbag $(INSTALL_SBINDIR)/paperbag
91
	$(OPSLINKS)
92

93 94 95 96 97
$(INSTALL_WWWDIR)/%: %
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@) 

98 99 100 101 102 103 104 105 106 107
$(INSTALL_WWWDIR)/downloads/xmlrpc/%: %
	@echo "Installing $<"
	-mkdir -p $(patsubst %/,%,$(dir $@))
	$(INSTALL_DATA) $(subst $$,\$$,$<) $(subst $$,\$$,$@)

$(INSTALL_SBINDIR)/xmlrpc/%: %
	@echo "Installing $<"
	-mkdir -p $(INSTALL_SBINDIR)/xmlrpc
	$(INSTALL_PROGRAM) $< $@

108 109 110 111 112 113 114 115 116 117
$(INSTALL_DIR)/opsdir/bin/%: %
	@echo "Installing $<"
	-mkdir -p $(INSTALL_DIR)/opsdir/bin
	$(INSTALL) $< $@

$(INSTALL_DIR)/opsdir/lib/%: %
	@echo "Installing $<"
	-mkdir -p $(INSTALL_DIR)/opsdir/lib
	$(INSTALL) $< $@

118 119 120
#
# Control node installation (okay, plastic)
#
Leigh Stoller's avatar
Leigh Stoller committed
121 122
control-install:	$(CLIENTBINS) $(USERLIBS) \
			$(addprefix $(INSTALL_LIBDIR)/, $(USERLIBS)) \
123
			$(addprefix $(INSTALL_BINDIR)/, $(CLIENTBINS))
124
	$(LINKS)
125

126 127 128 129 130 131
client:

client-install: client $(CLIENTBINS) $(USERLIBS) \
			$(addprefix $(INSTALL_LIBDIR)/, $(USERLIBS)) \
			$(addprefix $(INSTALL_BINDIR)/, $(CLIENTBINS))

132
clean: