GNUmakefile.in 3.59 KB
Newer Older
Mac Newbold's avatar
Mac Newbold committed
1
#
Leigh Stoller's avatar
Leigh Stoller committed
2
# EMULAB-COPYRIGHT
3
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
Leigh Stoller's avatar
Leigh Stoller committed
4
# All rights reserved.
Mac Newbold's avatar
Mac Newbold committed
5
#
Leigh Stoller's avatar
Leigh Stoller committed
6

Mac Newbold's avatar
Mac Newbold committed
7 8 9 10
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= utils
11
UNIFIED         = @UNIFIED_BOSS_AND_OPS@
Mac Newbold's avatar
Mac Newbold committed
12 13 14

include $(OBJDIR)/Makeconf

15 16
SUBDIRS		= nsgen

17
BIN_SCRIPTS	= delay_config sshtb create_image node_admin link_config \
18
                  setdest loghole webcopy linkmon_ctl snmp-if-deref.sh \
19
		  template_record spewevents \
20
		  wbts_dump
Mac Newbold's avatar
Mac Newbold committed
21
SBIN_SCRIPTS	= vlandiff vlansync withadminprivs export_tables cvsupd.pl \
22
                  eventping grantnodetype import_commitlog daemon_wrapper \
23
		  opsreboot deletenode node_statewait grabwebcams \
24
		  grabswitchconfig backupswitches cvsinit checkquota \
25
		  spewconlog opsdb_control newnode suchown archive_list \
26 27
                  wanodecheckin wanodecreate spewimage \
                  anonsendmail
28

29
WEB_SBIN_SCRIPTS= webnewnode webdeletenode webspewconlog webarchive_list \
30
                  webwanodecheckin webspewimage
31
WEB_BIN_SCRIPTS = webcreate_image websetdest weblinkmon_ctl webspewevents \
32
		  webdelay_config
33 34 35
LIBEXEC_SCRIPTS	= spewleds webcopy spewsource webcvsweb xlogin webviewvc \
                  $(WEB_BIN_SCRIPTS) $(WEB_SBIN_SCRIPTS)

36
CTRLSBIN_SCRIPTS= opsdb_control.proxy daemon_wrapper
37

38 39
# These scripts installed setuid, with sudo. 
SETUID_BIN_SCRIPTS   = 
40 41
SETUID_SBIN_SCRIPTS  = grabwebcams checkquota spewconlog opsdb_control suchown \
                       anonsendmail
42 43
SETUID_LIBX_SCRIPTS  = xlogin

Mac Newbold's avatar
Mac Newbold committed
44 45 46 47
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
# 
48 49
all:	$(BIN_SCRIPTS) $(SBIN_SCRIPTS) $(LIBEXEC_SCRIPTS) $(CTRLSBIN_SCRIPTS) \
	$(SUBDIRS) firstuser setbuildinfo
Mac Newbold's avatar
Mac Newbold committed
50 51 52 53

include $(TESTBED_SRCDIR)/GNUmakerules

install: $(addprefix $(INSTALL_BINDIR)/, $(BIN_SCRIPTS)) \
54
	$(addprefix $(INSTALL_SBINDIR)/, $(SBIN_SCRIPTS)) \
55
	$(addprefix $(INSTALL_LIBEXECDIR)/, $(LIBEXEC_SCRIPTS)) \
56
	$(addprefix $(INSTALL_DIR)/opsdir/sbin/, $(CTRLSBIN_SCRIPTS)) \
57
	subdir-install
58 59
	$(INSTALL_PROGRAM) template_record \
		$(INSTALL_DIR)/opsdir/bin/template_record
60 61 62 63
	$(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
64 65
	rm -f $(INSTALL_SBINDIR)/wap
	ln -s withadminprivs $(INSTALL_SBINDIR)/wap
66
	@echo "Don't forget to do a post-install as root"
Mac Newbold's avatar
Mac Newbold committed
67

Leigh Stoller's avatar
Leigh Stoller committed
68 69
boss-install: install

70 71 72
post-install: 
	chown root $(INSTALL_SBINDIR)/grabwebcams
	chmod u+s $(INSTALL_SBINDIR)/grabwebcams
73 74
	chown root $(INSTALL_SBINDIR)/checkquota
	chmod u+s $(INSTALL_SBINDIR)/checkquota
75 76
	chown root $(INSTALL_SBINDIR)/spewconlog
	chmod u+s $(INSTALL_SBINDIR)/spewconlog
77 78
	chown root $(INSTALL_SBINDIR)/opsdb_control
	chmod u+s $(INSTALL_SBINDIR)/opsdb_control
79 80
	chown root $(INSTALL_LIBEXECDIR)/xlogin
	chmod u+s $(INSTALL_LIBEXECDIR)/xlogin
81

Mac Newbold's avatar
Mac Newbold committed
82 83 84
#
# Control node installation (okay, plastic)
#
85 86
control-install:

87 88 89 90 91 92 93 94 95 96 97 98
# 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,,$@),' > $@

99 100 101 102
#
# Automate this part at some point.
# 
subdir-install:
Mike Hibler's avatar
Mike Hibler committed
103
	@$(MAKE) -C nsgen install
104

Mike Hibler's avatar
Mike Hibler committed
105 106 107 108
clean:	subdir-clean

subdir-clean:
	@$(MAKE) -C nsgen clean
109 110 111 112 113 114

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