# Copyright (C) 2012, 2013 The Meme Factory, Inc. http://www.meme.com/ # Copyright (C) 2004, 2005, 2008, 2009, Karl O. Pinc # # This file is part of Gombe-MI. # # Gombe-MI is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Gombe-MI. If not, see . # # Makefile for access conversion functions (stored procedures) # # Karl O. Pinc # You can write: # make functionname # to install just that function. DBPATH := ../../../db # Devfault variable values. include $(DBPATH)/defaults.mk # Have make look for files in the include directory VPATH = $(DBPATH)/include:$(DBPATH)/functions #m4_sources = foo.m4 bar.m4 ... m4_sources = convert_access.m4 prepare_data.m4 convert_animid.m4 \ convert_access_gc.m4 ff_from_comments.m4 function_targets := $(patsubst %.m4,%,$(m4_sources)) all: makefunctions destroyfunctions makefunctions: maketypes.m4 $(m4_sources) macros.m4 $(INCLUDES) m4 -I $(DBPATH)/include \ -I $(DBPATH)/functions maketypes.m4 $(m4_sources) > makefunctions destroyfunctions: destroytypes.m4 destroyfunctions.m4 $(INCLUDES) m4 -I $(DBPATH)/include \ -I $(DBPATH)/functions destroyfunctions.m4 destroytypes.m4 \ > destroyfunctions clean: rm -rf makefunctions destroyfunctions refunction: reinstall reinstall: destroyfunctions makefunctions $(INCLUDES) ( echo set client_min_messages TO WARNING\; ; \ cat destroyfunctions makefunctions; \ $(DBPATH)/vacuum_sys; ) \ | psql $(PSQL_ARGS) install: makefunctions ( echo set client_min_messages TO WARNING\; ; \ echo BEGIN\; ; \ cat makefunctions ; \ echo COMMIT\; ; \ $(DBPATH)/vacuum_sys; ) \ | psql $(PSQL_ARGS) destroy: destroyfunctions ( echo set client_min_messages TO WARNING\; ; \ cat destroyfunctions ; ) \ | psql $(PSQL_ARGS) # The rule that makes individual functions and install them. .PHONY: $(function_targets) $(function_targets): ( echo set client_min_messages TO WARNING\; ; \ m4 -I ../include $@.m4 ; ) \ | psql $(PSQL_ARGS)