2009-03-13 19:39:06 +00:00
|
|
|
################################################################
|
|
|
|
# SWI-Prolog `sgml2pl' package
|
|
|
|
# Author: Jan Wielemaker. jan@swi.psy.uva.nl
|
|
|
|
# Copyright: LGPL (see COPYING or www.gnu.org
|
|
|
|
################################################################
|
|
|
|
|
|
|
|
.SUFFIXES: .tex .dvi .doc .pl
|
|
|
|
|
|
|
|
ifeq (@PROLOG_SYSTEM@,yap)
|
|
|
|
|
|
|
|
prefix = @prefix@
|
2010-03-05 10:22:48 +00:00
|
|
|
exec_prefix = @exec_prefix@
|
2009-03-13 19:39:06 +00:00
|
|
|
ROOTDIR = $(prefix)
|
|
|
|
EROOTDIR = @exec_prefix@
|
2009-05-02 20:11:54 +01:00
|
|
|
abs_top_builddir = @abs_top_builddir@
|
2009-03-13 19:39:06 +00:00
|
|
|
|
|
|
|
srcdir=@srcdir@
|
|
|
|
|
|
|
|
BINDIR = $(EROOTDIR)/bin
|
2010-03-05 08:15:02 +00:00
|
|
|
LIBDIR=@libdir@
|
|
|
|
YAPLIBDIR=@libdir@/Yap
|
2009-03-13 19:39:06 +00:00
|
|
|
SHAREDIR=$(ROOTDIR)/share/Yap
|
|
|
|
|
|
|
|
SHELL=@SHELL@
|
2010-06-04 22:59:31 +01:00
|
|
|
PL=@INSTALL_ENV@ $(DESTDIR)$(BINDIR)/yap $(DESTDIR)$(YAPLIBDIR)/startup.yss
|
2009-03-13 19:39:06 +00:00
|
|
|
CHRDIR=$(SHAREDIR)/chr
|
|
|
|
EXDIR=$(CHRDIR)/examples/chr
|
|
|
|
LN_S=@LN_S@
|
|
|
|
#
|
|
|
|
#
|
|
|
|
CC=@CC@
|
2010-06-21 11:54:21 +01:00
|
|
|
CFLAGS= @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -D_YAP_NOT_INSTALLED_=1 -I$(srcdir) -I../.. -I$(srcdir)/../../include @CPPFLAGS@
|
2009-03-13 19:39:06 +00:00
|
|
|
MKINDEX=true
|
|
|
|
|
|
|
|
LD=$(CC)
|
2009-10-16 08:09:50 +01:00
|
|
|
PLLD=$(CC)
|
2009-03-13 19:39:06 +00:00
|
|
|
|
2010-06-14 10:36:13 +01:00
|
|
|
SO=@SO@
|
2009-04-18 21:21:42 +01:00
|
|
|
#4.1VPATH=@srcdir@:@srcdir@/OPTYap
|
|
|
|
CWD=$(PWD)
|
|
|
|
#
|
|
|
|
|
2010-06-14 10:36:13 +01:00
|
|
|
TARGETS= sgml2pl.@SO@
|
2009-03-13 19:39:06 +00:00
|
|
|
|
|
|
|
else # SWI
|
|
|
|
|
|
|
|
PL=@PL@
|
|
|
|
LD=@LD@
|
|
|
|
PLLD=@PLLD@
|
|
|
|
PLBASE=@PLBASE@
|
|
|
|
PLARCH=@PLARCH@
|
|
|
|
PKGDOC=$(PLBASE)/doc/packages
|
|
|
|
PCEHOME=../xpce
|
|
|
|
PLLIB=$(PLBASE)/library
|
|
|
|
PLFOREIGN=$(PLBASE)/lib/$(PLARCH)
|
|
|
|
DESTDIR=
|
|
|
|
SO=@SO@
|
|
|
|
|
|
|
|
DOCTOTEX=$(PCEHOME)/bin/doc2tex
|
|
|
|
PLTOTEX=$(PCEHOME)/bin/pl2tex
|
|
|
|
LATEX=latex
|
|
|
|
DOC=sgml
|
|
|
|
TEX=$(DOC).tex
|
|
|
|
DVI=$(DOC).dvi
|
|
|
|
PDF=$(DOC).pdf
|
|
|
|
HTML=$(DOC).html
|
|
|
|
|
|
|
|
CC=@CC@
|
|
|
|
COFLAGS=@COFLAGS@
|
|
|
|
CWFLAGS=@CWFLAGS@
|
|
|
|
CMFLAGS=@CMFLAGS@
|
|
|
|
CIFLAGS=-I. -I@PLINCL@
|
|
|
|
CFLAGS=$(COFLAGS) $(CWFLAGS) $(CMFLAGS) $(CIFLAGS) @DEFS@
|
|
|
|
LDFLAGS=$(COFLAGS)
|
|
|
|
|
|
|
|
LDSOFLAGS=@LDSOFLAGS@
|
|
|
|
|
|
|
|
TARGETS= sgml2pl.@SO@
|
|
|
|
|
|
|
|
endif #YAP/SWI
|
|
|
|
|
|
|
|
INSTALL=@INSTALL@
|
|
|
|
INSTALL_PROGRAM=@INSTALL_PROGRAM@
|
|
|
|
INSTALL_DATA=@INSTALL_DATA@
|
|
|
|
|
|
|
|
LIBOBJ= parser.o util.o charmap.o catalog.o model.o xmlns.o utf8.o \
|
|
|
|
xml_unicode.o
|
|
|
|
PLOBJ= $(LIBOBJ) error.o sgml2pl.o quote.o
|
|
|
|
SGMLOBJ= $(LIBOBJ) sgml.o
|
|
|
|
DTD2PLOBJ= $(LIBOBJ) dtd2pl.o prolog.o
|
|
|
|
|
|
|
|
HDRS= $(srcdir)/catalog.h $(srcdir)/dtd.h \
|
|
|
|
$(srcdir)/model.h $(srcdir)/prolog.h \
|
|
|
|
$(srcdir)/utf8.h $(srcdir)/xmlns.h \
|
|
|
|
$(srcdir)/config.h $(srcdir)/error.h \
|
|
|
|
$(srcdir)/parser.h $(srcdir)/sgmldefs.h $(srcdir)/util.h
|
|
|
|
|
|
|
|
ALLCSRC= $(LIBOBJ:.o=.c) \
|
|
|
|
$(PLOBJ:.o=.c) $(SGMLOBJ:.o=.c) $(DTD2PLOBJ:.o=.c) \
|
|
|
|
$(HDRS)
|
|
|
|
|
|
|
|
LIBPL= $(srcdir)/sgml.pl $(srcdir)/xsdp_types.pl \
|
2010-07-19 14:56:21 +01:00
|
|
|
$(srcdir)/iso_639.pl $(srcdir)/sgml_write.pl \
|
|
|
|
$(srcdir)/xpath.pl\
|
|
|
|
$(srcdir)/pwp.pl \
|
|
|
|
$(srcdir)/pltotex.pl
|
2009-03-13 19:39:06 +00:00
|
|
|
PROGRAMS= dtd2pl sgml
|
|
|
|
DTDFILES= HTML4.dcl HTML4.dtd \
|
|
|
|
HTML4.soc \
|
|
|
|
HTMLlat1.ent \
|
|
|
|
HTMLspec.ent HTMLsym.ent
|
|
|
|
|
|
|
|
ifeq (@PROLOG_SYSTEM@,yap)
|
|
|
|
|
|
|
|
%.o : $(srcdir)/%.c
|
2010-06-21 11:54:21 +01:00
|
|
|
$(CC) $(CFLAGS) -o $@ -c $<
|
2009-03-13 19:39:06 +00:00
|
|
|
|
2010-06-14 10:36:13 +01:00
|
|
|
@DO_SECOND_LD@sgml2pl.@SO@: $(PLOBJ)
|
|
|
|
@DO_SECOND_LD@ @SHLIB_LD@ -o sgml2pl.@SO@ $(PLOBJ) @EXTRA_LIBS_FOR_SWIDLLS@
|
2009-03-13 19:39:06 +00:00
|
|
|
|
|
|
|
all: $(TARGETS) $(PROGRAMS)
|
|
|
|
|
|
|
|
install: $(TARGETS) $(LIBPL) install-dtd
|
|
|
|
mkdir -p $(DESTDIR)$(YAPLIBDIR)
|
|
|
|
$(INSTALL_PROGRAM) $(TARGETS) $(DESTDIR)$(YAPLIBDIR)
|
|
|
|
$(INSTALL_DATA) $(LIBPL) $(DESTDIR)$(SHAREDIR)
|
|
|
|
$(PL) -f none -g make -t halt
|
|
|
|
|
|
|
|
install-dtd::
|
|
|
|
mkdir -p $(DESTDIR)$(SHAREDIR)/DTD
|
|
|
|
for f in $(DTDFILES); do \
|
|
|
|
$(INSTALL_DATA) $(srcdir)/DTD/$$f $(DESTDIR)$(SHAREDIR)/DTD; \
|
|
|
|
done
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
sgml2pl.@SO@: $(PLOBJ)
|
|
|
|
$(PLLD) -shared -o $@ $(PLOBJ)
|
|
|
|
|
|
|
|
all: coflags $(TARGETS) $(PROGRAMS)
|
|
|
|
|
|
|
|
coflags::
|
|
|
|
@echo $(COFLAGS) > .coflags
|
|
|
|
|
|
|
|
install: $(TARGETS) $(LIBPL) install-dtd
|
|
|
|
mkdir -p $(DESTDIR)$(PLBASE)/lib/$(PLARCH)
|
|
|
|
$(INSTALL_PROGRAM) $(TARGETS) $(DESTDIR)$(PLFOREIGN)
|
|
|
|
$(INSTALL_DATA) $(LIBPL) $(DESTDIR)$(PLLIB)
|
|
|
|
$(PL) -f none -g make -t halt
|
|
|
|
|
|
|
|
install-dtd::
|
|
|
|
mkdir -p $(DESTDIR)$(PLBASE)/library/DTD
|
|
|
|
for f in $(DTDFILES); do \
|
|
|
|
$(INSTALL_DATA) DTD/$$f $(DESTDIR)$(PLBASE)/library/DTD; \
|
|
|
|
done
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
ln-install::
|
|
|
|
@$(MAKE) INSTALL_DATA=../ln-install install
|
|
|
|
|
|
|
|
rpm-install: install
|
|
|
|
|
|
|
|
pdf-install::
|
|
|
|
mkdir -p $(DESTDIR)$(PKGDOC)
|
|
|
|
$(INSTALL_DATA) sgml.pdf $(DESTDIR)$(PKGDOC)
|
|
|
|
|
|
|
|
html-install::
|
|
|
|
mkdir -p $(DESTDIR)$(PKGDOC)
|
|
|
|
$(INSTALL_DATA) sgml.html $(DESTDIR)$(PKGDOC)
|
|
|
|
|
|
|
|
check::
|
2010-08-03 12:59:27 +01:00
|
|
|
$(PL) -f $(srcdir)/Test/test.pl -g test,halt
|
|
|
|
$(PL) -f $(srcdir)/Test/wrtest.pl -g test,halt
|
2009-03-13 19:39:06 +00:00
|
|
|
|
|
|
|
uninstall::
|
|
|
|
(cd $(PLBASE)/lib/$(PLARCH) && rm -f $(TARGETS))
|
|
|
|
(cd $(PLBASE)/library && rm -f $(LIBPL))
|
|
|
|
$(PL) -f none -g make -t halt
|
|
|
|
|
|
|
|
dtd2pl: $(DTD2PLOBJ)
|
|
|
|
$(LD) $(LDFLAGS) -o $@ $(DTD2PLOBJ)
|
|
|
|
|
|
|
|
sgml: $(SGMLOBJ)
|
|
|
|
$(LD) $(LDFLAGS) -o $@ $(SGMLOBJ)
|
|
|
|
|
|
|
|
tags: TAGS
|
|
|
|
|
|
|
|
TAGS: $(ALLCSRC)
|
|
|
|
etags $(ALLCSRC)
|
|
|
|
|
|
|
|
################################################################
|
|
|
|
# Documentation
|
|
|
|
################################################################
|
|
|
|
|
|
|
|
doc: $(PDF) $(HTML)
|
|
|
|
pdf: $(PDF)
|
|
|
|
html: $(HTML)
|
|
|
|
|
|
|
|
$(HTML): $(TEX)
|
|
|
|
latex2html $(DOC)
|
|
|
|
mv html/index.html $@
|
|
|
|
rmdir html
|
|
|
|
|
|
|
|
$(PDF): $(TEX)
|
|
|
|
../../man/runtex --pdf $(DOC)
|
|
|
|
|
|
|
|
$(TEX): $(DOCTOTEX)
|
|
|
|
|
|
|
|
.doc.tex:
|
|
|
|
$(DOCTOTEX) $*.doc > $*.tex
|
|
|
|
.pl.tex:
|
|
|
|
$(PLTOTEX) $*.pl > $*.tex
|
|
|
|
|
|
|
|
docclean::
|
|
|
|
rm -f $(TEX)
|
|
|
|
rm -rf html
|
|
|
|
../../man/runtex --clean $(DOC)
|
|
|
|
|
|
|
|
################################################################
|
|
|
|
# Clean
|
|
|
|
################################################################
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f $(PLOBJ) *~ *.o *% a.out core config.log
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
rm -f $(TARGETS) $(PROGRAMS)
|
|
|
|
rm -f config.cache config.h config.status Makefile
|
|
|
|
rm -f .coflags
|
|
|
|
|