File: rules

package info (click to toggle)
noweb 2.11b-11
  • links: PTS
  • area: main
  • in suites: buster, sid, stretch
  • size: 3,560 kB
  • ctags: 476
  • sloc: sh: 2,816; ansic: 1,832; makefile: 858; perl: 781; lisp: 735; awk: 158; csh: 3
file content (161 lines) | stat: -rwxr-xr-x 4,471 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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. 
# GNU copyright 1997 by Joey Hess.
#
# Modified to use dbs by Federico Di Gregorio.
# Modified to change from dbs to dpatch by Norman Ramsey

package := noweb
version := 2.11a

ICONC=icont

CFLAGS          := -Wall $(shell dpkg-buildflags --get CFLAGS)
INSTALL 	 = install
INSTALL_DATA    := $(INSTALL) -m644
INSTALL_DIR     := $(INSTALL) -p -d -o root -g root  -m  755
INSTALL_FILE    := $(INSTALL) -p    -o root -g root  -m  644
INSTALL_PROGRAM := $(INSTALL) -m755
INSTALL_SCRIPT  := $(INSTALL) -p    -o root -g root  -m  755
DPATCH_DIR       = /usr/share/dpatch

destdir 	:= $(CURDIR)/debian/noweb

ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
         CFLAGS += -O0
else
         CFLAGS += -O2
endif
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

MAKE_OPTIONS = LIBSRC=icon ICONC="${ICONC}" CFLAGS="${CFLAGS}"\
	     BIN=$(1)/usr/bin LIB=$(1)/usr/lib/noweb \
	     LIBNAME=/usr/lib/noweb MAN=$(1)/usr/share/man \
             ELISP=$(1)/usr/share/emacs/site-lisp  \
	     TEXINPUTS=$(1)/usr/share/texmf/tex/plain/misc \
	     TEXNAME=/usr/share/texmf/tex/plain/misc


# the dbs rules
DEB_SOURCE_PACKAGE := noweb
include $(DPATCH_DIR)/dpatch.make

# Some vars needed for clean building the package

DEBIAN_ROOT := $(CURDIR)/debian/$(package)


# Make rules

configure: patch patch-awk

# eventually drop this
BUILD_TREE := $(CURDIR)

patch-awk: patch-awk-stamp
patch-awk-stamp:
	cd $(BUILD_TREE)/src && ./awkname awk
	touch patch-awk-stamp

unpatch-awk:
	cd $(BUILD_TREE)/src && ./awkname nawk
	rm -f patch-awk-stamp

build-arch: build-arch-stamp
build-arch-stamp: configure
	dh_testdir
	cd $(BUILD_TREE)/src && \
	  $(MAKE) $(call MAKE_OPTIONS,)
	cd $(BUILD_TREE)/contrib/norman && $(ICONC) scopehack
	touch build-arch-stamp

build-indep: build-indep-stamp
build-indep-stamp: build-arch-stamp
	dh_testdir
	cd $(BUILD_TREE)/src/xdoc && latex guide.tex && \
	  while grep -s 'Rerun to get cross-references right' guide.log; \
	  do latex guide.tex; done && \
	  dvips guide.dvi -o guide.ps
	cd $(BUILD_TREE)/src/xdoc && latex onepage.tex && \
	  while grep -s 'Rerun to get cross-references right' onepage.log; \
	  do latex onepage.tex; done && \
	  dvips onepage.dvi -o onepage.ps
	cd $(BUILD_TREE)/src/xdoc && ../icon/sl2h guide.tex | \
	  ../icon/htmltoc >guide.html
	touch build-indep-stamp

build: build-arch build-indep

clean: clean-patched unpatch-awk unpatch
clean-patched:
	dh_testdir
	dh_testroot
	rm -fr build-*-stamp
	-cd $(BUILD_TREE)/src && $(MAKE) clean
	-rm -f $(BUILD_TREE)/contrib/norman/scopehack
	-find . -name "*~" -name "core" -exec rm -f "{}" +
	-rm -rf debian/files* debian/substvars debian/noweb
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	cd $(BUILD_TREE)/src && \
	   $(MAKE) install $(call MAKE_OPTIONS,$(destdir))
	$(INSTALL) $(BUILD_TREE)/contrib/norman/scopehack $(destdir)/usr/lib/noweb


# Build architecture-independent files here.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i
	dh_installchangelogs  -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installdocs -a $(BUILD_TREE)/src/README $(BUILD_TREE)/src/FAQ \
	  $(BUILD_TREE)/src/xdoc/guide.html $(BUILD_TREE)/src/xdoc/guide.ps \
	  $(BUILD_TREE)/src/xdoc/guide.dvi \
	  $(BUILD_TREE)/src/xdoc/onepage.ps $(BUILD_TREE)/src/xdoc/onepage.dvi
	dh_installexamples -a $(BUILD_TREE)/examples/*
	dh_installemacsen -a
	dh_installman -a
	dh_installchangelogs  -a
	dh_link -a /usr/share/man/man1/notangle.1 \
	  /usr/share/man/man1/noweave.1 \
	  /usr/share/man/man1/notangle.1 \
	  /usr/share/man/man1/nountangle.1
# removes because is in standard tetex (and other not-needed files)
	rm debian/noweb/usr/share/doc/noweb/examples/multicol.sty
	rm debian/noweb/usr/share/doc/noweb/examples/primes.b??
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_installtex -a
# gives tmac its name and move it to right directory
	mv debian/noweb/usr/lib/noweb/tmac.w \
	  debian/noweb/usr/share/groff/tmac/noweb.tmac
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure