GNUmakefile.in 3.94 KB
Newer Older
1
#
2
# Copyright (c) 2000-2018 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 B Stoller's avatar
Leigh B 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
LIB_SCRIPTS     = APT_Profile.pm APT_Instance.pm APT_Dataset.pm APT_Geni.pm \
Leigh B Stoller's avatar
Leigh B Stoller committed
41
		  APT_Aggregate.pm APT_Utility.pm APT_Rspec.pm
42
WEB_BIN_SCRIPTS = webmanage_profile webmanage_instance webmanage_dataset \
43
                  webcreate_instance webrungenilib webns2rspec webns2genilib \
44
		  webrspec2genilib webmanage_reservations webmanage_gitrepo \
45
                  webmanage_images webrtecheck websearchip
46
APACHEHOOKS     = apt_gitrepo.hook
47
WEB_SBIN_SCRIPTS= webportal_xmlrpc
48
LIBEXEC_SCRIPTS	= $(WEB_BIN_SCRIPTS) $(WEB_SBIN_SCRIPTS)
49
USERLIBEXEC     = rungenilib.proxy genilib-jail genilib-iocage gitrepo.proxy
50 51

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

#
# 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) \
61
	$(LIB_SCRIPTS) $(USERLIBEXEC) $(APACHEHOOKS) all-subdirs
62 63 64 65 66 67 68 69 70

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)) \
71
	$(addprefix $(INSTALL_LIBEXECDIR)/, $(APACHEHOOKS)) \
72
	$(addprefix $(INSTALL_DIR)/opsdir/libexec/, $(USERLIBEXEC)) \
73
	$(addprefix $(INSTALL_DIR)/apt/, $(APACHEHOOKS)) \
74 75
	$(INSTALL_ETCDIR)/cloudlab-fedonly.json \
	$(INSTALL_ETCDIR)/cloudlab-nofed.json
76 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

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 B Stoller's avatar
Leigh B Stoller committed
108 109 110 111 112
$(INSTALL_DIR)/opsdir/libexec/%: %
	@echo "Installing $<"
	-mkdir -p $(INSTALL_DIR)/opsdir/libexec
	$(INSTALL) $< $@

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

119
.PHONY:	$(SUBDIRS) install