GNUmakefile.in 3.87 KB
Newer Older
1
#
2
# Copyright (c) 2000-2017 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 \
Leigh B Stoller's avatar
Leigh B Stoller committed
36
                  manage_images rtecheck checkprofile manage_extensions
37 38
SBIN_SCRIPTS	= apt_daemon aptevent_daemon portal_xmlrpc apt_checkup \
		  portal_monitor
39
LIB_SCRIPTS     = APT_Profile.pm APT_Instance.pm APT_Dataset.pm APT_Geni.pm \
Leigh B Stoller's avatar
Leigh B Stoller committed
40
		  APT_Aggregate.pm APT_Utility.pm APT_Rspec.pm
41
WEB_BIN_SCRIPTS = webmanage_profile webmanage_instance webmanage_dataset \
42
                  webcreate_instance webrungenilib webns2rspec webns2genilib \
43
		  webrspec2genilib webmanage_reservations webmanage_gitrepo \
44
                  webmanage_images webrtecheck
45
APACHEHOOKS     = apt_gitrepo.hook
46
WEB_SBIN_SCRIPTS= webportal_xmlrpc
47
LIBEXEC_SCRIPTS	= $(WEB_BIN_SCRIPTS) $(WEB_SBIN_SCRIPTS)
48
USERLIBEXEC     = rungenilib.proxy genilib-jail genilib-iocage gitrepo.proxy
49 50

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

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

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

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
107 108 109 110 111
$(INSTALL_DIR)/opsdir/libexec/%: %
	@echo "Installing $<"
	-mkdir -p $(INSTALL_DIR)/opsdir/libexec
	$(INSTALL) $< $@

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

118
.PHONY:	$(SUBDIRS) install