2
# $Id: Makefile.fpc,v 1.14 2005/05/15 12:10:00 peter Exp $
3
# This file is part of the Free Pascal run time library.
4
# Copyright (c) 1996-98 by Michael van Canneyt
6
# Makefile for the Free Pascal Documentation
8
# See the file COPYING.FPC, included in this distribution,
9
# for details about the copyright.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
31
# Debugging the install, that will only copy the .tex to index.html
32
# so a make html and make install goes quickly
35
# Which docs to build by default
37
DOCS = user rtl ref prog fpdoc chart
40
# Can be 'report','book' for pdf/ps, html use their own preamble file
46
ifneq ($(wildcard ../utils/fpdoc/fpdoc),)
47
FPDOC=../utils/fpdoc/fpdoc
58
# Use Ascii mode ? (i.e. no pics in produced HTML ?)
64
#######################################################################
65
# LaTeX Program definitions
66
#######################################################################
76
# DVI to TXT converter
89
#######################################################################
90
# Latex2html conversion.
91
#######################################################################
95
LATEX2HTML = /usr/bin/latex2html
97
# Default options for converter
99
LATEX2HTMLOPTS = -no_reuse -up_url "../fpctoc.html"\
100
-up_title "Free Pascal manuals"\
101
-html_version 4.0 -split 3
103
ifeq ($(ASCIIMODE),YES)
104
LATEX2HTMLOPTS+=-ascii_mode
108
#######################################################################
110
#######################################################################
114
HEVEA = /usr/bin/hevea
116
ifeq ($(ASCIIMODE),YES)
126
PS = $(addsuffix .ps, $(DOCS))
127
DVI = $(addsuffix .dvi, $(DOCS))
128
TXT = $(addsuffix .txt, $(DOCS))
129
PDF = $(addsuffix .pdf, $(DOCS))
130
TOC = $(addsuffix .toc, $(DOCS))
131
AUX = $(addsuffix .aux, $(DOCS))
132
LOG = $(addsuffix .log, $(DOCS))
133
LOT = $(addsuffix .lot, $(DOCS))
134
OUT = $(addsuffix .out, $(DOCS))
135
# Html files are build in a directory
137
CHK = $(addsuffix .chk, $(DOCS))
140
#####################################################################
141
# Conversion from types
142
#####################################################################
144
.PHONY: clean dvi help html ps psdist htmldist htmdist htdist pdfdist \
145
txtdist htm txt pdf refex alldist messages onechap gtk \
148
.SUFFIXES: .dvi .tex .ps .txt .pdf
156
-rm $*.aux $*.idx $*.ilg $*.ind $*.log $*.out $*.toc $*.tmp $*.xref $*.4ht
157
cp -f preamble.$(PREAMBLETYPE) preamble.inc
165
$(DVITXT) -o $*.txt $*.dvi
168
-rm $*.aux $*.idx $*.ilg $*.ind $*.log $*.out $*.toc $*.tmp $*.xref $*.4ht
169
cp -f preamble.$(PREAMBLETYPE) preamble.inc
176
$(TXT) : %.txt: %.dvi
178
$(DVI) : %.dvi: %.tex
180
$(PDF) : %.pdf: %.tex
183
#####################################################################
185
#####################################################################
188
@echo 'Possible targets :'
189
@echo ' dvi : Make documentation using latex.'
190
@echo ' ps : Make documentation using latex and dvips.'
191
@echo ' html : Make HTML documentation using default converter.'
192
@echo ' hevea : Make HTML documentation using hevea'
193
@echo ' l2h : Make HTML documentation using latex2html'
194
@echo ' 4ht : Make HTML documentation using tex4ht'
195
@echo ' pdf : Make documentation using pdflatex'
196
@echo ' txt : dvi, convert to text using dvi2tty'
197
@echo ' htm : Convert .html to .htm files, zip result'
198
@echo ' clean : Clean up the mess.'
199
@echo ' examples : Comple all generic examples'
200
@echo ' linuxexamples : Compile all examples for linux'
201
@echo ' dosexamples : Compile all examples for dos'
202
@echo ' execute : Execute examples (DOS/Windows/OS/2 only)'
203
@echo ' htmldist : html, and rchive result.'
204
@echo ' psdist : ps, and archive result.'
205
@echo ' pdfdist : pdf, and archive result.'
208
-rm -f preamble.inc date.inc messages.inc rtl.inc
209
-rm -f *.4tc *.4ct *.css *.lg *.tmp *.xref
211
-rm -f $(CHK) $(TOC) $(LOG) $(DVI) $(PDF) $(AUX) $(OUT) $(PS) $(HTML) *.i* $(LOT) $(TXT)
213
-rm -f $(notdir $(wildcard styles/*.sty))
215
distclean: clean cleanexamples
216
-rm -f *.tar.gz *.zip
218
#####################################################################
220
#####################################################################
223
@echo \\date\{`date +'%B %Y'`\} > date.inc
225
../compiler/msg2inc$(EXEEXT):
226
$(MAKE) -C ../compiler msg2inc
228
messages.inc: ../compiler/msg2inc$(EXEEXT) ../compiler/msg/errore.msg
229
../compiler/msg2inc -TE ../compiler/msg/errore.msg messages.inc
231
# Local copy of the required styles
232
syntax.sty: styles/syntax.sty
233
cp $(wildcard styles/*.sty) .
235
# Default includes needed for all docs, don't include preamble.inc
236
# because that is overwritten everytime with a new value and therefor
238
INCLUDES=date.inc syntax.sty
241
#####################################################################
243
#####################################################################
245
# Where is System.pp located
246
SYSTEMUNITDIR=$(OS_SOURCE)
247
ifeq ($(findstring bsd,$(OS_SOURCE)),)
248
override SYSTEMUNITDIR=bsd
250
ifeq ($(findstring darwin,$(OS_SOURCE)),)
251
override SYSTEMUNITDIR=bsd
255
# Classes.pp is in rtl/unix/ for several targets
256
ifneq ($(findstring $(OS_SOURCE),linux freebsd darwin netbsd openbsd),)
259
CLASSESUNITDIR=$(OS_SOURCE)
262
FCLOPTS=--package=fcl --descr=classes.xml --input='$(FPCSRCDIR)/rtl/$(OS_SOURCE)/classes.pp -Fi$(FPCSRCDIR)/rtl/objpas/classes'
265
$(FPDOC) --output=fcl.inc $(FCLOPTS) --format=latex
267
RTLOPTS=--hide-protected --warn-no-node --package=rtl --descr=rtl.xml
268
ifndef CURRENTXMLONLY
269
XMLUNITS=sysutils strutils dateutils strings mouse keyboard \
270
crt video dos sockets objects heaptrc mmx ipc printer typinfo \
271
ports getopts emu387 dxeload go32 gpm graph oldlinux baseunix \
272
unixtype unix classes unixutil x86 dynlibs linux math system\
274
RTLXML=$(addsuffix .xml,$(XMLUNITS))
275
RTLOPTS+= --descr=strutils.xml --input="../rtl/objpas/strutils.pp"
276
RTLOPTS+= --descr=sysutils.xml --input="../rtl/unix/sysutils.pp -Fi../rtl/objpas/sysutils -Fi../rtl/inc"
277
RTLOPTS+= --descr=strings.xml --input="../rtl/inc/strings.pp -Fi../rtl/i386 -Fi../rtl/inc"
278
RTLOPTS+= --descr=mouse.xml --input="../rtl/unix/mouse.pp -Fi../rtl/inc"
279
RTLOPTS+= --descr=keyboard.xml --input="../rtl/unix/keyboard.pp -Fi../rtl/inc"
280
RTLOPTS+= --descr=crt.xml --input="../rtl/unix/crt.pp -Fi../rtl/inc"
281
RTLOPTS+= --descr=video.xml --input="../rtl/unix/video.pp -Fi../rtl/inc"
282
RTLOPTS+= --descr=dos.xml --input="../rtl/unix/dos.pp -Fi../rtl/inc -dcpui386"
283
RTLOPTS+= --descr=sockets.xml --input="-dver1_0 ../rtl/unix/sockets.pp -Fi../rtl/inc -Fi../rtl/$(OS_SOURCE)"
284
RTLOPTS+= --descr=objects.xml --input="../rtl/inc/objects.pp -Fi../rtl/i386 -Fi../rtl/$(OS_SOURCE)"
285
RTLOPTS+= --descr=heaptrc.xml --input="../rtl/inc/heaptrc.pp -Fi../rtl/i386 -Fi../rtl/$(OS_SOURCE)"
286
RTLOPTS+= --descr=mmx.xml --input="../rtl/i386/mmx.pp -Fi../rtl/$(OS_SOURCE)"
287
RTLOPTS+= --descr=ipc.xml --input="../rtl/unix/ipc.pp -Fi../rtl/$(OS_SOURCE)"
288
RTLOPTS+= --descr=printer.xml --input="../rtl/unix/printer.pp -Fi../rtl/$(OS_SOURCE) -Fi../rtl/inc"
289
RTLOPTS+= --descr=typinfo.xml --input="../rtl/objpas/typinfo.pp -Fi../rtl/$(OS_SOURCE)"
290
RTLOPTS+= --descr=ports.xml --input="../rtl/unix/ports.pp -Fi../rtl/$(OS_SOURCE)"
291
RTLOPTS+= --descr=getopts.xml --input="../rtl/inc/getopts.pp -Fi../rtl/$(OS_SOURCE)"
292
RTLOPTS+= --descr=emu387.xml --input="../rtl/go32v2/emu387.pp -Fi../rtl/i386"
293
RTLOPTS+= --descr=dxeload.xml --input="../rtl/go32v2/dxeload.pp -Fi../rtl/i386"
294
RTLOPTS+= --descr=go32.xml --input="../rtl/go32v2/go32.pp -Fi../rtl/i386"
295
RTLOPTS+= --descr=gpm.xml --input="-dVER1_0 ../rtl/linux/gpm.pp -Fi../rtl/i386"
296
RTLOPTS+= --descr=graph.xml --input="../rtl/unix/graph.pp -Fi../rtl/i386 -Fi../rtl/inc/graph"
297
RTLOPTS+= --descr=oldlinux.xml --input="../rtl/unix/oldlinux.pp -Fi../rtl/linux -Fi../rtl/unix"
298
RTLOPTS+= --descr=unixtype.xml --input="../rtl/unix/unixtype.pp -Fi../rtl/unix -Fi../rtl/linux -Fi../rtl/linux/i386"
299
RTLOPTS+= --descr=baseunix.xml --input="../rtl/unix/baseunix.pp -Fi../rtl/unix -Fi../rtl/linux -Fi../rtl/linux/i386"
300
RTLOPTS+= --descr=unix.xml --input="../rtl/unix/unix.pp -Fi../rtl/unix -Fi../rtl/linux -Fi../rtl/linux/i386"
301
RTLOPTS+= --descr=classes.xml --input='$(FPCSRCDIR)/rtl/$(CLASSESUNITDIR)/classes.pp -Fi$(FPCSRCDIR)/rtl/objpas/classes'
302
RTLOPTS+= --descr=unixutil.xml --input="../rtl/unix/unixutil.pp"
303
RTLOPTS+= --descr=x86.xml --input="../rtl/unix/x86.pp"
304
RTLOPTS+= --descr=dynlibs.xml --input="../rtl/inc/dynlibs.pp -Fi../rtl/unix"
305
RTLOPTS+= --descr=linux.xml --input="../rtl/unix/linux.pp -Fi../rtl/linux -Fi../rtl/unix"
306
RTLOPTS+= --descr=math.xml --input="../rtl/objpas/math.pp -Fi../rtl/i386 -dFPC_HAS_TYPE_EXTENDED"
307
RTLOPTS+= --descr=system.xml --input="-dfpdocsystem -dHASGETHEAPSTATUS -dSUPPORT_DOUBLE ../rtl/$(SYSTEMUNITDIR)/system.pp -Fi../rtl/$(OS_SOURCE) -Fi../rtl/unix -Fi../rtl/inc -Fi../rtl/i386 -dCPU32 -dHASVARIANT -dFPC_HAS_TYPE_EXTENDED -dHASWIDECHAR"
308
RTLOPTS+=--descr=objpas.xml --input="-dHASINTF ../rtl/objpas/objpas.pp"
309
RTLOPTS+=--descr=dateutils.xml --input="../rtl/objpas/dateutils.pp -Fi../rtl/objpas"
312
RTLOPTS+=--descr=dateutils.xml --input="../rtl/objpas/dateutils.pp -Fi../rtl/objpas"
316
$(FPDOC) --output=rtl.inc $(RTLOPTS) --format=latex
319
#####################################################################
321
#####################################################################
323
ref.dvi: ref.tex $(INCLUDES)
325
prog.dvi: prog.tex $(INCLUDES)
327
user.dvi: user.tex $(INCLUDES) messages.inc
329
fpdoc.dvi: fpdoc.tex $(INCLUDES)
331
fcl.dvi: fcl.tex fcl.inc $(INCLUDES)
336
ref.pdf: ref.tex $(INCLUDES)
338
user.pdf: user.tex $(INCLUDES) messages.inc
340
prog.pdf: prog.tex $(INCLUDES)
342
onechap.pdf: onechap.tex $(INCLUDES)
344
onechap.dvi: onechap.tex $(INCLUDES)
346
fpdoc.pdf: fpdoc.tex $(INCLUDES)
348
fcl.pdf: fcl.tex fcl.inc $(INCLUDES)
352
rtl.dvi: rtl.tex rtl.inc $(INCLUDES)
354
rtl.pdf: rtl.tex rtl.inc $(INCLUDES)
364
all : dvi ps pdf txt html
367
#######################################################################
369
#######################################################################
371
.PHONY: htex user prog onechap ref internal html hevea
374
#######################################################################
375
# Installation debugging
378
cp $@.tex $@/index.html
381
#######################################################################
382
# Automatic selection. Default tex4ht
393
#fcl.chk: classes.xml
394
# $(FPDOC) $(FCLOPTS) --format=html --output=fcl
398
$(FPDOC) $(RTLOPTS) --format=html --output=rtl
401
user.chk: $(INCLUDES) user.tex messages.inc
402
prog.chk: $(INCLUDES) prog.tex
403
onechap.chk: $(INCLUDES) onechap.tex
404
ref.chk: $(INCLUDES) ref.tex
405
fpdoc.chk: $(INCLUDES) fpdoc.tex
406
chart.chk: $(INCLUDES) chart.tex
408
html: $(INCLUDES) $(CHK)
411
#######################################################################
412
# Targets to force using a specific tool.
414
$(MAKE) html USEHEVEA=1
416
$(MAKE) html USEL2H=1
418
$(MAKE) html USETEX4HT=1
421
#####################################################################
423
#####################################################################
425
GTKPDF=$(addsuffix .pdf,$(addprefix gtk, 1 2 3 4 5))
440
#####################################################################
442
#####################################################################
444
.PHONY: pdfinstall psinstall dviinstall txtinstall
447
install -d -m 755 $(INSTALL_DOCDIR)
448
cp $(PDF) $(INSTALL_DOCDIR)
451
install -d -m 755 $(INSTALL_DOCDIR)
452
cp $(PS) $(INSTALL_DOCDIR)
455
install -d -m 755 $(INSTALL_DOCDIR)
456
cp $(DVI) $(INSTALL_DOCDIR)
459
install -d -m 755 $(INSTALL_DOCDIR)
460
cp $(TXT) $(INSTALL_DOCDIR)
463
install -d -m 755 $(INSTALL_DOCDIR)
464
cp fpctoc.html $(INSTALL_DOCDIR)
465
cp -R buttons $(INSTALL_DOCDIR)
466
cp -R pics $(INSTALL_DOCDIR)
467
cp -R $(HTML) $(INSTALL_DOCDIR)
468
find $(INSTALL_DOCDIR) -name 'CVS' -or -name '*.eps' | xargs -n1 rm -rf
471
@echo Choose install from:
472
@echo pdfinstall,htmlinstall,htmldosinstall
476
#####################################################################
477
# Distribution archives/packages
478
#####################################################################
481
$(MAKE) zipinstall ZIPTARGET=psinstall UNIXHier=1 USETAR=y FULLZIPNAME=doc-ps
484
$(MAKE) zipinstall ZIPTARGET=psinstall UNIXHier= USEZIP=y FULLZIPNAME=doc-ps
487
$(MAKE) zipinstall ZIPTARGET=pdfinstall UNIXHier=1 USETAR=y FULLZIPNAME=doc-pdf
490
$(MAKE) zipinstall ZIPTARGET=pdfinstall UNIXHier= USEZIP=y FULLZIPNAME=doc-pdf
493
$(MAKE) zipinstall ZIPTARGET=dviinstall UNIXHier= USEZIP=y FULLZIPNAME=doc-dvi
496
$(MAKE) zipinstall ZIPTARGET=txtinstall UNIXHier= USEZIP=y FULLZIPNAME=doc-txt
499
$(MAKE) zipinstall ZIPTARGET=htmlinstall UNIXHier=1 USETAR=y FULLZIPNAME=doc-html
502
$(MAKE) zipinstall ZIPTARGET=htmlinstall UNIXHier= USEZIP=y FULLZIPNAME=doc-html
506
pdfdist: pdfzip pdftar
512
htmldist: htmlzip htmltar
514
alldist: dvidist psdist txtdist pdfdist htmldist
517
#####################################################################
519
#####################################################################
536
$(MAKE) -C crtex clean
537
$(MAKE) -C dosex clean
538
$(MAKE) -C optex clean
539
$(MAKE) -C mathex clean
540
$(MAKE) -C printex clean
541
$(MAKE) -C progex clean
542
$(MAKE) -C refex clean
543
$(MAKE) -C stringex clean
544
$(MAKE) -C objectex clean
545
$(MAKE) -C sysutex clean
546
$(MAKE) -C typinfex clean
547
$(MAKE) -C kbdex clean
549
dosexamples: examples
553
linuxexamples: examples
560
$(MAKE) -C dosex execute
562
$(MAKE) -C refex execute
563
$(MAKE) -C mathex all
564
$(MAKE) -C mathex execute
565
$(MAKE) -C stringex all
566
$(MAKE) -C stringex execute
567
$(MAKE) -C objectex all
568
$(MAKE) -C objectex execute
569
$(MAKE) -C sysutex all
570
$(MAKE) -C sysutex execute
571
$(MAKE) -C typinfex all
572
$(MAKE) -C typinfex execute
576
# $Log: Makefile.fpc,v $
577
# Revision 1.14 2005/05/15 12:10:00 peter
578
# * use doc/fpc-$version instead of fpdocs-$version
580
# Revision 1.13 2005/05/07 09:41:09 michael
581
# + Last changes to RTL documentation
583
# Revision 1.12 2005/05/05 12:59:59 peter
586
# Revision 1.11 2005/02/20 00:38:28 michael
587
# + Changed tar.gz names to resemble zip names
589
# Revision 1.10 2005/02/19 22:24:47 peter
590
# * updated html target
592
# Revision 1.9 2005/02/18 23:04:15 michael
593
# + Fixed psdist target zip names
595
# Revision 1.8 2005/02/14 17:53:11 peter
596
# * baseunix moved to unix
598
# Revision 1.7 2005/02/11 16:26:38 peter
599
# * fix previous commit
601
# Revision 1.6 2005/02/11 16:25:37 peter
602
# * classes in unix dir
604
# Revision 1.5 2005/02/07 21:05:58 michael
605
# + Small fix for classes.pp
607
# Revision 1.4 2005/02/07 20:39:19 peter
610
# Revision 1.3 2005/02/06 21:02:12 peter
611
# * updated for current rtl
613
# Revision 1.2 2005/01/10 22:49:56 armin
614
# * updated makefile.fpc versions to 1.9.7, regenerated makefiles
616
# Revision 1.1 2005/01/09 20:14:33 peter
617
# * build messages.inc from errore.msg
618
# * new zip and tar targets
619
# * use fpcmake generated Makefile
621
# Revision 1.38 2004/12/30 13:48:53 michael
622
# + Fixed warnings, completed dateutils
624
# Revision 1.37 2004/12/22 08:47:31 marco
625
# * bsd system unit location fix. Hope it works for Darwin too
627
# Revision 1.36 2004/12/21 22:58:24 michael
628
# + Added dateutils functions
630
# Revision 1.35 2004/12/19 20:20:16 peter
631
# * includes variable instead of target to prevent always rebuilding
632
# * also build fcl.pdf
634
# Revision 1.34 2004/12/15 22:14:14 michael
635
# + Make targets fixed (hopefully)