File: rules

package info (click to toggle)
c2man 2.41-11
  • links: PTS
  • area: main
  • in suites: potato
  • size: 800 kB
  • ctags: 863
  • sloc: ansic: 6,559; sh: 5,236; yacc: 839; lex: 621; makefile: 229; perl: 81
file content (166 lines) | stat: -rwxr-xr-x 5,417 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
#! /usr/bin/make -f
############################ -*- Mode: Makefile -*- ###########################
## rules|c2man-2.41/debian ---
## Author           : Manoj Srivastava ( srivasta@tiamat.datasync.com )
## Created On       : Thu Nov 14 09:13:15 1996
## Created On Node  : tiamat.datasync.com
## Last Modified By : Manoj Srivastava
## Last Modified On : Tue Mar 28 09:45:28 2000
## Last Machine Used: glaurung.green-gryphon.com
## Update Count     : 16
## Status           : Unknown, Use with caution!
## HISTORY          :
## Description      :
##
###############################################################################

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

# The name of the package (for example, `emacs').
package = c2man

# The maintainer information.
maintainer = Manoj Srivastava
email= srivasta@debian.org


# Configuration variables (these should be pretty generic)
CC = cc
CFLAGS = -O2
LDFLAGS = -s
PREFIX = /usr
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man
MAN1DIR = $(MANDIR)/man1
DOCDIR = $(PREFIX)/share/doc/$(package)

#  Package specific stuff.  The idea is to try to make the rules
#  generic (gradually).

# c2man.1 and config.h should really be removed by make realclean
# but I did not want to patch the original just for that.
# Also, I am leaving .config alone, so people are not startled
# by a spurious mail message.
FILES_TO_CLEAN = stamp-configure stamp-build c2man.1 config.h debian/files
DIRS_TO_CLEAN  = debian/tmp UU .config debian/Config

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


all build:
# Builds the binary package.
	$(checkdir)
	-test -f stamp-configure || $(MAKE) -f debian/rules configure
	make LEX="flex -l" CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
	touch stamp-build

implode:
	$(checkdir)
	-test -d debian/Config && (cd debian && \
           tar zfc debian.tar.gz Config && \
             uuencode debian.tar.gz debian.tar.gz > debian.uue \
               && rm -f debian.tar.gz )
explode:
	$(checkdir)
	-test ! -d debian/Config && (cd debian && uudecode debian.uue \
           && tar zfx debian.tar.gz && rm -f debian.tar.gz )

configure: stamp-configure

stamp-configure:
# .config is kept so people are not startled by a spurious mail
# message.
	$(checkdir)
	-test ! -d debian/Config && $(MAKE) -f debian/rules explode
	-test ! -f stamp-configure && \
            cp -rpf debian/Config .config && \
		sh ./Configure \
		-de \
                -D prefix=$(PREFIX) \
		-D bin=$(BINDIR) \
		-D optimize="$(CFLAGS)" \
                -D installmansrc=$(MAN1DIR) \
                -D manext=1 \
                -D mansrc=$(MAN1DIR) \
		-D ldflags="$(LDFLAGS)" \
		-D installprivlib=$(DOCDIR) \
		-D privlib=$(DOCDIR) \
                -D cf_email='$(email)' \
                -D d_berknames='define' \
		&& touch stamp-configure
clean:
# Undoes the effect of `make -f debian/rules build'.
	$(checkdir)
	-rm -f  $(FILES_TO_CLEAN)
	-rm -rf $(DIRS_TO_CLEAN)
	-test -f Makefile && make realclean
	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: binary-arch binary-indep

binary-arch: build stamp-binary
# builds the architecture dependent part

binary-indep: build

stamp-binary:
# Makes a binary package.
	@test $$(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            debian/tmp
	$(make_directory)   debian/tmp
	chmod g-s           debian/tmp
	$(make_directory)   debian/tmp/DEBIAN
	$(make_directory)   debian/tmp/$(BINDIR)
	$(make_directory)   debian/tmp/$(MAN1DIR)
	$(make_directory)   debian/tmp/$(DOCDIR)/examples
	$(install_program)  c2man   debian/tmp/$(BINDIR)/c2man
	$(install_file)     c2man.1 debian/tmp/$(MAN1DIR)/c2man.1
	$(install_file)     README     debian/tmp/$(DOCDIR)/README
	$(install_file)     FAQ        debian/tmp/$(DOCDIR)/FAQ
	$(install_file)     CHANGES    debian/tmp/$(DOCDIR)/Changes
	$(install_file)     ChangeLog  debian/tmp/$(DOCDIR)/changelog
	$(install_file)     C++autodoc debian/tmp/$(DOCDIR)/C++autodoc
	$(install_file)     debian/changelog \
                                       debian/tmp/$(DOCDIR)/changelog.Debian
	for i in eg/*[chly];\
	do\
		   $(install_file) $$i \
		   debian/tmp/$(DOCDIR)/examples/`basename $$i`;\
	done;
	gzip -9frq          debian/tmp/$(DOCDIR)/
	gzip -9fqr          debian/tmp/$(MAN1DIR)
# Make sure the copyright file is not compressed
	$(install_file)     debian/copyright \
                            debian/tmp/$(DOCDIR)/copyright
	$(install_program)  debian/postinst  debian/tmp/DEBIAN
	$(install_program)  debian/prerm     debian/tmp/DEBIAN
	dpkg-shlibdeps      debian/tmp/$(BINDIR)/c2man
	dpkg-gencontrol     -isp
	dpkg --build        debian/tmp ..

checkroot:
	test $$(id | sed -e 's/(.*$$//' -e 's/^uid=//') || \
		(echo need root priviledges; exit 1)

define checkdir
	test -f  c2man.c -a -f debian/rules
endef

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


.PHONY: binary binary-arch binary-indep clean