summaryrefslogtreecommitdiff
path: root/dviware/dvi2bitmap/Makefile.am
blob: 5a214037c8b726abcda7e3ed2a80d8bf2e1a79d2 (plain)
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
## Process this file with automake to produce Makefile.in

## Making a release: see README.developer

ACLOCAL_AMFLAGS = -I m4

## Build this directory before its children (required, since test programs
## link against ../libdvi2bitmap.la).  This results in the test programs
## always being built, rather than at 'make check' time, but it appears
## to be necessary in order for 'make check' and 'make dist' to include
## the test directory.
SUBDIRS = . doc test

lib_LTLIBRARIES = libdvi2bitmap.la
D2BHEADERS = \
	Bitmap.h \
	BitmapImage.h \
	DviError.h \
	DviFile.h \
	DviFilePosition.h \
	InputByteStream.h \
	FileByteStream.h \
	PipeStream.h \
	PageRange.h \
	PkFont.h \
	Util.h \
	XBMBitmap.h \
	XPMBitmap.h \
	Byte.h \
	getopt_long.h \
	stringstream.h \
	version.h \
	verbosity.h
libdvi2bitmap_la_SOURCES = \
	Bitmap.cc \
	BitmapImage.cc \
	DviError.cc \
	DviFile.cc \
	DviFilePosition.cc \
	InputByteStream.cc \
	FileByteStream.cc \
	PipeStream.cc \
	PageRange.cc \
	PkFont.cc \
	Util.cc \
	XBMBitmap.cc \
	XPMBitmap.cc \
	$(D2BHEADERS)
EXTRA_libdvi2bitmap_la_SOURCES = \
	GIFBitmap.cc \
	GIFBitmap.h \
	PNGBitmap.cc \
	PNGBitmap.h \
	KarlPathSearcher.cc \
	KarlPathSearcher.h
EXTRALO=@EXTRALO@
libdvi2bitmap_la_LIBADD = $(EXTRALO) $(LTLIBOBJS) -lm
libdvi2bitmap_la_DEPENDENCIES = $(EXTRALO) $(LTLIBOBJS)
libdvi2bitmap_la_LDFLAGS = -version-info @libdvi2bitmap_la_version_info@

bin_PROGRAMS = dvi2bitmap dvireport
dvi2bitmap_SOURCES = dvi2bitmap.cc
dvi2bitmap_LDADD = libdvi2bitmap.la
dvireport_SOURCES = dvireport.cc
dvireport_LDADD = libdvi2bitmap.la

man1_MANS = dvi2bitmap.1 dvireport.1

# OS X tar inserts HFS+ rubbish unless we stop it.
# However there seems no way to stop it doing so, short of
# setting COPYFILE_DISABLE=1 in the environment when we 'make dist'
#AMTAR=COPYFILE_DISABLE=1 tar ### <-- doesn't work

# Special handling for distribution
EXTRA_DIST = $(libdocdir) $(man1_MANS) README LICENCE doc/doc.html doc/doc.img doc/style.css

# Generate library documentation using Doxygen.
# If it's not available, just touch a stamp file in the right directory.
# The configure.ac sets DOXYGEN to NO_DOXYGEN if it's not found.
libdocdir = @DOXYGEN_OUTPUT_DIRECTORY@
DOXYGEN=@DOXYGEN@
$(libdocdir): Doxyfile
	if test -d $(libdocdir); then \
	  rm -Rf $(libdocdir); \
	fi
	if test "$(DOXYGEN)" != NO_DOXYGEN; then \
	  $(DOXYGEN); \
	else \
	  mkdir $(libdocdir); \
	  echo "No doxygen available -- library documentation not generated" >$(libdocdir)/stamp; \
	fi

doc/doc.html: version.sed
	cd doc; $(MAKE) doc.html 
test/sampler.tar:
	cd test; make sampler.tar

# Sync the generated docs to the sourceforge project pages at
# http://dvi2bitmap.sourceforge.net/
sourceforge-sync: dvi2bitmap-webpage/index.html
	rsync -avzP --delete -e ssh dvi2bitmap-webpage/ normang,dvi2bitmap@web.sourceforge.net:htdocs

# An alternative way of bundling the distribution
# (use sourceforge-sync for preference)
webpage-tarball.tar: dvi2bitmap-webpage/index.html
	cd dvi2bitmap-webpage; tar cf ../$@ .

dvi2bitmap-webpage/index.html: \
		html/index.html \
		doc/doc.html \
		test/sampler.tar \
		$(libdocdir) \
		version.sed
	rm -Rf dvi2bitmap-webpage
	mkdir dvi2bitmap-webpage
	cp html/style.css doc/doc.html dvi2bitmap-webpage
	sed -e '/include:AUTHORS/r AUTHORS' -f version.sed html/index.html >dvi2bitmap-webpage/index.html
#	cd dvi2bitmap-webpage; tar xzf ../doc/dvi2bitmap-docs.tar.gz
	cd dvi2bitmap-webpage; tar xf ../test/sampler.tar
	pax -r -w $(libdocdir) dvi2bitmap-webpage

README: README.md version.sed
	rm -f $@
	sed -f version.sed README.md >$@.tmp && mv $@.tmp $@

version.sed: .hg Makefile
	rm -f version.sed
	{ hg parent --template 'if test {latesttagdistance} -eq 0 -a "x{latesttag}" = "x$(VERSION)"; then echo s,@VERSION''@,$(VERSION),; else echo s,@VERSION''@,{node|short},; fi' | sh; \
	  hg parent --template 's/@VCSINFO''@/Mercurial revision {node|short}, {date|isodate}, tag {latesttag} + {latesttagdistance}/\ns,@RELEASEDATE''@,{date(date,"%Y %B %d")},\n'; \
	} >version.sed.tmp && mv version.sed.tmp version.sed

# Version: The reported version is obtained from the most recent
# Mercurial tag IFF that was attached to the last tagged
# version.
version.h: version.sed
	rm -f version.h
	echo 'const char version_string[] = "dvi2bitmap version @VERSION''@, @RELEASEDATE''@";' | sed -f version.sed >version.h