GNUmakefile.in 3.54 KB
Newer Older
1
#
2
# Copyright (c) 2000-2018 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/>.
# 
# }}}
22
#
23 24 25 26 27 28 29
# For installation.
#
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= rc.d

30
WINSUPPORT      = @WINSUPPORT@
31
PELABSUPPORT    = @PELABSUPPORT@
32
ELVINCOMPAT	= @ELVIN_COMPAT@
33
TBMAINSITE	= @TBMAINSITE@
34 35
PROTOGENI       = @PROTOGENI_SUPPORT@
CLUSTER_PORTAL  = @CLUSTER_PORTAL@
36
BOSSNODE        = @BOSSNODE@
37

38 39
SYSTEM         := $(shell uname -s)

40 41
include $(OBJDIR)/Makeconf

42
RC_SCRIPTS	= 2.mysql-server.sh 3.mfrisbeed.sh 3.testbed.sh \
43
		  2.dhcpd.sh 1.mysql-client.sh 2.tbdbcheck.sh 
44 45
SUBBOSS_SCRIPTS	= 2.dhcpd.sh 3.mfrisbeed-subboss.sh arplock.sh \
		  3.reportboot-subboss.sh
46 47
OPS_SCRIPTS     = 3.and.sh 1.mysql-client.sh 1.mysql-server.sh arplock-opsfs.sh \
		  3.mfrisbeed-ops.sh
48 49
ifneq ($(CLUSTER_PORTAL),)
ifeq ($(CLUSTER_PORTAL),$(BOSSNODE))
50
RC_SCRIPTS     += 2.portalpsd.sh
51
endif
52
endif
53 54 55
ifeq ($(ELVINCOMPAT),1)
OPS_SCRIPTS    += 2.elvind.sh 3.elvin_gateway.sh
endif
56
FS_SCRIPTS	= arplock-opsfs.sh
57
TIP_SCRIPTS	=
Mike Hibler's avatar
Mike Hibler committed
58

59
ifeq ($(SYSTEM),FreeBSD)
60
FBSDVERSION   := $(shell uname -v | sed -e 's/FreeBSD \([0-9][0-9]*\).*/FreeBSD\1/')
61

62
ifneq ($(FBSDVERSION),FreeBSD4)
63 64 65
ifeq ($(WINSUPPORT),1)
OPS_SCRIPTS += silly.sh
endif
66 67
# install without .sh
TIP_SCRIPTS += capture
68 69
else
RC_SCRIPTS  += 1.named.sh
70
TIP_SCRIPTS += capture.sh
71
endif
72
endif
Mike Hibler's avatar
Mike Hibler committed
73
ifeq ($(PELABSUPPORT),1)
74 75
OPS_SCRIPTS += pelab.sh
endif
76

77 78 79 80
#
# Force dependencies to make sure configure regenerates if the .in file
# is changed.
# 
81 82
all: $(RC_SCRIPTS) $(OPS_SCRIPTS) $(FS_SCRIPTS) $(SUBBOSS_SCRIPTS) \
	capture.sh 3.v0_gateway.sh 2.tbdbcheck.sh
83

84
control-build:	$(OPS_SCRIPTS) 
85
fs-build:	$(FS_SCRIPTS) 
86
subboss-build:	$(SUBBOSS_SCRIPTS) 
87

88 89 90 91 92 93 94 95
include $(TESTBED_SRCDIR)/GNUmakerules

# Like the INSTALL_BINDIR target
$(INSTALL_RCDIR)/%: %
	@echo "Installing $<"
	-mkdir -p $(INSTALL_RCDIR)
	$(INSTALL_PROGRAM) $< $@

96 97 98 99 100
# special case for capture.sh -> capture
$(INSTALL_RCDIR)/capture: capture.sh
	@echo "Installing $<"
	-mkdir -p $(INSTALL_RCDIR)
	$(INSTALL_PROGRAM) capture.sh $@
101

102 103 104 105 106 107 108
#
# Well, this is awkward.  Make sure we don't try to install anything from
# a dev tree both because it doesn't make any sense and because it would
# clobber the "real" version.
#
ifeq ($(TBROOT),/usr/testbed)

109
install:		$(addprefix $(INSTALL_RCDIR)/, $(RC_SCRIPTS))
110

111 112
control-install:	control-build \
			$(addprefix $(INSTALL_RCDIR)/, $(OPS_SCRIPTS))
113

114 115 116 117 118
fs-install:		fs-build \
			$(addprefix $(INSTALL_RCDIR)/, $(FS_SCRIPTS))

subboss-install:	subboss-build \
			$(addprefix $(INSTALL_RCDIR)/, $(SUBBOSS_SCRIPTS))
119

120 121 122
clrhouse-install:	$(INSTALL_RCDIR)/2.mysql-server.sh \
			$(INSTALL_RCDIR)/1.mysql-client.sh

123 124
gateway-install:	$(INSTALL_RCDIR)/3.v0_gateway.sh

125
tipserv-install:	$(addprefix $(INSTALL_RCDIR)/, $(TIP_SCRIPTS))
126
else
127
install control-install fs-install subboss-install clrhouse-install gateway-install tipserv-install:
128 129
	@echo "Cannot install startup scripts in dev tree"
endif