File: rules

package info (click to toggle)
latex2html 2000-beta1-5
  • links: PTS
  • area: main
  • in suites: woody
  • size: 6,696 kB
  • ctags: 3,087
  • sloc: perl: 29,736; makefile: 828; sh: 308
file content (172 lines) | stat: -rwxr-xr-x 6,785 bytes parent folder | download
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#!/usr/bin/make -f

# set the dpkg-architecture vars
export DEB_BUILD_ARCH      := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
export DEB_BUILD_GNU_CPU   := $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
export DEB_BUILD_GNU_SYSTEM:= $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
export DEB_BUILD_GNU_TYPE  := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
export DEB_HOST_ARCH       := $(shell dpkg-architecture -qDEB_HOST_ARCH)
export DEB_HOST_GNU_CPU    := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
export DEB_HOST_GNU_SYSTEM := $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
export DEB_HOST_GNU_TYPE   := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)


#
# VERSION=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | \
#                          sed 's/^Version: *//')
#

FILES_TO_CLEAN = debian/files debian/buildinfo debian/substvars        \
                 latex2html.bak

STAMPS_TO_CLEAN = stamp-configure stamp-build stamp-binary
DIRS_TO_CLEAN   = debian/tmp  docs/manual
thisdir         =$(shell pwd)

install_file   = /usr/bin/install -p    -o root -g root  -m 644
install_program= /usr/bin/install -p    -o root -g root  -m 755
install_game   = /usr/bin/install -p    -o root -g games -m 2755
make_directory = /usr/bin/install -p -d -o root -g root  -m 755

package = $(shell grep Source debian/control | sed 's/^Source: //')

CC          := gcc
CFLAGS      := -O2
LDFLAGS     := -s
PERL        := /usr/bin/perl
PREFIX      := /usr
BINDIR      := $(PREFIX)/bin
LIBDIR      := $(PREFIX)/share/latex2html
ICONPATH    := $(PREFIX)/share/latex2html/icons
ICONSTORAGE := /var/www/$(ICONPATH)

# Location of the source dir
SRCTOP := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi;)
TMPTOP         := $(SRCTOP)/debian/tmp
DOCDIR 	       := $(TMPTOP)/usr/share/doc/$(package)
DOCBASE        := $(TMPTOP)/usr/share/doc-base
MENUDIR        := $(TMPTOP)/usr/lib/menu/
MANDIR         := $(TMPTOP)/usr/share/man/man1
OLDSHADOWDIR   := $(TMPTOP)/var/www/usr/lib
SHADOW_DIR     := $(TMPTOP)/var/www/usr/share/$(package)/
SHADOW_ICONDIR := $(TMPTOP)/var/www/usr/share/$(package)/icons

CONVERT_CMD:= '../latex2html -test_mode -no_math -html_version 4.0,math,frame -accent_images textrm -scalable_fonts'
all build: stamp-build
stamp-build:
	$(checkdir)
	cd docs && ln -sf ../texinputs/html*.sty .
	-test -f stamp-configure || $(MAKE) -f debian/rules configure
	$(MAKE)
	mkdir -p docs/manual
	$(MAKE) -C docs  -f Makefile.frames \
              L2H=$(CONVERT_CMD) \
	      LATEX2HTMLDIR=$(SRCTOP) manual.dvi;
	$(MAKE) -C docs  -f Makefile.frames \
              L2H=$(CONVERT_CMD) \
	      LATEX2HTMLDIR=$(SRCTOP) manual.ps;
	$(MAKE) -C docs  -f Makefile.frames \
              L2H=$(CONVERT_CMD) \
	      LATEX2HTMLDIR=$(SRCTOP) manual.html ;
	dpkg -l gcc perl dpkg 'libc*' binutils ldso make dpkg-dev |\
         awk '$$1 == "ii" { printf("%s-%s\n", $$2, $$3) }' > \
          debian/buildinfo
	touch stamp-build

configure: stamp-configure

stamp-configure:
	$(checkdir)
	./configure --verbose --prefix=$(PREFIX) --disable-gif \
                    --libdir=$(LIBDIR) \
                    --with-perl=$(PERL) \
                    --with-iconpath=$(ICONPATH) \
                    --with-iconstorage=$(ICONSTORAGE) \
                     && touch stamp-configure

clean:
	$(checkdir)
	rm -f  $(FILES_TO_CLEAN) $(STAMPS_TO_CLEAN) docs/html*.sty
	rm -rf $(DIRS_TO_CLEAN)
	-$(MAKE) -C docs clean htmlclean
	-$(MAKE) distclean
	rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o \
	  -name '*~' -o -name '*.bak' -o -name '#*#' -o \
	  -name '.*.orig' -o -name '.*.rej' -o -name '.SUMS' -o \
	  -size 0 \) -print` TAGS

binary-indep:	build stamp-binary

binary-arch: build

stamp-binary:
	@test 0 = $$(id | sed -e 's/(.*$$//' -e 's/^uid=//') || \
		(echo need root priviledges; exit 1)
	$(checkdir)
	test -f stamp-build ||	$(MAKE) -f debian/rules build
	-rm -rf			$(TMPTOP)
	$(make_directory)	$(DOCDIR)/html
	$(make_directory)       $(MANDIR)
	$(make_directory)	$(MENUDIR)
	$(make_directory)	$(DOCBASE)
	$(make_directory)       $(SHADOW_ICONDIR)
	$(make_directory)       $(OLDSHADOWDIR)
	$(make_directory)	$(TMPTOP)/DEBIAN
	$(make_directory)	$(TMPTOP)/etc
	$(install_file)		debian/changelog     $(DOCDIR)/changelog.Debian
	$(install_file)		debian/README.debian $(DOCDIR)/README.debian
	$(install_file)         debian/buildinfo     $(DOCDIR)/buildinfo.Debian
	$(MAKE)                 INSTALLING_DEBIAN=1 install
	(cd $(OLDSHADOWDIR);    ln -s ../share/$(package) .)
	(cd $(TMPTOP)/$(LIBDIR)/docs; $(MAKE) clean htmlclean)
	(cd $(TMPTOP)/$(LIBDIR); \
            mv l2hconf.pm       $(TMPTOP)/etc/latex2html.conf; \
            ln -s               /etc/latex2html.conf l2hconf.pm )
	(cd $(SHADOW_ICONDIR);  rm -f *)
	$(install_file)         dot.latex2html-init    $(DOCDIR)/
	$(install_file)         Changes    	       $(DOCDIR)/
	$(install_file)         docs/manual.dvi        $(DOCDIR)/
	$(install_file)         docs/manual.ps         $(DOCDIR)/
	$(install_file)         latex2html.1           $(MANDIR)
	$(install_file)         texexpand.1            $(MANDIR)
	pod2man pstoimg         > $(MANDIR)/pstoimg.1
	-gzip -9fvr		$(DOCDIR)
	-gzip -9fvr		$(MANDIR)
	(cd $(DOCDIR);          ln -s Changes.gz       changelog.gz;)
	$(install_file)         debian/copyright       $(DOCDIR)/copyright
	(cd docs/manual/;       tar cf - *.html *.png  *.css) | \
                                (cd $(DOCDIR)/html; tar xf   -)
	(cd $(TMPTOP)/$(LIBDIR); rm -rf docs;)
	chmod ugo+x 		$(TMPTOP)/$(LIBDIR)/cweb2html/cweb2html
	chmod ugo+x 		$(TMPTOP)/$(LIBDIR)/cweb2html/makemake.pl
	chmod ugo+x 		$(TMPTOP)/$(LIBDIR)/makemap
	chmod ugo+x 		$(TMPTOP)/$(LIBDIR)/makeseg/makeseg
#	mkdir -p $(TMPTOP)/usr/share/texmf/tex/latex
#	cd $(TMPTOP)/usr/share/texmf/tex/latex && \
#	  ln -s ../../../latex2html/texinputs latex2html
	$(make_directory)       $(TMPTOP)/usr/lib/menu
	$(install_file)         debian/menuentry       $(MENUDIR)/$(package)
	$(install_file)         debian/docentry        $(DOCBASE)/$(package)
	$(install_file)		debian/conffiles       $(TMPTOP)/DEBIAN/conffiles
	$(install_program)      debian/postinst        $(TMPTOP)/DEBIAN/postinst
	$(install_program)      debian/postrm          $(TMPTOP)/DEBIAN/postrm
	$(install_program)      debian/prerm           $(TMPTOP)/DEBIAN/prerm
	$(install_program)      debian/preinst         $(TMPTOP)/DEBIAN/preinst
	dpkg-gencontrol -isp
	chown -R root.root	$(TMPTOP)
	chmod -R go=rX		$(TMPTOP)
	dpkg --build		$(TMPTOP) ..
	touch stamp-binary

define checkdir
	test -f debian/rules -a -f latex2html.pin
endef

# Below here is fairly generic really

binary:		binary-indep binary-arch

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

.PHONY: binary binary-arch binary-indep clean checkroot