GNUmakefile.in 5.15 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
		  wbts_dump mkblob rmblob \
38 39
		  showlease createlease deletelease modlease approvelease \
		  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 \
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 ctrladdr image_import \
53
		  prereserve_check tcppd addexternalnetwork \
54
		  update_sitevars delete_image sitecheckin sitecheckin_client \
55
		  mktestbedtest fixrootcert addservers poolmonitor
56

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

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

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

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

81 82
subboss: daemon_wrapper

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

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

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

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

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

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

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

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

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

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

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