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

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

ETCDIR          = /etc
NAMEDB_DIR	= $(ETCDIR)/namedb
OURDOMAIN       = @OURDOMAIN@

# This is silly. Needs to be done properly.
17 18
TESTBED_NETWORK          = @TESTBED_NETWORK@
EXTERNAL_TESTBED_NETWORK = @EXTERNAL_TESTBED_NETWORK@
19 20 21 22 23 24

REVERSE_MAPNAME          = \
		$(shell echo @TESTBED_NETWORK@ | sed -e 's,.0$$,,')
EXTERNAL_REVERSE_MAPNAME = \
		$(shell echo @EXTERNAL_TESTBED_NETWORK@ | sed -e 's,.0$$,,')

25 26 27 28 29
REVFILES                 = $(REVERSE_MAPNAME).db.head
ifneq ($(REVERSE_MAPNAME), $(EXTERNAL_REVERSE_MAPNAME))
    REVFILES            .= $(REVFILES) $(EXTERNAL_REVERSE_MAPNAME).db.head
endif

30 31
BOSSTOKEN       = $(shell echo @BOSSNODE@ | sed -e 's/\..*//')
USERTOKEN       = $(shell echo @USERNODE@ | sed -e 's/\..*//')
32

33 34 35
NAMED_FILES	= named.conf.template named_makeconf named_makerev reverse.head \
		 resolv.conf localhost.rev forward.head named_makeforw \
		 $(REVFILES) $(OURDOMAIN).db.head $(OURDOMAIN).internal.db.head \
36
		 named.conf resolv.conf.ops
37 38 39 40 41 42 43 44

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)
45
	echo $(REVFILES)
46 47 48

include $(TESTBED_SRCDIR)/GNUmakerules

49 50
$(OURDOMAIN).db.head: forward.head named_makeforw
	perl named_makeforw -external forward.head > $@
51

52 53
$(OURDOMAIN).internal.db.head: forward.head named_makeforw
	perl named_makeforw -internal forward.head > $@
54 55 56 57

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

58 59 60
$(REVFILES):	reverse.head named_makerev
	perl named_makerev reverse.head

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

65 66
install-real:	resolv.conf \
		$(NAMEDB_DIR)/named.conf \
67 68
		$(NAMEDB_DIR)/localhost.rev \
		$(NAMEDB_DIR)/$(OURDOMAIN).db.head \
69 70
		$(NAMEDB_DIR)/$(OURDOMAIN).internal.db.head \
		$(addprefix $(NAMEDB_DIR)/reverse/, $(REVFILES))
71
	$(INSTALL_DATA) resolv.conf $(ETCDIR)/resolv.conf
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90

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) $< $@