File: Makefile

package info (click to toggle)
cl-hyperobject 2.11.0-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 292 kB
  • ctags: 223
  • sloc: lisp: 1,820; xml: 215; makefile: 148
file content (130 lines) | stat: -rw-r--r-- 2,962 bytes parent folder | download | duplicates (4)
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
##############################################################################
# FILE IDENTIFICATION
# 
#  Name:         Makefile
#  Purpose:      Makefile for the hyperobject documentation
#  Programer:    Kevin M. Rosenberg
#  Date Started: Mar 2002
#
#  CVS Id:   $Id: Makefile 8261 2003-11-21 03:46:37Z kevin $
#
# This file, part of HYPEROBJECT, is Copyright (c) 2002-2003 by Kevin M. Rosenberg
#
# HYPEROBJECT users are granted the rights to distribute and use this software
# as governed by the terms of the Lisp Lesser GNU Public License
# (http://opensource.franz.com/preamble.html), also known as the LLGPL.
##############################################################################

DOCFILE_BASE_DEFAULT:=hyperobject
DOCFILE_EXT_DEFAULT:=xml


# Standard docfile processing

DEBIAN=$(shell expr "`cat /etc/issue`" : '.*Debian.*')
SUSE=$(shell expr "`cat /etc/issue`" : '.*SuSE.*')
REDHAT=$(shell expr "`cat /etc/issue`" : '.*RedHat.*')


ifneq (${DEBIAN},0)
OS:=debian
else
  ifneq (${SUSE},0)
    OS=suse
  else   
    ifneq (${REDHAT},0)
      OS=redhat
    endif
  endif
endif


ifndef DOCFILE_BASE
DOCFILE_BASE=${DOCFILE_BASE_DEFAULT}
endif

ifndef DOCFILE_EXT
DOCFILE_EXT=${DOCFILE_EXT_DEFAULT}
endif

DOCFILE:=${DOCFILE_BASE}.${DOCFILE_EXT}
FOFILE:=${DOCFILE_BASE}.fo
PDFFILE:=${DOCFILE_BASE}.pdf
PSFILE:=${DOCFILE_BASE}.ps
DVIFILE:=${DOCFILE_BASE}.dvi
TXTFILE:=${DOCFILE_BASE}.txt
HTMLFILE:=${DOCFILE_BASE}.html
TMPFILES:=${DOCFILE_BASE}.aux ${DOCFILE_BASE}.out ${DOCFILE_BASE}.log
DOCFILES:=$(shell echo *.xml *.xsl)

ifeq ($(XSLTPROC),)
  XSLTPROC:=xsltproc
endif

CATALOG:=`pwd`/catalog-${OS}.xml
CHECK:=XML_CATALOG_FILES="$(CATALOG)" xmllint --noout --xinclude --postvalid $(DOCFILE) || exit 1

.PHONY: all
all: html pdf 

.PHONY: dist
dist: html pdf

.PHONY: doc
doc: html pdf

.PHONY: check
check:
	@echo "Operating System Detected: ${OS}"
	@$(CHECK)

.PHONY: html
html: html.tar.gz

html.tar.gz: $(DOCFILES) Makefile 
	@rm -rf html
	@mkdir html
	@XML_CATALOG_FILES="$(CATALOG)" $(XSLTPROC) --stringparam chunker.output.encoding ISO-8859-1 \
		 --xinclude --output html/ html_chunk.xsl $(DOCFILE)
	@GZIP='-9' tar czf html.tar.gz html 

.PHONY: fo
fo: ${FOFILE}

${FOFILE}: $(DOCFILES) Makefile 
	@XML_CATALOG_FILES="$(CATALOG)" xsltproc --xinclude --output $(FOFILE) fo.xsl $(DOCFILE)

.PHONY: pdf
pdf: ${PDFFILE}

${PDFFILE}: ${DOCFILES} Makefile
	@$(MAKE) fo
	@fop $(FOFILE) -pdf $(PDFFILE) > /dev/null

.PHONY: dvi
dvi: ${DVIFILE}

.PHONY: ps
ps: ${PSFILE}

${PSFILE}: ${DOCFILES} Makefile
	@$(MAKE) fo
	@fop $(FOFILE) -ps $(PSFILE) > /dev/null


.PHONY: txt
txt: ${TXTFILE}

${TXTFILE}: ${FOFILE}
	@XML_CATALOG_FILES="$(CATALOG)" xsltproc --xinclude --output ${HTMLFILE} html.xsl $(DOCFILE)
	lynx -dump ${HTMLFILE} > ${TXTFILE}

.PHONY: clean
clean: 
	@rm -f *~ *.bak *.orig \#*\# .\#* texput.log
	@rm -rf html ${PSFILE} ${HTMLFILE}
	@rm -f ${TMPFILES} ${FOFILE}
	@rm -f  ${DVIFILE} ${TXTFILE}

.PHONY: distclean
distclean: clean