GNUmakefile.in 4.03 KB
Newer Older
1
#
2
# Copyright (c) 2000-2019 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 22 23 24 25 26 27 28 29 30 31 32
# 
# {{{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/>.
# 
# }}}
#

SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= apt

include $(OBJDIR)/Makeconf

SUBDIRS		= 

Leigh Stoller's avatar
Leigh Stoller committed
33
BIN_SCRIPTS	= manage_profile manage_instance manage_dataset \
34
                  create_instance rungenilib ns2rspec nsgenilib.py \
35
                  rspec2genilib ns2genilib manage_reservations manage_gitrepo \
36
                  manage_images rtecheck checkprofile manage_extensions \
37
		  create_slivers searchip
38
SBIN_SCRIPTS	= apt_daemon aptevent_daemon portal_xmlrpc apt_checkup \
39
		  portal_monitor apt_scheduler portal_resources \
40
		  manage_licenses manage_aggregate powder_shutdown
41
LIB_SCRIPTS     = APT_Profile.pm APT_Instance.pm APT_Dataset.pm APT_Geni.pm \
Leigh Stoller's avatar
Leigh Stoller committed
42
		  APT_Aggregate.pm APT_Utility.pm APT_Rspec.pm
43
WEB_BIN_SCRIPTS = webmanage_profile webmanage_instance webmanage_dataset \
44
                  webcreate_instance webrungenilib webns2rspec webns2genilib \
45
		  webrspec2genilib webmanage_reservations webmanage_gitrepo \
46
                  webmanage_images webrtecheck websearchip
47
APACHEHOOKS     = apt_gitrepo.hook
48
WEB_SBIN_SCRIPTS= webportal_xmlrpc webmanage_licenses webpowder_shutdown
49
LIBEXEC_SCRIPTS	= $(WEB_BIN_SCRIPTS) $(WEB_SBIN_SCRIPTS)
50
USERLIBEXEC     = rungenilib.proxy genilib-jail genilib-iocage gitrepo.proxy
51 52

# These scripts installed setuid, with sudo. 
53
SETUID_BIN_SCRIPTS   = rungenilib manage_gitrepo
54
SETUID_SBIN_SCRIPTS  = 
55
SETUID_SUEXEC_SCRIPTS= apt_gitrepo.hook
56 57 58 59 60 61

#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
# 
all:	$(BIN_SCRIPTS) $(SBIN_SCRIPTS) $(LIBEXEC_SCRIPTS) $(SUBDIRS) \
62
	$(LIB_SCRIPTS) $(USERLIBEXEC) $(APACHEHOOKS) all-subdirs
63 64 65 66 67 68 69 70 71

subboss: 

include $(TESTBED_SRCDIR)/GNUmakerules

install: $(addprefix $(INSTALL_BINDIR)/, $(BIN_SCRIPTS)) \
	$(addprefix $(INSTALL_SBINDIR)/, $(SBIN_SCRIPTS)) \
	$(addprefix $(INSTALL_LIBDIR)/, $(LIB_SCRIPTS)) \
	$(addprefix $(INSTALL_LIBEXECDIR)/, $(LIBEXEC_SCRIPTS)) \
72
	$(addprefix $(INSTALL_LIBEXECDIR)/, $(APACHEHOOKS)) \
73
	$(addprefix $(INSTALL_DIR)/opsdir/libexec/, $(USERLIBEXEC)) \
74
	$(addprefix $(INSTALL_DIR)/apt/, $(APACHEHOOKS)) \
75 76
	$(INSTALL_ETCDIR)/cloudlab-fedonly.json \
	$(INSTALL_ETCDIR)/cloudlab-nofed.json
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108

boss-install: install install-subdirs

subboss-install: 

post-install: 

#
# Control node installation (aka, ops)
#
control-install:

# This rule says what web* script depends on which installed binary directory.
$(WEB_SBIN_SCRIPTS): $(INSTALL_SBINDIR)
$(WEB_BIN_SCRIPTS):  $(INSTALL_BINDIR)

# Just in case the dirs are not yet created,
$(INSTALL_SBINDIR) $(INSTALL_BINDIR):

# And then how to turn the template into the actual script. 
$(WEB_SBIN_SCRIPTS) $(WEB_BIN_SCRIPTS): $(TESTBED_SRCDIR)/WEBtemplate.in
	@echo "Generating $@"
	cat $< | sed -e 's,@PROGTOINVOKE@,$(word 2,$^)/$(subst web,,$@),' > $@

clean:	clean-subdirs

# How to recursively descend into subdirectories to make general
# targets such as `all'.
%.MAKE:
	@$(MAKE) -C $(dir $@) $(basename $(notdir $@))
%-subdirs: $(addsuffix /%.MAKE,$(SUBDIRS)) ;

Leigh Stoller's avatar
Leigh Stoller committed
109 110 111 112 113
$(INSTALL_DIR)/opsdir/libexec/%: %
	@echo "Installing $<"
	-mkdir -p $(INSTALL_DIR)/opsdir/libexec
	$(INSTALL) $< $@

114 115 116 117 118 119
$(INSTALL_DIR)/apt/%: %
	@echo "Installing $@"
	-mkdir -p $(INSTALL_DIR)/apt
	-rm -f $(INSTALL_DIR)/apt/$<
	ln $(INSTALL_LIBEXECDIR)/$< $(INSTALL_DIR)/apt/$<

120
.PHONY:	$(SUBDIRS) install