| 1 |
# Make(1) rules for FleXML XML processor generator system. |
| 2 |
# Copyright (c) 1999 Kristoffer Rose. All rights reserved. |
| 3 |
# |
| 4 |
# This file is part of the FleXML XML processor generator system. |
| 5 |
# Copyright (c) 1999 Kristoffer Rose. All rights reserved. |
| 6 |
# |
| 7 |
# This program is free software; you can redistribute it and/or modify it |
| 8 |
# under the terms of the GNU General Public License as published by the Free |
| 9 |
# Software Foundation; either version 2 of the License, or (at your option) |
| 10 |
# any later version. |
| 11 |
# |
| 12 |
# This program is distributed in the hope that it will be useful, but WITHOUT |
| 13 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 14 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 15 |
# more details. |
| 16 |
# |
| 17 |
# You should have received a copy of the GNU General Public License along |
| 18 |
# with this program; if not, write to the Free Software Foundation, Inc., 59 |
| 19 |
# Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
| 20 |
|
| 21 |
# $Id: Makefile,v 1.47 2013/01/29 14:35:24 mquinson Exp $ |
| 22 |
|
| 23 |
# SUFF (defined in Makefile.defs) is the versioning suffix added to binaries and |
| 24 |
# resource files. To get rid of it (and do a non-versioned install, |
| 25 |
# for example), do: |
| 26 |
# make whatever SUFF= |
| 27 |
|
| 28 |
# FILES. |
| 29 |
|
| 30 |
include Makefile.defs |
| 31 |
|
| 32 |
STUFF = GPL Makefile Makefile.defs flexml.pl |
| 33 |
BINS = $(FLEXML) |
| 34 |
LIBS = $(FLEXML_ACT) |
| 35 |
DATA = skel |
| 36 |
MANS = flexml.1 |
| 37 |
DOCS = README ChangeLog NEWS NOTES TODO flexml-act.dtd |
| 38 |
HTMLS = FleXML.html paper.html |
| 39 |
|
| 40 |
SRC = $(STUFF) $(DATA) $(DOCS) $(HTMLS) |
| 41 |
ALL = $(PROGS) $(LIBS) $(DATA) $(MANS) $(DOCS) $(HTMLS) |
| 42 |
|
| 43 |
.PHONY: all install dist test clean |
| 44 |
|
| 45 |
# PRIMARY TARGETS. |
| 46 |
|
| 47 |
all: $(ALL) |
| 48 |
|
| 49 |
install: $(ALL) |
| 50 |
mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) \ |
| 51 |
$(DESTDIR)$(MAN1DIR) $(DESTDIR)$(DOCDIR) \ |
| 52 |
$(DESTDIR)$(DATADIR) \ |
| 53 |
$(DESTDIR)$(DOCDIR)/html \ |
| 54 |
$(DESTDIR)$(DOCDIR)/examples |
| 55 |
$(INSTALL) -m555 $(BINS) $(DESTDIR)$(BINDIR)/ |
| 56 |
$(INSTALL) -m555 $(LIBS) $(DESTDIR)$(LIBDIR)/ |
| 57 |
$(INSTALL) -m444 $(DATA) $(DESTDIR)$(DATADIR)/ |
| 58 |
$(INSTALL) -m444 $(MANS) $(DESTDIR)$(MAN1DIR)/ |
| 59 |
$(INSTALL) -m444 $(DOCS) $(DESTDIR)$(DOCDIR)/ |
| 60 |
$(INSTALL) -m444 $(HTMLS) $(DESTDIR)$(DOCDIR)/html/ |
| 61 |
if test "x$(SUFF)" != "x" ; then \ |
| 62 |
rm -f $(DESTDIR)$(BINDIR)/flexml; \ |
| 63 |
ln -s $(DESTDIR)$(BINDIR)/$(FLEXML) $(DESTDIR)$(BINDIR)/flexml;\ |
| 64 |
fi |
| 65 |
$(MAKE) -C examples install |
| 66 |
|
| 67 |
FLEXML_DISTDIR = $(FLEXML)-$(VER) |
| 68 |
dist: test clean |
| 69 |
@echo "Building distribution..." |
| 70 |
mkdir $(FLEXML_DISTDIR) |
| 71 |
cp $(STUFF) $(DATA) $(DOCS) $(HTMLS) flexml-act-bootstrap.c \ |
| 72 |
$(FLEXML_DISTDIR) |
| 73 |
cp -r examples testbed $(FLEXML_DISTDIR) |
| 74 |
find $(FLEXML_DISTDIR) -name CVS | xargs rm -rf |
| 75 |
find $(FLEXML_DISTDIR) -name .cvsignore | xargs rm -rf |
| 76 |
tar cvfz $(FLEXML_DISTDIR).tar.gz $(FLEXML_DISTDIR) |
| 77 |
rm -rf $(FLEXML_DISTDIR) |
| 78 |
|
| 79 |
#rsync -v FleXML.html $(WEBHOME)/FleXML.html |
| 80 |
#rsync -va --cvs-exclude --delete-excluded ./ $(FTPHOME)/ |
| 81 |
|
| 82 |
clean::; @echo "Cleaning..." |
| 83 |
$(RM) -rf $(FLEXML_DIR).tar.gz $(FLEXML_DIR) |
| 84 |
$(RM) *.[olh1] *-dummy.? lex.* *~ ./#* |
| 85 |
find -name '*~' | xargs $(RM) |
| 86 |
test:: all |
| 87 |
@echo "Testing..." |
| 88 |
|
| 89 |
clean::; $(RM) $(FLEXML) $(FLEXML_ACT) flexml-act flexml-act.c |
| 90 |
|
| 91 |
$(FLEXML): flexml.pl |
| 92 |
sed \ |
| 93 |
-e "s;FLEXMLVERSION;$(VER);g" \ |
| 94 |
-e "s;[.][/]flexml-act;$(ACT);g" \ |
| 95 |
-e "s;[.][/]skel;$(SKEL);g" \ |
| 96 |
-e "s;/var/tmp;$(TMPDIR);g" \ |
| 97 |
-e "s;/usr/share/doc/;$(DOCDIR)/;g" flexml.pl > $@ |
| 98 |
chmod +x $@ |
| 99 |
|
| 100 |
ifneq ($(SUFF),) |
| 101 |
$(FLEXML_ACT): flexml-act |
| 102 |
cp flexml-act $@ |
| 103 |
endif |
| 104 |
|
| 105 |
# Action language... |
| 106 |
flexml-act.l: flexml-act.dtd skel |
| 107 |
$(PERL) ./flexml.pl $(FLEXDEBUG) -Lv -ractions -s skel $< |
| 108 |
|
| 109 |
flexml-act.c: flexml-act.l |
| 110 |
$(FLEX) -B -s -v -oflexml-act.c flexml-act.l |
| 111 |
|
| 112 |
flexml-act.o: flexml-act.c flexml-act.h |
| 113 |
flexml-act-bootstrap.o: flexml-act-bootstrap.c flexml-act.h |
| 114 |
flexml-act: flexml-act.o flexml-act-bootstrap.o |
| 115 |
|
| 116 |
clean::; $(RM) TAGS |
| 117 |
TAGS: $(SRC); etags $(SRC) |
| 118 |
ci: $(SRC); ci -u $(SRC) |
| 119 |
|
| 120 |
# DOCUMENTS. |
| 121 |
|
| 122 |
clean::; $(RM) flexml.html index.html pod2html-* |
| 123 |
|
| 124 |
flexml.1: $(FLEXML) |
| 125 |
$(POD2MAN) $(FLEXML) > $@ |
| 126 |
|
| 127 |
flexml.html: $(FLEXML) |
| 128 |
$(POD2HTML) < $(FLEXML) > $@ |
| 129 |
|
| 130 |
index.html: FleXML.html |
| 131 |
sed 's.ftp/FleXML/..g' FleXML.html > $@ |
| 132 |
|
| 133 |
# TESTS. |
| 134 |
|
| 135 |
clean::; $(MAKE) -C examples $@; $(MAKE) -C testbed $@ |
| 136 |
test::; $(MAKE) -C examples $@; \ |
| 137 |
$(MAKE) -C testbed $@ > test.out 2>&1; ! grep '^fail' test.out && \ |
| 138 |
echo "Tests succeeded." |
| 139 |
|
| 140 |
|
| 141 |
# END. |
| 142 |
|
| 143 |
clean::; @echo "Done cleaning." |
| 144 |
test::; @echo "Done testing." |