GNUmakefile.in 5.62 KB
Newer Older
Mac Newbold's avatar
Mac Newbold committed
1
#
2
# Copyright (c) 2000-2016 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 grantlease
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 52 53
		  addspecialdevice addspecialiface addvpubaddr ctrladdr \
		  imagehash clone_image imageinfo imagevalidate image_import \
		  image_import-new imagetodir imagecompress \
54
		  prereserve_check tcppd addexternalnetwork \
55
		  update_sitevars delete_image sitecheckin sitecheckin_client \
56
		  mktestbedtest fixrootcert addservers poolmonitor \
57
		  node_exclude managetaint shutdown-shared imagerelease \
58 59
		  runsonxen pxelinux_makeconf attend atten \
		  addrfdevice addrfpath
60

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

70 71
CTRLSBIN_SCRIPTS= opsdb_control.proxy daemon_wrapper ec2import.proxy \
		 ec2import-image.pl GrubConf.rb export-template-remote.rb
72

73
# These scripts installed setuid, with sudo. 
74
SETUID_BIN_SCRIPTS   = create_image
75
SETUID_SBIN_SCRIPTS  = grabwebcams checkquota spewconlog opsdb_control suchown \
76
                       anonsendmail readblob image_import delete_image \
77
                       pxelinux_makeconf imageinfo image_import-new
78

79
SETUID_SUEXEC_SCRIPTS  = xlogin
80

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

89 90
subboss: daemon_wrapper

Mac Newbold's avatar
Mac Newbold committed
91 92 93
include $(TESTBED_SRCDIR)/GNUmakerules

install: $(addprefix $(INSTALL_BINDIR)/, $(BIN_SCRIPTS)) \
94
	$(addprefix $(INSTALL_SBINDIR)/, $(SBIN_SCRIPTS)) \
95
	$(addprefix $(INSTALL_LIBEXECDIR)/, $(LIBEXEC_SCRIPTS)) \
96
	$(addprefix $(INSTALL_DIR)/opsdir/sbin/, $(CTRLSBIN_SCRIPTS)) \
97
	subdir-install
98 99
	$(INSTALL_PROGRAM) template_record \
		$(INSTALL_DIR)/opsdir/bin/template_record
100 101 102 103
	$(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
104 105
	rm -f $(INSTALL_SBINDIR)/wap
	ln -s withadminprivs $(INSTALL_SBINDIR)/wap
106
	@echo "Don't forget to do a post-install as root"
Mac Newbold's avatar
Mac Newbold committed
107

Leigh Stoller's avatar
Leigh Stoller committed
108 109
boss-install: install

110 111
subboss-install: $(INSTALL_SBINDIR)/daemon_wrapper

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

Mac Newbold's avatar
Mac Newbold committed
124
#
125
# Control node installation (aka, ops)
Mac Newbold's avatar
Mac Newbold committed
126
#
127 128
control-install:

129 130 131 132 133 134 135 136 137 138 139 140
# 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,,$@),' > $@

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

Mike Hibler's avatar
Mike Hibler committed
147 148 149 150
clean:	subdir-clean

subdir-clean:
	@$(MAKE) -C nsgen clean
151 152 153 154 155 156

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