GNUmakefile.in 4.81 KB
Newer Older
1
# Copyright (c) 2000-2018 University of Utah and the Flux Group.
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# 
# {{{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/>.
# 
# }}}
21
#
22 23 24 25
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= db
26
UNIFIED         = @UNIFIED_BOSS_AND_OPS@
27

28
include $(OBJDIR)/Makeconf
29

30
SUBBOSS_SBIN_SCRIPTS	= subboss_dhcpd_makeconf
31

32
BIN_SCRIPTS	= nalloc nfree nodeip readycount
33
SBIN_SCRIPTS	= avail inuse showgraph if2port backup webcontrol node_status \
34
                  genelists genelists.proxy dhcpd_makeconf nodelog unixgroups \
35
		  dbcheck interswitch dbboot grabron stategraph \
36
		  idletimes idlemail setsitevar audit changeuid changepid \
37
		  elabinelab_bossinit update_permissions mysqld_watchdog \
38
		  dumperrorlog changeleader checkstats changecreator \
39
		  dbupdate geni_control subboss_sync showvlans updatewires \
40
		  changeiface elabinelab_adminusers
41

42
WEB_SBIN_SCRIPTS= webnodelog webidlemail webchangeuid \
43
		  webchangeleader
44 45
WEB_BIN_SCRIPTS = webnfree
LIBEXEC_SCRIPTS = $(WEB_BIN_SCRIPTS) $(WEB_SBIN_SCRIPTS) xmlconvert
46
LIB_SCRIPTS     = libdb.pm Node.pm libdb.py libadminctrl.pm Experiment.pm \
47
		  NodeType.pm Interface.pm User.pm Group.pm Project.pm \
48
		  Image.pm OSinfo.pm Archive.pm Logfile.pm Lan.pm emdbi.pm \
49
		  emdb.pm emutil.pm Firewall.pm VirtExperiment.pm libGeni.pm \
50
		  libEmulab.pm EmulabConstants.pm TraceUse.pm \
Kirk Webb's avatar
Kirk Webb committed
51
		  EmulabFeatures.pm Port.pm BlockstoreType.pm Blockstore.pm \
52
		  IPBuddyAlloc.pm IPBuddyWrapper.pm Lease.pm Quota.pm \
53
		  libTaintStates.pm WebSession.pm WebTask.pm Brand.pm \
54
		  Reservation.pm OSImage.pm ResUtil.pm
55

56
# Stuff installed on plastic.
57
USERSBINS	= genelists.proxy dumperrorlog.proxy backup
David Johnson's avatar
David Johnson committed
58
USERLIBS	= libtbdb.pm libdb.py
59

60 61
# These scripts installed setuid, with sudo. 
SETUID_BIN_SCRIPTS   = 
62 63
SETUID_SBIN_SCRIPTS  = genelists dhcpd_makeconf elabinelab_bossinit \
                       changecreator
64 65 66 67 68 69 70
SETUID_LIBX_SCRIPTS  =

#
# Targets
#
ifeq ($(STANDALONE_CLEARINGHOUSE),0)
TARGETS	= $(BIN_SCRIPTS) $(SBIN_SCRIPTS) $(LIBEXEC_SCRIPTS) $(LIB_SCRIPTS) \
Leigh Stoller's avatar
Leigh Stoller committed
71
	$(USERSBINS) $(USERLIBS) schemacheck dbfillcheck
72 73 74 75
else
TARGETS = emdb.pm emutil.pm emdbi.pm
SETUID_SBIN_SCRIPTS =
endif
76

77
#
78 79 80
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
# 
81
all:	$(TARGETS)
82

83 84
subboss: $(SUBBOSS_SBIN_SCRIPTS)

85
$(SUBBOSS_SBIN_SCRIPTS):
86

87
include $(TESTBED_SRCDIR)/GNUmakerules
88

89 90 91 92 93 94
ifeq ($(STANDALONE_CLEARINGHOUSE),0)
install: boss-install
else
install: clrhouse-install
endif

95 96
subboss-install: $(addprefix $(INSTALL_SBINDIR)/, $(SUBBOSS_SBIN_SCRIPTS))
	ln -sf $(INSTALL_SBINDIR)/subboss_dhcpd_makeconf \
97
		$(DESTDIR)$(CLIENT_BINDIR)/subboss_dhcpd_makeconf
98

99
boss-install: $(addprefix $(INSTALL_BINDIR)/, $(BIN_SCRIPTS)) \
100
	$(addprefix $(INSTALL_SBINDIR)/, $(SBIN_SCRIPTS)) \
101
	$(addprefix $(INSTALL_LIBDIR)/, $(LIB_SCRIPTS)) \
102 103 104
	$(addprefix $(INSTALL_LIBEXECDIR)/, $(LIBEXEC_SCRIPTS)) \
        $(addprefix $(INSTALL_DIR)/opsdir/sbin/, $(USERSBINS)) \
        $(addprefix $(INSTALL_DIR)/opsdir/lib/, $(USERLIBS))
105

106 107 108
post-install: 
	chown root $(INSTALL_SBINDIR)/genelists
	chmod u+s $(INSTALL_SBINDIR)/genelists
109 110
	chown root $(INSTALL_SBINDIR)/dhcpd_makeconf
	chmod u+s $(INSTALL_SBINDIR)/dhcpd_makeconf
111 112
	chown root $(INSTALL_SBINDIR)/elabinelab_bossinit
	chmod u+s $(INSTALL_SBINDIR)/elabinelab_bossinit
113

114 115 116
#
# Control node installation (okay, plastic)
#
117 118
control-install: $(addprefix $(INSTALL_SBINDIR)/, $(USERSBINS)) \
	$(addprefix $(INSTALL_LIBDIR)/, $(USERLIBS))
119

120 121 122
# Clearinghouse install.
clrhouse-install: $(addprefix $(INSTALL_LIBDIR)/, $(TARGETS))

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 $@"
133
	cat $< | sed -e 's,@PROGTOINVOKE@,$(word 2,$^)/$(subst web,,$@),' > $@
134

135
clean:
136 137 138 139 140 141 142 143 144 145 146

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

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