Debian Codegraph @

Makefile

raw symbols SCIP
1 #!/usr/bin/make -f
2 #
3 # Copyright information
4 #
5 # Copyright (C) 2002-2025 Jari Aalto
6 #
7 # License
8 #
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22 ifneq (,)
23 This makefile requires GNU Make.
24 endif
25
26 PACKAGE = copyright-update
27 DESTDIR =
28 prefix = /usr
29 exec_prefix = $(prefix)
30 man_prefix = $(prefix)/share
31 mandir = $(man_prefix)/man
32 bindir = $(exec_prefix)/bin
33 sharedir = $(prefix)/share
34
35 BINDIR = $(DESTDIR)$(bindir)
36 DOCDIR = $(DESTDIR)$(sharedir)/doc/$(PACKAGE)
37 LOCALEDIR = $(DESTDIR)$(sharedir)/locale
38 SHAREDIR = $(DESTDIR)$(sharedir)/$(PACKAGE)
39 LIBDIR = $(DESTDIR)$(prefix)/lib/$(PACKAGE)
40 SBINDIR = $(DESTDIR)$(exec_prefix)/sbin
41 ETCDIR = $(DESTDIR)/etc/$(PACKAGE)
42
43 # 1 = regular, 5 = conf, 6 = games, 8 = daemons
44 MANDIR = $(DESTDIR)$(mandir)
45 MANDIR1 = $(MANDIR)/man1
46 MANDIR5 = $(MANDIR)/man5
47 MANDIR6 = $(MANDIR)/man6
48 MANDIR8 = $(MANDIR)/man8
49
50 TAR = tar
51 TAR_OPT_NO = --exclude='.build' \
52 --exclude='.sinst' \
53 --exclude='.inst' \
54 --exclude='tmp' \
55 --exclude='*.bak' \
56 --exclude='*[~\#]' \
57 --exclude='.\#*' \
58 --exclude='CVS' \
59 --exclude='.svn' \
60 --exclude='.git' \
61 --exclude='.bzr' \
62 --exclude='*.tar*' \
63 --exclude='*.tgz'
64
65 INSTALL = /usr/bin/install
66 INSTALL_BIN = $(INSTALL) -m 755
67 INSTALL_DATA = $(INSTALL) -m 644
68 INSTALL_SUID = $(INSTALL) -m 4755
69
70 DIST_DIR = ../build-area
71 DATE = `date +"%Y.%m%d"`
72 VERSION = $(DATE)
73 RELEASE = $(PACKAGE)-$(VERSION)
74
75 BIN = $(PACKAGE)
76 PL_SCRIPT = bin/$(BIN).pl
77
78 INSTALL_OBJS_BIN = $(PL_SCRIPT)
79 INSTALL_OBJS_DOC = README COPYING
80 INSTALL_OBJS_MAN = bin/*.1
81
82 all:
83 @echo "Nothing to compile."
84 @echo "Try 'make help' or 'make -n DESTDIR= prefix=/usr/local install'"
85
86 # Rule: help - display Makefile rules
87 help:
88 @grep "^# Rule:" Makefile | sort
89
90 # Rule: clean - remove temporary files
91 clean:
92 # clean
93 -rm -f *[#~] *.\#* \
94 *.x~~ pod*.tmp
95
96 rm -rf tmp
97
98 distclean: clean
99
100 realclean: clean
101
102 dist-git: test doc
103 rm -f $(DIST_DIR)/$(RELEASE)*
104 mkdir -p $(DIST_DIR)
105
106 git archive --format=tar --prefix=$(RELEASE)/ master | \
107 gzip --best > $(DIST_DIR)/$(RELEASE).tar.gz
108
109 chmod 644 $(DIST_DIR)/$(RELEASE).tar.gz
110
111 tar -tvf $(DIST_DIR)/$(RELEASE).tar.gz | sort -k 5
112 ls -la $(DIST_DIR)/$(RELEASE).tar.gz
113
114 # The "gt" is maintainer's program frontend to Git
115 # Rule: dist-snap - [maintainer] release snapshot from Git repository
116 dist-snap: test doc
117 @echo gt tar -q -z -p $(PACKAGE) -c -D master
118
119 # Rule: dist-git - [maintainer] release from Git repository
120 dist: dist-git
121
122 # Rule: dist-ls - [maintainer] List release files in achive
123 dist-ls:
124 @ls -1tr $(DIST_DIR)/$(PACKAGE)*
125
126 # Rule: dist - [maintainer] list of release files
127 ls: dist-ls
128
129 bin/$(PACKAGE).1: $(PL_SCRIPT)
130 $(PERL) $< --help-man > $@
131 @-rm -f *.x~~ pod*.tmp
132
133 doc/manual/$(PACKAGE).html: $(PL_SCRIPT)
134 $(PERL) $< --help-html > $@
135 @-rm -f *.x~~ pod*.tmp
136
137 doc/manual/$(PACKAGE).txt: $(PL_SCRIPT)
138 $(PERL) $< --help > $@
139 @-rm -f *.x~~ pod*.tmp
140
141 doc/conversion/index.html: doc/conversion/index.txt
142 perl -S t2html.pl --Auto-detect --Out --print-url $<
143
144 # Rule: man - Generate or update manual page
145 man: bin/$(PACKAGE).1
146
147 html: doc/manual/$(PACKAGE).html
148
149 txt: doc/manual/$(PACKAGE).txt
150
151 # Rule: doc - Generate or update all documentation
152 doc: man html txt
153
154 # Rule: perl-test - Check program syntax
155 perl-test:
156 # perl-test - Check syntax
157 perl -cw $(PL_SCRIPT)
158 podchecker $(PL_SCRIPT)
159
160 # Rule: test - Run tests
161 test: perl-test
162
163 install-doc:
164 # Rule install-doc - Install documentation
165 $(INSTALL_BIN) -d $(DOCDIR)
166
167 [ ! "$(INSTALL_OBJS_DOC)" ] || \
168 $(INSTALL_DATA) $(INSTALL_OBJS_DOC) $(DOCDIR)
169
170 $(TAR) -C doc $(TAR_OPT_NO) --create --file=- . | \
171 $(TAR) -C $(DOCDIR) --extract --file=-
172
173 install-man: man
174 # install-man - Install manual pages
175 $(INSTALL_BIN) -d $(MANDIR1)
176 $(INSTALL_DATA) $(INSTALL_OBJS_MAN) $(MANDIR1)
177
178 install-bin:
179 # install-bin - Install programs
180 $(INSTALL_BIN) -d $(BINDIR)
181 for f in $(INSTALL_OBJS_BIN); \
182 do \
183 dest=$$(basename $$f | sed -e 's/\.pl$$//' -e 's/\.py$$//' ); \
184 $(INSTALL_BIN) $$f $(BINDIR)/$$dest; \
185 done
186
187 # Rule: install - Standard install
188 install: install-bin install-man install-doc
189
190 # Rule: install-test - for Maintainer only
191 install-test:
192 rm -rf tmp
193 make DESTDIR=`pwd`/tmp prefix=/usr install
194 find tmp | sort
195
196 .PHONY: clean distclean realclean
197 .PHONY: install install-bin install-man
198 .PHONY: all man doc test install-test perl-test
199 .PHONY: dist dist-git dist-ls ls
200
201 # End of file