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
|
# Make(1) rules for FleXML XML processor generator system.
# Copyright (c) 1999 Kristoffer Rose. All rights reserved.
#
# This file is part of the FleXML XML processor generator system.
# Copyright (c) 1999 Kristoffer Rose. All rights reserved.
#
# This program 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; if not, write to the Free Software Foundation, Inc., 59
# Temple Place, Suite 330, Boston, MA 02111-1307 USA.
# $Id: Makefile,v 1.47 2013/01/29 14:35:24 mquinson Exp $
# SUFF (defined in Makefile.defs) is the versioning suffix added to binaries and
# resource files. To get rid of it (and do a non-versioned install,
# for example), do:
# make whatever SUFF=
# FILES.
include Makefile.defs
STUFF = GPL Makefile Makefile.defs flexml.pl
BINS = $(FLEXML)
LIBS = $(FLEXML_ACT)
DATA = skel
MANS = flexml.1
DOCS = README ChangeLog NEWS NOTES TODO flexml-act.dtd
HTMLS = FleXML.html paper.html
SRC = $(STUFF) $(DATA) $(DOCS) $(HTMLS)
ALL = $(PROGS) $(LIBS) $(DATA) $(MANS) $(DOCS) $(HTMLS)
.PHONY: all install dist test clean
# PRIMARY TARGETS.
all: $(ALL)
install: $(ALL)
mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) \
$(DESTDIR)$(MAN1DIR) $(DESTDIR)$(DOCDIR) \
$(DESTDIR)$(DATADIR) \
$(DESTDIR)$(DOCDIR)/html \
$(DESTDIR)$(DOCDIR)/examples
$(INSTALL) -m555 $(BINS) $(DESTDIR)$(BINDIR)/
$(INSTALL) -m555 $(LIBS) $(DESTDIR)$(LIBDIR)/
$(INSTALL) -m444 $(DATA) $(DESTDIR)$(DATADIR)/
$(INSTALL) -m444 $(MANS) $(DESTDIR)$(MAN1DIR)/
$(INSTALL) -m444 $(DOCS) $(DESTDIR)$(DOCDIR)/
$(INSTALL) -m444 $(HTMLS) $(DESTDIR)$(DOCDIR)/html/
if test "x$(SUFF)" != "x" ; then \
rm -f $(DESTDIR)$(BINDIR)/flexml; \
ln -s $(DESTDIR)$(BINDIR)/$(FLEXML) $(DESTDIR)$(BINDIR)/flexml;\
fi
$(MAKE) -C examples install
FLEXML_DISTDIR = $(FLEXML)-$(VER)
dist: test clean
@echo "Building distribution..."
mkdir $(FLEXML_DISTDIR)
cp $(STUFF) $(DATA) $(DOCS) $(HTMLS) flexml-act-bootstrap.c \
$(FLEXML_DISTDIR)
cp -r examples testbed $(FLEXML_DISTDIR)
find $(FLEXML_DISTDIR) -name CVS | xargs rm -rf
find $(FLEXML_DISTDIR) -name .cvsignore | xargs rm -rf
tar cvfz $(FLEXML_DISTDIR).tar.gz $(FLEXML_DISTDIR)
rm -rf $(FLEXML_DISTDIR)
#rsync -v FleXML.html $(WEBHOME)/FleXML.html
#rsync -va --cvs-exclude --delete-excluded ./ $(FTPHOME)/
clean::; @echo "Cleaning..."
$(RM) -rf $(FLEXML_DIR).tar.gz $(FLEXML_DIR)
$(RM) *.[olh1] *-dummy.? lex.* *~ ./#*
find -name '*~' | xargs $(RM)
test:: all
@echo "Testing..."
clean::; $(RM) $(FLEXML) $(FLEXML_ACT) flexml-act flexml-act.c
$(FLEXML): flexml.pl
sed \
-e "s;FLEXMLVERSION;$(VER);g" \
-e "s;[.][/]flexml-act;$(ACT);g" \
-e "s;[.][/]skel;$(SKEL);g" \
-e "s;/var/tmp;$(TMPDIR);g" \
-e "s;/usr/share/doc/;$(DOCDIR)/;g" flexml.pl > $@
chmod +x $@
ifneq ($(SUFF),)
$(FLEXML_ACT): flexml-act
cp flexml-act $@
endif
# Action language...
flexml-act.l: flexml-act.dtd skel
$(PERL) ./flexml.pl $(FLEXDEBUG) -Lv -ractions -s skel $<
flexml-act.c: flexml-act.l
$(FLEX) -B -s -v -oflexml-act.c flexml-act.l
flexml-act.o: flexml-act.c flexml-act.h
flexml-act-bootstrap.o: flexml-act-bootstrap.c flexml-act.h
flexml-act: flexml-act.o flexml-act-bootstrap.o
clean::; $(RM) TAGS
TAGS: $(SRC); etags $(SRC)
ci: $(SRC); ci -u $(SRC)
# DOCUMENTS.
clean::; $(RM) flexml.html index.html pod2html-*
flexml.1: $(FLEXML)
$(POD2MAN) $(FLEXML) > $@
flexml.html: $(FLEXML)
$(POD2HTML) < $(FLEXML) > $@
index.html: FleXML.html
sed 's.ftp/FleXML/..g' FleXML.html > $@
# TESTS.
clean::; $(MAKE) -C examples $@; $(MAKE) -C testbed $@
test::; $(MAKE) -C examples $@; \
$(MAKE) -C testbed $@ > test.out 2>&1; ! grep '^fail' test.out && \
echo "Tests succeeded."
# END.
clean::; @echo "Done cleaning."
test::; @echo "Done testing."
|