1 2 3 4 5 6 7 8 9 10 11 12 13 14 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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
|
########################################################################
#
# filepp 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 2 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 this program; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#
########################################################################
########################################################################
#
# Project : File Pre Processor
# Filename : $RCSfile: Makefile.in,v $
# Originator : $Author: darren $
# Maintainer : Darren Miller: darren@cabaret.demon.co.uk
# File version : $Revision: 1.33 $
# Last changed : $Date: 2003/07/14 10:03:13 $
# Description : Main Makefile
# Licence : GNU copyleft
#
########################################################################
##############################################################################
# Paths
##############################################################################
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
mandir = @mandir@
srcdir = @srcdir@
builddir = @builddir@
moduledir = @moduledir@
# top level of test build directory
TESTBUILD = @abs_builddir@/testbuild
module_subdirs = @module_subdirs@
all_subdirs = $(module_subdirs) tests
##############################################################################
# Programs and files
##############################################################################
FILEPP = $(builddir)/filepp
FILEPPMAN = $(builddir)/filepp.1
FILEPPHTML = $(builddir)/filepp.html
FILEPPLSM = $(builddir)/filepp.lsm
FILEPPSPEC = $(builddir)/filepp-@VERSION@.spec
DISTRIBDIR = $(builddir)/filepp-@VERSION@
DISTRIB = $(DISTRIBDIR).tar.gz
CONFIGURE = $(srcdir)/configure
ECHO = @echo@
RM = @rm@
CP = cp -pr
MKDIR = $(srcdir)/mkinstalldirs
INSTALL = @INSTALL@
TAR = tar
GZIP = gzip
MAN2HTML = man2html
##############################################################################
# Dependencies
##############################################################################
IFLAGS = -I$(srcdir)
DFLAGS = -DHIDDEN
default: $(FILEPP) $(FILEPPMAN)
$(FILEPP): $(FILEPPIN)
$(CONFIGURE)
# man page
$(FILEPPMAN): $(srcdir)/filepp.1.in
@$(ECHO) Processing $(srcdir)/filepp.1.in
$(COMPILE.filepp) $(srcdir)/filepp.1.in -o $@
# lsm entry
$(FILEPPLSM): $(srcdir)/filepp.lsm.in
# spec entry
$(FILEPPSPEC): $(srcdir)/filepp.spec.in
@$(ECHO) Processing $(srcdir)/filepp.spec.in
$(COMPILE.filepp) -k $(srcdir)/filepp.spec.in -o $@
#########################################################################
# generic rule to make things in subdirectories
#########################################################################
dirmake:
@for subdir in $(DIRECTORIES); do \
$(ECHO) ""; \
$(ECHO) "Entering directory $$subdir"; \
(cd $$subdir && $(MAKE) $(TARGET)) \
|| case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
# check, test, demo, whatever you wanna call it
test: $(builddir)/test.html
check: test
example:test
demo: test
# full test of all modules and filepp
fulltest: testbuild test
$(MAKE) dirmake DIRECTORIES="$(all_subdirs)" TARGET=test
$(builddir)/test.html: $(FILEPP) $(srcdir)/test.html.in \
$(srcdir)/header.html.in $(srcdir)/footer.html.in $(srcdir)/testsuite
# makes a test version of filepp and installs it so it uses the correct
# versions of the modules (rather than any versions installed elsewhere)
.PHONY: testbuild
testbuild:
$(MKDIR) $(TESTBUILD)
(cd $(TESTBUILD) && @abs_top_srcdir@/configure --prefix=$(TESTBUILD) && $(MAKE) && $(MAKE) install)
# html version of man page
$(FILEPPHTML): $(FILEPPMAN)
$(MAN2HTML) $(FILEPPMAN) > $(FILEPPHTML)
# installation
install: $(FILEPP) $(FILEPPMAN)
@$(MKDIR) $(bindir)
$(INSTALL) $(FILEPP) $(bindir)
@$(MKDIR) $(mandir)/man1
$(INSTALL) -m 644 $(FILEPPMAN) $(mandir)/man1
$(MKDIR) $(moduledir)
$(MAKE) dirmake DIRECTORIES="$(module_subdirs)" TARGET=install
# distribution
distrib: $(FILEPPMAN) $(FILEPPLSM) $(FILEPPHTML) $(FILEPPSPEC)
-$(MKDIR) $(DISTRIBDIR)
$(CP) $(FILEPPMAN) $(FILEPPLSM) $(FILEPPHTML) \
$(FILEPPSPEC) $(srcdir)/filepp.spec.in \
$(srcdir)/filepp.lsm.in $(srcdir)/filepp.1.in \
$(srcdir)/Makefile.in $(srcdir)/configure.in \
$(srcdir)/COPYING $(srcdir)/INSTALL $(srcdir)/README \
$(srcdir)/install-sh $(srcdir)/configure $(srcdir)/mkinstalldirs \
$(srcdir)/filepp.in $(srcdir)/ChangeLog \
$(srcdir)/footer.html.in $(srcdir)/header.html.in \
$(srcdir)/test.html.in $(srcdir)/testsuite $(srcdir)/testinc \
$(srcdir)/testmod.pm \
$(srcdir)/modules $(srcdir)/tests \
$(DISTRIBDIR)
$(TAR) czvf $(DISTRIB) $(DISTRIBDIR)
$(RM) -r $(DISTRIBDIR)
# clean and distclean
clean:
$(MAKE) dirmake DIRECTORIES="$(all_subdirs)" TARGET=clean
$(RM) $(builddir)/test.html *~
distclean: clean
$(MAKE) dirmake DIRECTORIES="$(all_subdirs)" TARGET=distclean
$(RM) Makefile $(FILEPPLSM) $(FILEPP) $(FILEPPMAN) $(FILEPPHTML) \
$(FILEPPSPEC) config.cache config.status config.log file $(DISTRIB) \
$(TESTBUILD) autom4te.cache
##############################################################################
# Rules
##############################################################################
.SUFFIXES: .in .html.in .html .lsm.in .lsm
COMPILE.filepp = $(FILEPP) $(DFLAGS) $(IFLAGS)
# rule to convert .html.in to .html
.html.in.html:
@$(ECHO) Processing $<
$(COMPILE.filepp) $< -o $@
# rule to convert lsm.in to .lsm
.lsm.in.lsm:
@$(ECHO) Processing $<
$(COMPILE.filepp) -k $< -o $@
##############################################################################
# End of file
##############################################################################
|