Debian Codegraph @

AutoConf/makefile.in

raw ◀ ▶
4 Debian patches touch this file
1 # *** makefile ****************************************************************
2 #
3 # This file is part of BibTool.
4 # It is distributed under the GNU General Public License.
5 # See the file COPYING for details.
6 #
7 # (c) 1996-2020 Gerd Neugebauer
8 #
9 # Net: [email protected]
10 #
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2, or (at your option)
14 # any later version.
15 #
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #
25 # *****************************************************************************
26
27 # Look also in the file include/bibtool/config.h for additional
28 # configuration parameters.
29 # Read the file INSTALL for explanation.
30 # =============================================================================
31
32 # This is the generic makefile for BibTool.
33 # Especially it can be used on Unix systems and as a basis for
34 # systems not directly mentioned in the distribution.
35
36 # =============================================================================
37 # Configuration Section
38 # =============================================================================
39 #
40 prefix = @prefix@
41 exec_prefix = @exec_prefix@
42 datadir = @datadir@
43 datarootdir = @datarootdir@
44
45 # -------------------------------------------------------
46 # Prefix to be prepended to all installation directories.
47 # Thus it is possible to install in a different location
48 # as the final location. This seems useful for building
49 # RPMs on Linux.
50
•51 INSTALLPREFIX = $(DESTDIR)
52
53 # -------------------------------------------------------
54 # Destination directory for make install
55 # This is usually a directory where public executables
56 # are installed.
57
58 BINDIR = @bindir@
59
60 # -------------------------------------------------------
61 # Destination directory for make install.man
62 # This is usually a directory where public man pages
63 # are installed.
64 # Additionally name the section of the man pages to use.
65 # This should be 1 (user commands), l (local), or n (new)
66 #
67 MANDIR = @mandir@
68 MANSECT = 1
69
70 # -------------------------------------------------------
71 # Destination directory for make install.lib
72 # This is usually a directory where public shared files
73 # are installed plus a final BibTool.
74 #
75
•76 LIBDIR = @datadir@/bibtool
77
78 #-------------------------------------------------------
79 # Destination directory for make install.include
80 # This is usually a directory where public include files
81 # are installed plus a final `bibtool'.
82 # Note: The include files may contain system specific
83 # code and may not be shared amoung architectures.
84 #
85
86 INCLUDEDIR = @includedir@/bibtool
87
88 # -------------------------------------------------------
89 # Name the C compiler
90 #
91
92 CC = @CC@
93
94 # -------------------------------------------------------
95 # CFLAGS are the flags for the C compiler.
96 # For debugging it should be -g.
97 # For final version you can try to activate
98 # the optimizer with -O or -O2 or whatever
99 # BEWARE: Some C compiler produce erroneous code if the
100 # optimizer is turned on.
101 #
102
•103 CFLAGS = -Wall @CFLAGS@ -Wno-misleading-indentation -Wno-unused-function
104 # CFLAGS = -O
105 # GNU C
106 # CFLAGS = -g -Wall
107 # CFLAGS = -g -Wall -pedantic -Wpointer-arith -Wshadow -Wcast-align
108
109 ##-------------------------------------------------------
110 ## C_INCLUDE are the flags for the C compiler pointing it
111 ## to the location of the header files. Usually this
112 ## does not need any modifications.
113 ##
114
115 C_INCLUDE = -Iinclude
116
117 # -------------------------------------------------------
118 # EXT is the optional extension of the final executable.
119 # Various operating systems have their own ideas about
120 # that.
121 #
122
123 EXT =
124
125 # -------------------------------------------------------
126 # Extension of object files
127 #
128
129 OBJ = .o
130
131 # -------------------------------------------------------
132 # Name some programs
133 #
134 # -------------------------------------------------------
135 # MV is a command to move certain files maybe to other
136 # directories or drives. Only plain files are moved.
137 #
138
139 MV = mv
140
141 # -------------------------------------------------------
142 # RM is a command to remove certain files. It should not
143 # be confused when trying to remove non-existent files.
144 # Only plain files are removed this way.
145 #
146
147 RM = rm -rf
148
149 # -------------------------------------------------------
150 # MAKEDEPEND is a program to find dependencies for
151 # .c and .h files.
152 # Not present on MS-DOS, Atari, Amiga, Next
153
154 MAKEDEPEND = makedepend
155 # MAKEDPEND = gcc -MM
156
157 # -------------------------------------------------------
158 # INSTALL is a program to properly install some files.
159 # Maybe cp should also do this job (on UNIX)
160
161 INSTALL = @INSTALL@
162
163 # -------------------------------------------------------
164 # INSTALL_DATA is a command to install some data files.
165 #
166
167 INSTALL_DATA = @INSTALL_DATA@
168
169 # -------------------------------------------------------
170 # INSTALL_DIR is a command to create a directory if not
171 # already existent. If your install does not support the
172 # -d option you can try to use mkdir instead.
173
•174 INSTALL_DIR = @INSTALL@ -d
175
176 # -------------------------------------------------------
177 # The ranlib program or : for nothing.
178 #
179 RANLIB = @RANLIB@
180
181 # -------------------------------------------------------
182 # The ar program invocation to add files to the archive.
183 #
184 AR = ar r
185
186 # -------------------------------------------------------
187 # PERL is the complete path to an existing perl executable.
188 # Perl 4.* and Perl 5.* are both ok.
189 #
190 PERL = @PERL@
191
192 # -------------------------------------------------------
193 # LINT is a program to check the C source for problems.
194 #
195
196 LINT = lint
197
198 # -------------------------------------------------------
199 # CXREF is a C cross reference program.
200 #
201
202 CXREF = cxref
203
204 # -------------------------------------------------------
•205 # TtH is a [La]TeX to HTML translator program.
206 #
207
208 TTH = tth
209
210 # -------------------------------------------------------
211 # HTML2text is a HTML-to-text converter program.
212 #
213
214 HTML2TEXT = html2text
215
216 # -------------------------------------------------------
217 # PDFLaTeX is a LaTeX composer program.
218 #
219
220 PDFLATEX = pdflatex -no-shell-escape -interaction=batchmode
221
222 # -------------------------------------------------------
223 # Defines to support (non-ANSI) C compilers.
224 # For Solaris 2 you may have to define HAVE_STRING_H
225 # For some versions of Cygwin you may have to define
226 # STD_HEADERS.
227 # For ANSI C compilers they should be empty.
228 # Mostly needed for the GNU regex library.
229 # Include
230 # -DHAVE_STRING_H if your C compiler has string.h
231 # (e.g. on Solaris 2)
232 # Maybe you have to enlarge the
233 # include search path.
234 # -DREGEX_MALLOC if you have NO alloca() library
235 # function
236 # -DHAVE_ALLOCA_H if you need alloca.h for alloca()
237 # -DSTDC_HEADERS if gcc reports conflicting types
238 # for malloc (on Linux?)
239 #
240
241 NON_ANSI_DEFS = @DEFS@
242
243 # -------------------------------------------------------
244 # GNU Regular Expression Library support.
245 # First of all the (sub)directory containing the
246 # necessary files (excluding trailing slash).
•247 #
248 # Debian package uses regex function from glibc:
249
•250 REGEX_DIR =
251 REGEX_DEF = -DREGEX
252 REGEX=
253
254 # -------------------------------------------------------
255 # Kpathsea Library support.
256 # This library provides means to specify a search path
257 # with recursive search in subdirectories.
258 # The library is NOT contained in the BibTool distribution.
259 # This routines are expected to work with Kpathsea-2.6 or
260 # above.
261 #
262 # See the file INSTALL for details.
263 #
264 # Kpathsea is not known to work yet on anything else but
265 # Unix platforms.
266 # This item is purely experimental.
267 # Maybe you are better off not trying it!
268 #
269 # The value of KPATHSEA_DIR is the directory containing
270 # the distribution of kpathsea. I.e. the directory
271 # containing the subdirectory kpathsea.
272 # The value of KPATHSEA is the name of the kpathsea library.
273 # if kpathsea should not be used then it has to be empty.
274 # The value of KPATHSEA_DEF are the additional flags for the
275 # C compiler. It should arrange things that the macro
276 # KPATHSEA is defined and the directory beneath kpathsea
277 # is in the include search path.
278
279 KPATHSEA_DIR = @kpathsea_dir@
280 KPATHSEA = @kpathsea_lib@
281 KPATHSEA_STATIC = @kpathsea_lib_static@
282 KPATHSEA_DEF = @kpathsea_def@
283
284 # -------------------------------------------------------
285 # Default search paths
286 # The values are NULL or a string containing a colon
287 # separated list of directories.
288 # DON'T FORGET THE CURRENT DIRECTORY!
289 #
290 # The character ENV_SEP separates the directories in
291 # environment search paths.
292 #
293
294 BIBINPUTS_DEFAULT = NULL
295 BIBTOOL_DEFAULT = \".:$(LIBDIR)\"
296 ENV_SEP = \":\"
297
298 # -------------------------------------------------------
299 # Declare the file naming conventions.
300 # FILE_TYPES contains optionally a macro definition
301 # determining the file naming conventions.
302 # -DMS-DOS denotes MSDOG-like file names. (Also for Atari)
303 # -DAMIGA denotes the Amiga file names.
304 # The default (empty) are UN*X-like file names.
305 #
306 # DIR_SEP is the directory-file separator.
307
308 FILE_TYPES =
309 DIR_SEP = /
310
311 # =============================================================================
312 # End of Configuration Section
313 # =============================================================================
314
315 MAKEFILE = makefile
316
317 SHELL = /bin/sh
318
319 RSC_DEF = -DRSC_BIBINPUTS_DEFAULT=$(BIBINPUTS_DEFAULT) \
320 -DRSC_BIBTOOL_DEFAULT=$(BIBTOOL_DEFAULT) \
321 -DENV_SEP=$(ENV_SEP)
322
323 DONT_LINK = -c
324 LINK_TO = -o
325 STANDALONE = -DSTANDALONE
326
327 C_FLAGS = $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $(C_INCLUDE) $(FILE_TYPES)
328 LD_FLAGS = $(LDFLAGS)
329
330 CFILES = main.c \
331 $(CLIBFILES)
332 CLIBFILES = check.c \
333 crossref.c \
334 database.c \
335 entry.c \
336 error.c \
337 expand.c \
338 init.c \
339 io.c \
340 key.c \
341 macros.c \
342 names.c \
343 parse.c \
344 print.c \
345 pxfile.c \
346 record.c \
347 rewrite.c \
348 rsc.c \
349 s_parse.c \
350 symbols.c \
351 stack.c \
352 sbuffer.c \
353 tex_aux.c \
354 tex_read.c \
355 type.c \
356 version.c \
357 wordlist.c
358
359 HPATH = include${DIR_SEP}bibtool${DIR_SEP}
360 HFILES = config.h \
361 ${HPATH}check.h \
362 ${HPATH}crossref.h \
363 ${HPATH}database.h \
364 ${HPATH}bibtool.h \
365 ${HPATH}config.h \
366 ${HPATH}entry.h \
367 ${HPATH}error.h \
368 ${HPATH}expand.h \
369 ${HPATH}general.h \
370 ${HPATH}init.h \
371 ${HPATH}io.h \
372 ${HPATH}key.h \
373 ${HPATH}keynode.h \
374 ${HPATH}macros.h \
375 ${HPATH}names.h \
376 ${HPATH}parse.h \
377 ${HPATH}print.h \
378 ${HPATH}pxfile.h \
379 ${HPATH}regex.h \
380 ${HPATH}record.h \
381 ${HPATH}resource.h \
382 ${HPATH}rewrite.h \
383 ${HPATH}rsc.h \
384 ${HPATH}s_parse.h \
385 ${HPATH}sbuffer.h \
386 ${HPATH}stack.h \
387 ${HPATH}symbols.h \
388 ${HPATH}tex_aux.h \
389 ${HPATH}tex_read.h \
390 ${HPATH}type.h \
391 ${HPATH}version.h \
392 ${HPATH}wordlist.h
393
394 OFILES = main$(OBJ) \
395 $(OLIBFILES)
396 OLIBFILES = check$(OBJ) \
397 crossref$(OBJ) \
398 database$(OBJ) \
399 entry$(OBJ) \
400 error$(OBJ) \
401 expand$(OBJ) \
402 init$(OBJ) \
403 io$(OBJ) \
404 key$(OBJ) \
405 macros$(OBJ) \
406 names$(OBJ) \
407 parse$(OBJ) \
408 print$(OBJ) \
409 pxfile$(OBJ) \
410 record$(OBJ) \
411 rewrite$(OBJ) \
412 rsc$(OBJ) \
413 s_parse$(OBJ) \
414 symbols$(OBJ) \
415 stack$(OBJ) \
416 sbuffer$(OBJ) \
417 tex_aux$(OBJ) \
418 tex_read$(OBJ) \
419 type$(OBJ) \
420 version$(OBJ) \
421 wordlist$(OBJ)
422
423 DOCFILES = doc$(DIR_SEP)bibtool.1 \
424 doc$(DIR_SEP)bibtool.tex \
425 doc$(DIR_SEP)bibtool.bib \
426 doc$(DIR_SEP)bibtool.ist \
427 doc$(DIR_SEP)bibtool-doc.sty \
428 doc$(DIR_SEP)ref_card.tex \
429 doc$(DIR_SEP)Makefile \
430 doc$(DIR_SEP)config.tex \
431 doc$(DIR_SEP)c_main.tex \
432 doc$(DIR_SEP)c_lib.tex \
433 doc$(DIR_SEP)c.tex \
434 doc$(DIR_SEP)c_get.pl \
435 doc$(DIR_SEP)make_version.pl
436
437 LIBFILES = lib$(DIR_SEP)biblatex.rsc \
438 lib$(DIR_SEP)braces.rsc \
439 lib$(DIR_SEP)check_y.rsc \
440 lib$(DIR_SEP)default.rsc \
441 lib$(DIR_SEP)field.rsc \
442 lib$(DIR_SEP)improve.rsc \
443 lib$(DIR_SEP)iso2tex.rsc \
444 lib$(DIR_SEP)keep_bibtex.rsc \
445 lib$(DIR_SEP)keep_biblatex.rsc \
446 lib$(DIR_SEP)month.rsc \
447 lib$(DIR_SEP)opt.rsc \
448 lib$(DIR_SEP)sort_fld.rsc \
449 lib$(DIR_SEP)tex_def.rsc
450
451 PROGFILES = Perl$(DIR_SEP)bibtool.pl \
452 Tcl$(DIR_SEP)bibtool.tcl
453 ETCFILES = README.md \
454 install.tex \
455 COPYING \
456 Changes.tex \
457 makefile.unx \
458 makefile.dos \
459 makefile.ata \
460 makefile.ami \
461 ToDo \
462 THANKS \
463 pxfile.man \
464 sbuffer.man \
465 $(MSDOS_targets) \
466 $(PROGFILES)
467
468 DISTFILES = $(ETCFILES) \
469 $(CFILES) \
470 $(HFILES) \
471 $(LIBFILES) \
472 $(DOCFILES) \
473 $(REGEX_DIR)
474 # -----------------------------------------------------------------------------
475 # The main target
476 # -----------------------------------------------------------------------------
477
•478 dh_auto_build_default: default changelog doc
479
480 default all: bibtool$(EXT)
481
482 bibtool$(EXT): $(OFILES) $(REGEX) $(KPATHSEA_STATIC)
483 $(CC) $(LD_FLAGS) $(C_FLAGS) $(LINK_TO) $@ $(OFILES) $(REGEX) $(KPATHSEA) $(KPATHSEA_STATIC)
484
485 tex_read$(EXT): tex_read.c
486 $(CC) $(LD_FLAGS) $(C_FLAGS) $(STANDALONE) tex_read.c $(LINK_TO) tex_read$(EXT)
487
488 tex_aux$(OBJ): tex_aux.c
489 $(CC) $(C_FLAGS) $(REGEX_DEF) $(DONT_LINK) tex_aux.c -o tex_aux$(OBJ)
490
491 main$(OBJ): main.c
492 $(CC) $(C_FLAGS) $(REGEX_DEF) $(KPATHSEA_DEF) $(DONT_LINK) main.c
493
494 init$(OBJ): init.c
495 $(CC) $(C_FLAGS) $(KPATHSEA_DEF) $(DONT_LINK) init.c
496
497 parse$(OBJ): parse.c
498 $(CC) $(C_FLAGS) $(KPATHSEA_DEF) $(DONT_LINK) parse.c -o parse$(OBJ)
499
500 rewrite$(OBJ): rewrite.c
501 $(CC) $(C_FLAGS) $(REGEX_DEF) $(DONT_LINK) rewrite.c -o rewrite$(OBJ)
502
503 rsc$(OBJ): rsc.c
504 $(CC) $(C_FLAGS) $(RSC_DEF) $(DONT_LINK) rsc.c -o rsc$(OBJ)
505
506 .c$(OBJ):
507 $(CC) $(C_FLAGS) $(DONT_LINK) -c $< -o $@
508
•509 Changes.pdf: Changes.tex
510 $(PDFLATEX) $<
511
512 Changes.html: Changes.tex
513 $(TTH) -r -u0 < $< > $@
514
515 Changes.txt: Changes.html
516 $(HTML2TEXT) -ascii $< | \
517 sed \
518 -e 's@BIBTEX@BibTeX@g' \
519 -e 's@LATEX@LaTeX@g' \
520 -e 's@TEX@TeX@g' \
521 -e 's@BIBTOOL@BibTool@g' \
522 -e 's@BIBTCL@BibTcl@g' \
523 > $@
524
525 # __________________________________________________________________
526 # Include the makefile into the dependencies to force updates
527 # when the makefile is modified.
528
529 $(OFILES): $(MAKEFILE)
530
531 # __________________________________________________________________
532 # Targets from the GNU Regular Expression Library.
533
534 regex$(OBJ): $(REGEX_DIR)$(DIR_SEP)regex.c $(MAKEFILE)
535 $(CC) $(C_FLAGS) -I$(REGEX_DIR) -I.. $(NON_ANSI_DEFS) $(REGEX_DIR)$(DIR_SEP)regex.c $(DONT_LINK) -o $@
536
537
538 bibtcl:
539 cd BibTcl && $(MAKE) $(MFLAGS)
540
541 # -----------------------------------------------------------------------------
542 # General development targets
543 # -----------------------------------------------------------------------------
544
545 CLEAN_TARGETS = *$(OBJ) xref *.bak core #* *~
546
547 clean mostlyclean:
548 -cd doc && $(MAKE) $(MFLAGS) clean
549 -cd test && $(MAKE) $(MFLAGS) clean
550 -cd BibTcl && $(MAKE) $(MFLAGS) clean
551 -$(RM) $(CLEAN_TARGETS)
•552 -$(RM) Changes.aux Changes.log
553
554 veryclean distclean realclean extraclean: clean
•555 # -cd BibTcl && $(MAKE) $(MFLAGS) distclean
556 -cd doc && $(MAKE) $(MFLAGS) distclean
557 -cd test && $(MAKE) $(MFLAGS) distclean
558 -$(RM) bibtool config.cache config.status config.log makefile
•559 -cd include/bibtool && $(RM) config.h
560 -$(RM) Changes.pdf Changes.html Changes.txt
561
562 doc: d-o-c
563 d-o-c:
564 cd doc; $(MAKE) $(MFLAGS) DIR_SEP=$(DIR_SEP)
565
566 info:
567
•568 changelog: Changes.pdf Changes.html Changes.txt
569
570 test check: Test
571 Test:
572 (cd test; $(MAKE))
573
574 libbibtool.a: $(OLIBFILES)
575 $(AR) $@ $(OLIBFILES) regex.o
576 $(RANLIB) $@
577
578 depend:
579 -$(MAKEDEPEND) -fmakefile -DMAKEDEPEND -Iinclude $(CFILES)
580
581 install: install.bin install.lib
582
583 install.bin install-exec: bibtool$(EXT)
584 -$(INSTALL_DIR) $(INSTALLPREFIX)$(BINDIR)
585 $(INSTALL) bibtool$(EXT) $(INSTALLPREFIX)$(BINDIR)
586
587 INSTALL_LIB_FILES = lib$(DIR_SEP)*.*
588
589 install.lib install-data:
590 -$(INSTALL_DIR) $(INSTALLPREFIX)$(LIBDIR)
591 for lib in $(INSTALL_LIB_FILES); do \
592 $(INSTALL_DATA) $$lib $(INSTALLPREFIX)$(LIBDIR); \
593 done
594
595 INSTALL_INCLUDE_FILES = $(HFILES)
596
597 install.include install-include:
598 -$(INSTALL_DIR) $(INSTALLPREFIX)$(INCLUDEDIR)
599 for inc in $(INSTALL_INCLUDE_FILES); do \
600 $(INSTALL_DATA) $$inc $(INSTALLPREFIX)$(INCLUDEDIR); \
601 done
602
603 install.man install-man:
604 -$(INSTALL_DIR) $(INSTALLPREFIX)$(MANDIR)$(DIR_SEP)man$(MANSECT)
605 $(INSTALL) doc$(DIR_SEP)bibtool.1 \
606 $(INSTALLPREFIX)$(MANDIR)$(DIR_SEP)man$(MANSECT)$(DIR_SEP)bibtool.$(MANSECT)
607
608 uninstall: uninstall.bin uninstall.lib
609
610 uninstall.bin uninstall-exec:
611 -$(RM) $(INSTALLPREFIX)$(BINDIR)$(DIR_SEP)bibtool$(EXT)
612
613 uninstall.lib uninstall-data:
614 -$(RM) $(INSTALLPREFIX)$(LIBDIR)
615
616 uninstall.include uninstall-include:
617 -$(RM) $(INSTALLPREFIX)$(INCLUDEDIR)
618
619 uninstall.man uninstall-man:
620 -$(RM) $(INSTALLPREFIX)$(MANDIR)$(DIR_SEP)man$(MANSECT)$(DIR_SEP)bibtool.$(MANSECT)
621
622 status:
623 @echo $(LIBDIR)
624
625 # =============================================================================
626 # DO NOT DELETE THIS LINE -- make depend depends on it.