# Copyright (C) 2012, 2015 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 database functions (stored procedures) # # Karl O. Pinc # You can write: # make functionname # to install just that function. # Devfault variable values. include ../defaults.mk # Have make look for files in the include directory VPATH = ../include m4_sources = followfunc.m4 followrole.m4 mom_in_gc.m4 infants_in_gc.m4 \ add_social_partners.m4 infer_gc.m4 delete_gc.m4 \ run_integrity_queries.m4 function_targets := $(patsubst %.m4,%,$(m4_sources)) all: makefunctions destroyfunctions makefunctions: maketypes.m4 $(m4_sources) macros.m4 $(INCLUDES) m4 -I ../include maketypes.m4 $(m4_sources) > makefunctions destroyfunctions: destroytypes.m4 destroyfunctions.m4 \ destroywarningfunctions.m4 $(INCLUDES) m4 -I ../include 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; \ ../vacuum_sys; ) \ | psql $(PSQL_ARGS) install: makefunctions ( echo set client_min_messages TO WARNING\; ; \ echo BEGIN\; ; \ cat makefunctions ; \ echo COMMIT\; ; \ ../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)