GNUmakefile.in 5.12 KB
Newer Older
Mac Newbold's avatar
Mac Newbold committed
1
#
2
# Copyright (c) 2000-2013 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 38
		  wbts_dump mkblob rmblob \
		  showlease createlease deletelease modlease
Mac Newbold's avatar
Mac Newbold committed
39
SBIN_SCRIPTS	= vlandiff vlansync withadminprivs export_tables cvsupd.pl \
40
                  eventping grantnodetype import_commitlog daemon_wrapper \
41
		  opsreboot deletenode node_statewait grabwebcams \
42
		  grabswitchconfig backupswitches cvsinit checkquota \
43
		  spewconlog opsdb_control newnode suchown archive_list \
44
                  wanodecheckin wanodecreate spewimage \
45
                  anonsendmail epmodeset fixexpinfo node_traffic \
46
		  dumpdescriptor subboss_tftpboot_sync testbed-control \
47
		  archive-expinfo grantfeature emulabfeature addblob readblob \
48
		  prereserve grantimage getimages localize_mfs \
49
		  management_iface sharevlan check-shared-bw \
50
		  addspecialdevice addspecialiface imagehash clone_image \
51
		  addvpubaddr imageinfo ctrladdr image_import \
52
		  prereserve_check tcppd addexternalnetwork \
53
		  update_sitevars delete_image sitecheckin sitecheckin_client \
54
		  mktestbedtest fixrootcert addservers poolmonitor
55

56
WEB_SBIN_SCRIPTS= webnewnode webdeletenode webspewconlog webarchive_list \
57
                  webwanodecheckin webspewimage webdumpdescriptor \
58
		  webdelete_image websitecheckin
59
WEB_BIN_SCRIPTS = webcreate_image websetdest weblinkmon_ctl webspewevents \
60
		  webdelay_config
61 62 63
LIBEXEC_SCRIPTS	= spewleds webcopy spewsource webcvsweb xlogin webviewvc \
                  $(WEB_BIN_SCRIPTS) $(WEB_SBIN_SCRIPTS)

64 65
CTRLSBIN_SCRIPTS= opsdb_control.proxy daemon_wrapper ec2import.proxy \
		 ec2import-image.pl GrubConf.rb export-template-remote.rb
66

67
# These scripts installed setuid, with sudo. 
68
SETUID_BIN_SCRIPTS   = create_image
69
SETUID_SBIN_SCRIPTS  = grabwebcams checkquota spewconlog opsdb_control suchown \
70
                       anonsendmail readblob image_import delete_image
71
SETUID_SUEXEC_SCRIPTS  = xlogin
72

Mac Newbold's avatar
Mac Newbold committed
73 74 75 76
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
# 
77 78
all:	$(BIN_SCRIPTS) $(SBIN_SCRIPTS) $(LIBEXEC_SCRIPTS) $(CTRLSBIN_SCRIPTS) \
	$(SUBDIRS) firstuser setbuildinfo
Mac Newbold's avatar
Mac Newbold committed
79

80 81
subboss: daemon_wrapper

Mac Newbold's avatar
Mac Newbold committed
82 83 84
include $(TESTBED_SRCDIR)/GNUmakerules

install: $(addprefix $(INSTALL_BINDIR)/, $(BIN_SCRIPTS)) \
85
	$(addprefix $(INSTALL_SBINDIR)/, $(SBIN_SCRIPTS)) \
86
	$(addprefix $(INSTALL_LIBEXECDIR)/, $(LIBEXEC_SCRIPTS)) \
87
	$(addprefix $(INSTALL_DIR)/opsdir/sbin/, $(CTRLSBIN_SCRIPTS)) \
88
	subdir-install
89 90
	$(INSTALL_PROGRAM) template_record \
		$(INSTALL_DIR)/opsdir/bin/template_record
91 92 93 94
	$(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
95 96
	rm -f $(INSTALL_SBINDIR)/wap
	ln -s withadminprivs $(INSTALL_SBINDIR)/wap
97
	@echo "Don't forget to do a post-install as root"
Mac Newbold's avatar
Mac Newbold committed
98

Leigh Stoller's avatar
Leigh Stoller committed
99 100
boss-install: install

101 102
subboss-install: $(INSTALL_SBINDIR)/daemon_wrapper

103 104 105
post-install: 
	chown root $(INSTALL_SBINDIR)/grabwebcams
	chmod u+s $(INSTALL_SBINDIR)/grabwebcams
106 107
	chown root $(INSTALL_SBINDIR)/checkquota
	chmod u+s $(INSTALL_SBINDIR)/checkquota
108 109
	chown root $(INSTALL_SBINDIR)/spewconlog
	chmod u+s $(INSTALL_SBINDIR)/spewconlog
110 111
	chown root $(INSTALL_SBINDIR)/opsdb_control
	chmod u+s $(INSTALL_SBINDIR)/opsdb_control
112 113
	chown root $(INSTALL_LIBEXECDIR)/xlogin
	chmod u+s $(INSTALL_LIBEXECDIR)/xlogin
114

Mac Newbold's avatar
Mac Newbold committed
115
#
116
# Control node installation (aka, ops)
Mac Newbold's avatar
Mac Newbold committed
117
#
118 119
control-install:

120 121 122 123 124 125 126 127 128 129 130 131
# 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,,$@),' > $@

132 133 134 135
#
# Automate this part at some point.
# 
subdir-install:
Mike Hibler's avatar
Mike Hibler committed
136
	@$(MAKE) -C nsgen install
137

Mike Hibler's avatar
Mike Hibler committed
138 139 140 141
clean:	subdir-clean

subdir-clean:
	@$(MAKE) -C nsgen clean
142 143 144 145 146 147

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