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

SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= firewall
TBDB		= @TBDBNAME@

FW_SCRIPTS	= initfwvars.pl
14
FW_FILES	= open.sql closed.sql basic.sql elabinelab.sql
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

include $(OBJDIR)/Makeconf

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

include $(TESTBED_SRCDIR)/GNUmakerules

%.sql: genconfig.pl
	$(SRCDIR)/genconfig.pl -f $(SRCDIR)/fw-rules -M $* > $@

insertvars: initfwvars.pl
	@if ! `mysqldump $(TBDB) default_firewall_vars >/dev/null 2>&1`; then \
		echo -n '*** default_firewall_vars table does not exist, '; \
		echo 'see sql/database-migrate.txt'; \
		exit 1; \
	else \
		chmod +x ./initfwvars.pl; \
		./initfwvars.pl; \
	fi

insertrules: $(FW_FILES)
	@if ! `mysqldump $(TBDB) default_firewall_rules >/dev/null 2>&1`; then \
		echo -n '*** default_firewall_rules table does not exist, '; \
		echo 'see sql/database-migrate.txt'; \
		exit 1; \
	else \
		cat $(FW_FILES) | mysql $(TBDB); \
	fi