GNUmakefile.in 3.52 KB
Newer Older
Mac Newbold's avatar
Mac Newbold committed
1
#
Leigh B. Stoller's avatar
Leigh B. Stoller committed
2
# EMULAB-COPYRIGHT
3
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
Leigh B. Stoller's avatar
Leigh B. Stoller committed
4
# All rights reserved.
Mac Newbold's avatar
Mac Newbold committed
5
#
Leigh B. Stoller's avatar
Leigh B. 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
                  wanodecheckin wanodecreate spewimage
27

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

35
CTRLSBIN_SCRIPTS= opsdb_control.proxy daemon_wrapper
36

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

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

include $(TESTBED_SRCDIR)/GNUmakerules

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

Leigh B. Stoller's avatar
Leigh B. Stoller committed
66 67
boss-install: install

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

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

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

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

Mike Hibler's avatar
Mike Hibler committed
103 104 105 106
clean:	subdir-clean

subdir-clean:
	@$(MAKE) -C nsgen clean
107 108 109 110 111 112

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