GNUmakefile.in 3.87 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-2011 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 mkblob rmblob
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
                  anonsendmail epmodeset fixexpinfo node_traffic \
28
		  dumpdescriptor subboss_tftpboot_sync testbed-control \
29
		  archive-expinfo grantfeature emulabfeature addblob readblob \
30
		  prereserve grantimage
31

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

39
CTRLSBIN_SCRIPTS= opsdb_control.proxy daemon_wrapper
40

41
42
# These scripts installed setuid, with sudo. 
SETUID_BIN_SCRIPTS   = 
43
SETUID_SBIN_SCRIPTS  = grabwebcams checkquota spewconlog opsdb_control suchown \
44
                       anonsendmail readblob
45
46
SETUID_LIBX_SCRIPTS  = xlogin

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

Ryan Jackson's avatar
Ryan Jackson committed
54
55
subboss: daemon_wrapper

Mac Newbold's avatar
Mac Newbold committed
56
57
58
include $(TESTBED_SRCDIR)/GNUmakerules

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

Leigh B. Stoller's avatar
Leigh B. Stoller committed
73
74
boss-install: install

Ryan Jackson's avatar
Ryan Jackson committed
75
76
subboss-install: $(INSTALL_SBINDIR)/daemon_wrapper

77
78
79
post-install: 
	chown root $(INSTALL_SBINDIR)/grabwebcams
	chmod u+s $(INSTALL_SBINDIR)/grabwebcams
80
81
	chown root $(INSTALL_SBINDIR)/checkquota
	chmod u+s $(INSTALL_SBINDIR)/checkquota
82
83
	chown root $(INSTALL_SBINDIR)/spewconlog
	chmod u+s $(INSTALL_SBINDIR)/spewconlog
84
85
	chown root $(INSTALL_SBINDIR)/opsdb_control
	chmod u+s $(INSTALL_SBINDIR)/opsdb_control
86
87
	chown root $(INSTALL_LIBEXECDIR)/xlogin
	chmod u+s $(INSTALL_LIBEXECDIR)/xlogin
88

Mac Newbold's avatar
Mac Newbold committed
89
90
91
#
# Control node installation (okay, plastic)
#
92
93
control-install:

94
95
96
97
98
99
100
101
102
103
104
105
# 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,,$@),' > $@

106
107
108
109
#
# Automate this part at some point.
# 
subdir-install:
Mike Hibler's avatar
Mike Hibler committed
110
	@$(MAKE) -C nsgen install
111

Mike Hibler's avatar
Mike Hibler committed
112
113
114
115
clean:	subdir-clean

subdir-clean:
	@$(MAKE) -C nsgen clean
116
117
118
119
120
121

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