GNUmakefile.in 5.43 KB
Newer Older
Mac Newbold's avatar
Mac Newbold committed
1
#
2
# Copyright (c) 2000-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/>.
# 
# }}}
Mac Newbold's avatar
Mac Newbold committed
22
#
Leigh Stoller's avatar
Leigh Stoller committed
23

Mac Newbold's avatar
Mac Newbold committed
24 25 26 27
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= utils
28
UNIFIED         = @UNIFIED_BOSS_AND_OPS@
Mac Newbold's avatar
Mac Newbold committed
29 30 31

include $(OBJDIR)/Makeconf

32 33
SUBDIRS		= nsgen

34
BIN_SCRIPTS	= delay_config sshtb create_image node_admin link_config \
35
                  setdest loghole webcopy linkmon_ctl snmp-if-deref.sh \
36
		  template_record spewevents \
37
		  wbts_dump mkblob rmblob \
38
		  showlease createlease deletelease modlease approvelease \
39
		  extendlease createdataset
Mac Newbold's avatar
Mac Newbold committed
40
SBIN_SCRIPTS	= vlandiff vlansync withadminprivs export_tables cvsupd.pl \
41
                  eventping grantnodetype import_commitlog daemon_wrapper \
42
		  opsreboot deletenode node_statewait grabwebcams \
43
		  grabswitchconfig backupswitches cvsinit checkquota \
44
		  spewconlog opsdb_control newnode suchown archive_list \
45
                  wanodecheckin wanodecreate spewimage \
46
                  anonsendmail epmodeset fixexpinfo node_traffic switch_traffic \
47
		  dumpdescriptor subboss_tftpboot_sync testbed-control \
48
		  archive-expinfo grantfeature emulabfeature addblob readblob \
49
		  prereserve grantimage getimages localize_mfs \
50
		  management_iface sharevlan check-shared-bw \
51
		  addspecialdevice addspecialiface imagehash clone_image \
52
		  addvpubaddr imageinfo imagevalidate ctrladdr image_import \
53
		  prereserve_check tcppd addexternalnetwork \
54
		  update_sitevars delete_image sitecheckin sitecheckin_client \
55
		  mktestbedtest fixrootcert addservers poolmonitor \
56
		  node_exclude managetaint shutdown-shared imagerelease \
57
		  runsonxen pxelinux_makeconf
58

59
WEB_SBIN_SCRIPTS= webnewnode webdeletenode webspewconlog webarchive_list \
60
                  webwanodecheckin webspewimage webdumpdescriptor \
61
		  webdelete_image websitecheckin webclone_image
62
WEB_BIN_SCRIPTS = webcreate_image websetdest weblinkmon_ctl webspewevents \
63
		  webdelay_config webcreatedataset webdeletelease webapprovelease
64 65 66
LIBEXEC_SCRIPTS	= spewleds webcopy spewsource webcvsweb xlogin webviewvc \
                  $(WEB_BIN_SCRIPTS) $(WEB_SBIN_SCRIPTS)

67 68
CTRLSBIN_SCRIPTS= opsdb_control.proxy daemon_wrapper ec2import.proxy \
		 ec2import-image.pl GrubConf.rb export-template-remote.rb
69

70
# These scripts installed setuid, with sudo. 
71
SETUID_BIN_SCRIPTS   = create_image
72
SETUID_SBIN_SCRIPTS  = grabwebcams checkquota spewconlog opsdb_control suchown \
73 74 75
                       anonsendmail readblob image_import delete_image \
                       pxelinux_makeconf

76
SETUID_SUEXEC_SCRIPTS  = xlogin
77

Mac Newbold's avatar
Mac Newbold committed
78 79 80 81
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
# 
82
all:	$(BIN_SCRIPTS) $(SBIN_SCRIPTS) $(LIBEXEC_SCRIPTS) $(CTRLSBIN_SCRIPTS) \
83 84
	$(SETUID_BIN_SCRIPTS) $(SETUID_SBIN_SCRIPTS) $(SUBDIRS) \
	firstuser setbuildinfo
Mac Newbold's avatar
Mac Newbold committed
85

86 87
subboss: daemon_wrapper

Mac Newbold's avatar
Mac Newbold committed
88 89 90
include $(TESTBED_SRCDIR)/GNUmakerules

install: $(addprefix $(INSTALL_BINDIR)/, $(BIN_SCRIPTS)) \
91
	$(addprefix $(INSTALL_SBINDIR)/, $(SBIN_SCRIPTS)) \
92
	$(addprefix $(INSTALL_LIBEXECDIR)/, $(LIBEXEC_SCRIPTS)) \
93
	$(addprefix $(INSTALL_DIR)/opsdir/sbin/, $(CTRLSBIN_SCRIPTS)) \
94
	subdir-install
95 96
	$(INSTALL_PROGRAM) template_record \
		$(INSTALL_DIR)/opsdir/bin/template_record
97 98 99 100
	$(INSTALL_PROGRAM) loghole $(INSTALL_DIR)/opsdir/bin/loghole
	-mkdir -p $(INSTALL_DIR)/opsdir/man/man1
	$(INSTALL) -m 0644 $(SRCDIR)/loghole.1 \
		$(INSTALL_DIR)/opsdir/man/man1/loghole.1
101 102
	rm -f $(INSTALL_SBINDIR)/wap
	ln -s withadminprivs $(INSTALL_SBINDIR)/wap
103
	@echo "Don't forget to do a post-install as root"
Mac Newbold's avatar
Mac Newbold committed
104

Leigh Stoller's avatar
Leigh Stoller committed
105 106
boss-install: install

107 108
subboss-install: $(INSTALL_SBINDIR)/daemon_wrapper

109 110 111
post-install: 
	chown root $(INSTALL_SBINDIR)/grabwebcams
	chmod u+s $(INSTALL_SBINDIR)/grabwebcams
112 113
	chown root $(INSTALL_SBINDIR)/checkquota
	chmod u+s $(INSTALL_SBINDIR)/checkquota
114 115
	chown root $(INSTALL_SBINDIR)/spewconlog
	chmod u+s $(INSTALL_SBINDIR)/spewconlog
116 117
	chown root $(INSTALL_SBINDIR)/opsdb_control
	chmod u+s $(INSTALL_SBINDIR)/opsdb_control
118 119
	chown root $(INSTALL_LIBEXECDIR)/xlogin
	chmod u+s $(INSTALL_LIBEXECDIR)/xlogin
120

Mac Newbold's avatar
Mac Newbold committed
121
#
122
# Control node installation (aka, ops)
Mac Newbold's avatar
Mac Newbold committed
123
#
124 125
control-install:

126 127 128 129 130 131 132 133 134 135 136 137
# 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,,$@),' > $@

138 139 140 141
#
# Automate this part at some point.
# 
subdir-install:
Mike Hibler's avatar
Mike Hibler committed
142
	@$(MAKE) -C nsgen install
143

Mike Hibler's avatar
Mike Hibler committed
144 145 146 147
clean:	subdir-clean

subdir-clean:
	@$(MAKE) -C nsgen clean
148 149 150 151 152 153

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