GNUmakefile.in 2.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved.
#

SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= named

ETCDIR          = /etc
NAMEDB_DIR	= $(ETCDIR)/namedb
OURDOMAIN       = @OURDOMAIN@
15
FORWARDERS      = @NAMED_FORWARDERS@
16 17 18 19

# This is silly. Needs to be done properly.
TESTBED_NETWORK = @TESTBED_NETWORK@
REVERSE_MAPNAME = $(subst .0,,$(TESTBED_NETWORK))
20 21
BOSSTOKEN       = $(shell echo @BOSSNODE@ | sed -e 's/\..*//')
USERTOKEN       = $(shell echo @USERNODE@ | sed -e 's/\..*//')
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

NAMED_FILES	= named.conf.template named_makeconf \
		  reverse.head resolv.conf localhost.rev forward.head \
		  $(REVERSE_MAPNAME).db.head $(OURDOMAIN).db.head \
		  named.conf

include $(OBJDIR)/Makeconf

#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
# 
all: $(NAMED_FILES)

include $(TESTBED_SRCDIR)/GNUmakerules

# This file is just a copy for now. Ick.
$(REVERSE_MAPNAME).db.head:	reverse.head
40
	cat reverse.head | sed -e 's/$(REVERSE_MAPNAME)\.//' > $(REVERSE_MAPNAME).db.head
41 42

$(OURDOMAIN).db.head:		forward.head
43
	cat forward.head | sed -e 's/BOSSTOKEN/$(BOSSTOKEN)/' -e 's/USERTOKEN/$(USERTOKEN)/' > $(OURDOMAIN).db.head
44 45 46 47 48 49 50 51

named.conf:	named.conf.template named_makeconf
	perl named_makeconf named.conf.template > named.conf

# This is not a safe install target after initial install!
install:
	echo "Are you sure you want to reinstall the namedb files!"

52 53
install-real:	resolv.conf \
		$(NAMEDB_DIR)/named.conf \
54 55
		$(NAMEDB_DIR)/localhost.rev \
		$(NAMEDB_DIR)/$(OURDOMAIN).db.head \
56 57
		$(NAMEDB_DIR)/reverse/$(REVERSE_MAPNAME).db.head
	$(INSTALL_DATA) resolv.conf $(ETCDIR)/resolv.conf
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
	-rm -rf $(NAMEDB_DIR)/$(OURDOMAIN).internal.db.head
	ln -s $(OURDOMAIN).db.head $(NAMEDB_DIR)/$(OURDOMAIN).internal.db.head

clean: 
	rm -f $(NAMED_FILES)

$(ETCDIR)/%: %
	@echo "Installing $<"
	-mkdir -p $(ETCDIR)
	$(INSTALL) $< $@

$(NAMEDB_DIR)/%: %
	@echo "Installing $<"
	-mkdir -p $(NAMEDB_DIR)
	$(INSTALL) $< $@

$(NAMEDB_DIR)/reverse/%: %
	@echo "Installing $<"
	-mkdir -p $(NAMEDB_DIR)/reverse
	$(INSTALL) $< $@