# Copyright (C) 2012 The Meme Factory, Inc. http://www.meme.com/ # Copyright (C) 2010, 2011 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 xml views # # Karl O. Pinc # Have make look for files in the db include directory # (For constants.m4) VPATH = ../../db/include # Where the doc dir is. DOC_PATH := .. # XMLLINT command used to validate xml. include $(DOC_PATH)/xmllint.mk # Get VIEW_NAMES and M4_VIEWS variables. include views.mk MAKEDEPENDS := Makefile $(DOC_PATH)/xmllint.mk \ $(DOC_PATH)/xmllint-wrapper views.mk # Dependenciees of those files that m4 include m4_macros.m4 M4DEPENDS := m4_macros.m4 m4_m4iterators.m4 # Each VIEW_SOURCE must also have a dia document with the same prefix. # (Unless doc/diagrams/image_targets.mk defines an exception) VIEW_SOURCES = $(VIEW_NAMES:%=%.xml) VIEW_VALIDATES = $(VIEW_SOURCES:%.xml=validate/%) TARGETS = $(M4_VIEWS:%=%.xml) all: $(TARGETS) # # The constants # ../constants: constants.m4 $(MAKE) -C .. constants # # XML validation # validate_xml: validate $(VIEW_VALIDATES) validate: if [ ! -d validate ] ; then mkdir validate ; fi # Validate all the views. # As the makefile always validates before constructing # the target this takes care of all the validation xml file dependencies. $(VIEW_VALIDATES): validate/%: %.xml validate $(MAKEDEPENDS) ../constants $(XMLLINT) $< \ && touch $@ clean: rm -rf $(TARGETS) validate mostlyclean: clean