GNUmakefile.in 2.42 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
#
# Copyright (c) 2014 University of Utah and the Flux Group.
# 
# {{{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/>.
# 
# }}}
#
#
# For installation only.
#
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= ntpd

NTPSERVER	= @NTPSERVER@

include $(OBJDIR)/Makeconf

CONFIG_FILES	= ntp.conf-client ntp.conf-server ntp.conf-external
ifeq ($(NTPSERVER),boss)
BOSS_FILE=ntp.conf-server
OPS_FILE=ntp.conf-client
FS_FILE=ntp.conf-client
else
ifeq ($(NTPSERVER),ops)
BOSS_FILE=ntp.conf-client
OPS_FILE=ntp.conf-server
FS_FILE=ntp.conf-client
else
ifeq ($(NTPSERVER),fs)
$(error we do not support NTP server on FS node right now)
else
BOSS_FILE=ntp.conf-external
OPS_FILE=ntp.conf-external
FS_FILE=ntp.conf-external
endif
endif
endif
55
NODE_FILE=ntp.conf-node
56 57 58 59 60

#
# Force dependencies to make sure configure regenerates if the .in file
# is changed.
# 
61
all: $(CONFIG_FILES) $(NODE_FILE)
62 63 64 65 66 67 68 69 70

include $(TESTBED_SRCDIR)/GNUmakerules

#
# 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)
71
install: $(BOSS_FILE) clientconfig
72 73 74 75 76 77 78 79
	mv -f $(DESTDIR)/etc/ntp.conf $(DESTDIR)/etc/ntp.conf.bak
	$(INSTALL_DATA) $(BOSS_FILE) $(DESTDIR)/etc/ntp.conf
control-install: $(OPS_FILE)
	mv -f $(DESTDIR)/etc/ntp.conf $(DESTDIR)/etc/ntp.conf.bak
	$(INSTALL_DATA) $(OPS_FILE) $(DESTDIR)/etc/ntp.conf
fs-install: $(FS_FILE)
	mv -f $(DESTDIR)/etc/ntp.conf $(DESTDIR)/etc/ntp.conf.bak
	$(INSTALL_DATA) $(FS_FILE) $(DESTDIR)/etc/ntp.conf
80 81
clientconfig: $(NODE_FILE)
	$(INSTALL_DATA) $(NODE_FILE) $(TBROOT)/etc/image_ntp.conf
82
else
83
install control-install fs-install clientconfig:
84 85 86 87 88
	@echo "Cannot install NTP config in dev tree"
endif

clean:
	rm -f $(CONFIG_FILES)