File: makefile.dos

package info (click to toggle)
bibtool 2.48alpha.2-4
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,208 kB
  • ctags: 1,973
  • sloc: ansic: 18,936; xml: 1,036; makefile: 671; sh: 293; perl: 261; tcl: 51; awk: 15; sed: 8
file content (570 lines) | stat: -rw-r--r-- 16,662 bytes parent folder | download | duplicates (3)
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
# *****************************************************************************
#  $Id: Makefile,v 2.36 1994/12/11 18:48:54 gerd Exp gerd $
# =============================================================================
#  
#  This file is part of BibTool.
#  It is distributed under the GNU General Public License.
#  See the file COPYING for details.
#  
#  (c) 1996-2004 Gerd Neugebauer
#  
#  Net: gene@gerd-neugebauer.de
#  
# *****************************************************************************

#  Look also in the file include/bibtool/config.h for additional
#  configuration parameters.
#  Read the file INSTALL for explanation.
# =============================================================================

#  This is the makefile for BibTool on MSDOS like computers.
#  This means for machines running MSDOS, OS/2, Windows, WindowsNT
#  For Linux you should take the file makefile.unx.

# =============================================================================
#  Configuration Section
# =============================================================================
# 
# -------------------------------------------------------
#  Destination directory for make install
#  This is usually a directory where public executables
#  are installed.

BINDIR     = c:\\emtex\\bin

# -------------------------------------------------------
#  Destination directory for make install.lib
#  This is usually a directory where public shared files
#  are installed plus a final BibTool.
# 

LIBDIR     = c:\\emtex\\bibtool

# -------------------------------------------------------
#  Destination directory for make install.include
#  This is usually a directory where public include files
#  are installed plus a final `BibTool'.
# 

INCLUDEDIR = c:\\emtex\\bibtool\\include\\bibtool

# -------------------------------------------------------
#  Name the C compiler
# 

CC         = gcc
#  Watcom (MSDOS)
# CC       = wcl386 /p
# CC       = wcl386
#  MSC (MSDOS)
# CC       = cl

# -------------------------------------------------------
#  CFLAGS are the flags for the C compiler.
#  For debugging it should be -g. 
#  For final version you can try to activate 
#  the optimizer with -O or -O2 or whatever
#  BEWARE: Some C compiler produce erroneous code if the
# 	   optimizer is turned on.
# 

CFLAGS  =
#  Watcom (MSDOS)
# CFLAGS  = -ox
# CFLAGS  = -d2 -w3
#  MSC (MSDOS)
#  The include path is missing since I don't know the approriate switch (yet)
# CFLAGS  =/AL /Zi /Zd /W4 /D__STDC__
# CFLAGS  =/AL /Zi /Zd /D__STDC__
# CFLAGS  =/AL /D__STDC__
# CFLAGS  =/AL /Ox /D__STDC__

# -------------------------------------------------------
#  C_INCLUDE are the flags for the C compiler pointing it
#  to the location of the header files. Usually this
#  does not need any modifications.
# 

C_INCLUDE  = -Iinclude
#  Watcom (MSDOS)
# C_INCLUDE  = -Iinclude
#  MSC (MSDOS)
#  The include path is missing since I don't know the approriate switch (yet)
# C_INCLUDE = 

# -------------------------------------------------------
#  EXT is the optional extension of the final executable.
#  Various Operating Systems have their own ideas about
#  that.
# 

EXT		= .exe
#  Additionally you can select the compiler to use.
# For MS/DOS computer (emx Compiler)
# EXT		= .emx
# For MS/DOS computer (dj Compiler)
# EXT		= .dj
# Watcom C 386 (DOS, OS/2, NT)
# EXT		= .wat
# Microsoft C 6.00A (DOS, OS/2)
# EXT		= .msc

# -------------------------------------------------------
#  Extension of object files
# 

#  Change this to .o for the dj/emx compiler.
OBJ		= .obj

# -------------------------------------------------------
#  Name some programs
# 
#  MV is a command to move certain files maybe to other
#  directories or drives. Only plain files are moved.

MV		= mv

#  RM is a command to remove certain files. It should not
#  be confused when trying to remove non-existent files.
#  Only plain files are removed.

RM		= del

# 
#  MAKEDEPEND is a program to find dependencies for
#  .c and .h files.
#  Not present on MSDOS, Atari, Amiga, Next
MAKEDEPEND	= makedepend
# MAKEDEPEND	= gcc -MM
# 
#  INSTALL is a program to properly install some executable files.
#  Maybe cp should also do this job (on Unix)

INSTALL		= copy

# 
#  INSTALL_DATA is a command to install some data files.

INSTALL_DATA	= copy

# 
#  INSTALL_DIR is a command to create a directory if not
#  already existent. If your install does not support the 
#  -d option you can try to use mkdir instead.

INSTALL_DIR	= mkdir

#  -------------------------------------------------------
#  The ranlib program or : for nothing.
# 
RANLIB	        = ranlib

#  -------------------------------------------------------
#  The ar program invocation to add files to the archive.
# 
AR		= ar r

# 
#  PERL is the complet path to an existing perl executable.
#  Perl 4.* and Perl 5.* are both ok.
# 
PERL	      = /usr/local/bin/perl

# -------------------------------------------------------
#  Defines to support (non-ANSI) C compilers.
#  For Solaris 2 you may have to define HAVE_STRING_H
#  For ANSI C compilers they should be empty.
#  Mostly needed for the GNU regex library.
#  Include
#  -DHAVE_STRING_H	if your C compiler has string.h
# 			(e.g. on Solaris 2)
# 			Maybe you have to enlarge the
# 			include search path.
#  -DREGEX_MALLOC	if you have NO alloca() library
# 			function
#  -DHAVE_ALLOCA_H	if you need alloca.h for alloca()
# 
#  -DHAVE_CONFIG_H	if you want to use the file REGEX_DIR/config.h
# 			this file has to be created then.
# 

NON_ANSI_DEFS = -Dconst=  -DREGEX_MALLOC -DHAVE_STRING_H

# -------------------------------------------------------
#  GNU Regular Expression Library support.
#  First of all the (sub)directory containing the 
#  necessary files (excluding trailing slash).
# 
#  This directory is contained in the BibTool distribution.
#  I have tried newer versions of this library without
#  positive results. (Try it if you don't believe me:-)
# 
REGEX_DIR     = regex-0.12
# 

REGEX_DEF     = -DREGEX -I$(REGEX_DIR)

REGEX         = regex$(OBJ)

# -------------------------------------------------------
#  Kpathsea Library support.
#  This library provides means to specify a search path 
#  with recursive search in subdirectories.
#  The library is NOT contained in the BibTool distribution.
#  This routines are expected to work with Kpathsea-2.6 or
#  above.
# 
#  See the file INSTALL for details.
# 
#  Kpathsea is not known to work yet on anything else but
#  Unix platforms.
#  This item is purely experimental.
#  Maybe you are better off not trying it!
# 
#  The value of KPATHSEA_DIR is the directory containing
#  the distribution of kpathsea. I.e. the directory
#  containing the subdirectory kpathsea.
#  The value of KPATHSEA is the name of the kpathsea library.
#  if kpathsea should not be used then it has to be empty.
#  The value of KPATHSEA_DEF are the additional flags for the
#  C compiler. It should arrange things that the macro
#  KPATHSEA is defined and the directory beneath kpathsea
#  is in the include search path.

#  Kpathsea is not known to work with 1 yet.
#  I guess you need to make some modification to the makefile
#  when you try it. (see makefile.unx for an example)
#  If you succeed please drop me a mail.
KPATHSEA_DIR  = ../kpse2-6
KPATHSEA      = 
KPATHSEA_DEF  = 
#  KPATHSEA     = $(KPATHSEA_DIR)/kpathsea/kpathsea.a

# -------------------------------------------------------
#  Default search paths
#  The values are NULL or a string containing a colon
#  separated list of directories.
#  DON'T FORGET THE CURRENT DIRECTORY!
# 
#  The character ENV_SEP separates the directories in
#  environment search paths.
# 

#  >>> Replace all " in the next three lines with \" for the dj/emx compilers.
#  >>> This is also required for ; which has to be replaced by \;
#  >>> Maybe this is also necessary for other compilers.
BIBINPUTS_DEFAULT = ".;c:\\emtex\\bibinput"
BIBTOOL_DEFAULT   = ".;c:\\emtex\\bibtool"
ENV_SEP           = ";"

# -------------------------------------------------------
#  Declare the file naming conventions.
#  FILE_TYPES contains optionally a macro definition
#  determining the file naming conventions.
#  -DMSDOS denotes MSDOG-like file names. (Also for Atari)
#  -DAMIGA denotes the Amiga file names.
#  The default (empty) are UN*X-like file names.
# 
#  DIR_SEP is the directory-file separator.

FILE_TYPES	  = -DMSDOS
DIR_SEP		  = \\

# =============================================================================
#  End of Configuration Section
# =============================================================================

MAKE_FILE      =

RSC_DEF	      = -DRSC_BIBINPUTS_DEFAULT=$(BIBINPUTS_DEFAULT)		\
		-DRSC_BIBTOOL_DEFAULT=$(BIBTOOL_DEFAULT)		\
		-DENV_SEP=$(ENV_SEP)

DONT_LINK     = -c
LINK_TO       = -o
STANDALONE    = -DSTANDALONE

C_FLAGS	      = $(C_INCLUDE) $(CFLAGS) $(FILE_TYPES)

CFILES	      = main.c		\
		$(CLIBFILES)
CLIBFILES     = database.c	\
		entry.c		\
		error.c		\
		expand.c	\
		init.c		\
		key.c		\
		macros.c	\
		names.c		\
		parse.c		\
		print.c		\
		pxfile.c	\
		record.c	\
		rewrite.c	\
		rsc.c		\
		s_parse.c	\
		symbols.c	\
		stack.c		\
		sbuffer.c	\
		tex_aux.c	\
		tex_read.c	\
		version.c	\
		type.c		\
		wordlist.c

HPATH	      = include${DIR_SEP}bibtool${DIR_SEP}
HFILES	      = config.h		\
		${HPATH}database.h	\
		${HPATH}bibtool.h	\
		${HPATH}config.h	\
		${HPATH}entry.h		\
		${HPATH}error.h		\
		${HPATH}expand.h	\
		${HPATH}general.h	\
		${HPATH}init.h		\
		${HPATH}key.h		\
		${HPATH}keynode.h	\
		${HPATH}macros.h	\
		${HPATH}names.h		\
		${HPATH}parse.h		\
		${HPATH}print.h		\
		${HPATH}pxfile.h	\
		${HPATH}record.h	\
		${HPATH}regex.h		\
		${HPATH}resource.h	\
		${HPATH}rewrite.h	\
		${HPATH}rsc.h		\
		${HPATH}s_parse.h	\
		${HPATH}sbuffer.h	\
		${HPATH}stack.h		\
		${HPATH}symbols.h	\
		${HPATH}tex_aux.h	\
		${HPATH}tex_read.h	\
		${HPATH}type.h		\
		${HPATH}version.h	\
		${HPATH}wordlist.h

OFILES	      = main$(OBJ)	\
		$(OLIBFILES)
OLIBFILES     = database$(OBJ)	\
		entry$(OBJ)	\
		error$(OBJ)	\
		expand$(OBJ)	\
		init$(OBJ)	\
		key$(OBJ)	\
		macros$(OBJ)	\
		names$(OBJ)	\
		parse$(OBJ)	\
		print$(OBJ)	\
		pxfile$(OBJ)	\
		record$(OBJ)	\
		rewrite$(OBJ)	\
		rsc$(OBJ)	\
		s_parse$(OBJ)	\
		symbols$(OBJ)	\
		stack$(OBJ)	\
		sbuffer$(OBJ)	\
		tex_aux$(OBJ)	\
		tex_read$(OBJ)	\
		type$(OBJ)	\
		version$(OBJ)	\
		wordlist$(OBJ)

DOCFILES      = Doc$(DIR_SEP)bibtool.1		\
		Doc$(DIR_SEP)bibtool.tex	\
		Doc$(DIR_SEP)bibtool.bib	\
		Doc$(DIR_SEP)bibtool.bbl	\
		Doc$(DIR_SEP)bibtool.aux	\
		Doc$(DIR_SEP)bibtool.ind	\
		Doc$(DIR_SEP)bibtool.idx	\
		Doc$(DIR_SEP)bibtool.ist	\
		Doc$(DIR_SEP)config.tex		\
		Doc$(DIR_SEP)version.tex	\
		Doc$(DIR_SEP)dina4.sty		\
		Doc$(DIR_SEP)ref_card.tex	\
		Doc$(DIR_SEP)Makefile		\
		Doc$(DIR_SEP)c_get.pl		\
		Doc$(DIR_SEP)c_lib.tex

LIBFILES      = Lib$(DIR_SEP)braces.rsc		\
		Lib$(DIR_SEP)check_y.rsc	\
		Lib$(DIR_SEP)default.rsc	\
		Lib$(DIR_SEP)field.rsc		\
		Lib$(DIR_SEP)improve.rsc	\
		Lib$(DIR_SEP)iso2tex.rsc	\
		Lib$(DIR_SEP)month.rsc		\
		Lib$(DIR_SEP)opt.rsc		\
		Lib$(DIR_SEP)sort_fld.rsc	\
		Lib$(DIR_SEP)tex_def.rsc

PROGFILES     = Perl$(DIR_SEP)bibtool.pl	\
		Tcl$(DIR_SEP)bibtool.tcl
ETCFILES      = README				\
		INSTALL				\
		COPYING				\
		Changes.xml			\
		makefile.unx			\
		makefile.dos			\
		makefile.ata			\
		makefile.ami			\
		ToDo				\
		THANKS				\
		pxfile.man			\
		sbuffer.man			\
		Doc$(DIR_SEP)c.tex		\
		Doc$(DIR_SEP)c_main.tex		\
		Doc$(DIR_SEP)c_lib.ind		\
		$(MSDOS_targets)		\
		$(PROGFILES)			\
		$(AUTOCONFFILES)		\
		$(BIBTCLFILES)

AUTOCONFFILES = configure			\
		configure.in			\
		install-sh			\
		mkdirchain			\
		AutoConf$(DIR_SEP)config.h.in	\
		AutoConf$(DIR_SEP)makefile.in	\
		AutoConf$(DIR_SEP)reconfig.h.in

BIBTCLFILES   = BibTcl$(DIR_SEP)Makefile.in	\
		BibTcl$(DIR_SEP)README		\
		BibTcl$(DIR_SEP)bibtool.c	\
		BibTcl$(DIR_SEP)bibtcl.tex	\
		BibTcl$(DIR_SEP)bibtcl.ltx	\
		BibTcl$(DIR_SEP)bibtcl.bib	\
		BibTcl$(DIR_SEP)version.tex	\
		BibTcl$(DIR_SEP)configure.in	\
		BibTcl$(DIR_SEP)configure	\
		BibTcl$(DIR_SEP)dina4.sty	\
		BibTcl$(DIR_SEP)bibtool.ist	\
		BibTcl$(DIR_SEP)main.tcl

DISTFILES     = $(ETCFILES)			\
		$(CFILES)			\
		$(HFILES)			\
		$(LIBFILES)			\
		$(DOCFILES)			\
		$(REGEX_DIR)

# -----------------------------------------------------------------------------
#  The main target
# -----------------------------------------------------------------------------

default all: bibtool$(EXT)

emx: bibtool.emx
bibtool.emx: $(OFILES) $(REGEX) $(KPATHSEA)
	$(CC) $(C_FLAGS) -o bibtool.emx $(OFILES) $(REGEX) $(KPATHSEA)
	emxbind -b -q $(EMXGPP)/bin/emx.exe bibtool.emx bibtool.exe

dj: bibtool.dj
bibtool.exe bibtool.dj: $(OFILES) $(REGEX)  $(KPATHSEA) link.dj
	$(CC) $(C_FLAGS) -o bibtool.exe @link.dj
#  Alternative:
# 	$(CC) $(C_FLAGS) -o bibtool.dj @link.dj
# 	copy /b $(DJGPPDOS)\bin\go32.exe+bibtool.dj bibtool.exe

wat: bibtool.wat
bibtool.wat:  $(OFILES) $(REGEX) $(KPATHSEA) link.wat
	wcl386 /x /fe=bibtool.exe @link.wat

msc: bibtool.msc
bibtool.msc:  $(OFILES) $(REGEX) $(KPATHSEA) link.msc
	link /farcall/noi @link.msc,bibtool.exe,nul,/nod:llibce llibcep;
	bind bibtool.exe
	exehdr /pmtype:windowcompat bibtool.exe

tex_read$(EXT): tex_read.c
	$(CC) $(C_FLAGS) $(STANDALONE) tex_read.c $(LINK_TO) tex_read$(EXT)

tex_aux$(OBJ): tex_aux.c
	$(CC) $(C_FLAGS) $(REGEX_DEF) $(DONT_LINK) tex_aux.c

main$(OBJ): main.c
	$(CC) $(C_FLAGS) $(REGEX_DEF) $(KPATHSEA_DEF) $(DONT_LINK) main.c

init$(OBJ): init.c
	$(CC) $(C_FLAGS) $(KPATHSEA_DEF) $(DONT_LINK) init.c

parse$(OBJ): parse.c
	$(CC) $(C_FLAGS) $(KPATHSEA_DEF) $(DONT_LINK) parse.c

rewrite$(OBJ): rewrite.c
	$(CC) $(C_FLAGS) $(REGEX_DEF) $(DONT_LINK) rewrite.c

rsc$(OBJ): rsc.c
	$(CC) $(C_FLAGS) $(RSC_DEF) $(DONT_LINK) rsc.c

.c$(OBJ):
	$(CC) $(C_FLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@

# __________________________________________________________________
#  Include the makefile into the dependencies to force updates
#  when the makefile is modified.
$(OFILES): $(MAKE_FILE)

# __________________________________________________________________
#  Targets from the GNU Regular Expression Library.

regex$(OBJ): $(REGEX_DIR)$(DIR_SEP)regex.c $(MAKE_FILE)
	$(CC) $(C_FLAGS) -I$(REGEX_DIR) $(NON_ANSI_DEFS) $(REGEX_DIR)$(DIR_SEP)regex.c $(DONT_LINK) -o $@

# -----------------------------------------------------------------------------
#  General development targets
# -----------------------------------------------------------------------------

CLEAN_TARGETS	= *$(OBJ) *.bak

clean:
	-$(RM) $(CLEAN_TARGETS)

veryclean: clean
	-$(RM) bibtool

# -------------------------------------------------------
#  Some support for MSDOS-like computers.
.c.obj:
	$(CC) $(C_FLAGS) -c $<
.c.o:
	$(CC) $(C_FLAGS) -c $<

libbib.a: $(OLIBFILES)
	$(AR) $@ $(OLIBFILES) regex.o
	$(RANLIB) $@

install: install.bin install.lib

install.bin: bibtool$(EXT)
	-$(INSTALL_DIR) $(BINDIR)
	$(INSTALL) bibtool$(EXT) $(BINDIR)

INSTALL_LIB_FILES = Lib$(DIR_SEP)*.*

install.lib: 
	-$(INSTALL_DIR) $(LIBDIR)
	$(INSTALL_DATA) $(INSTALL_LIB_FILES) $(LIBDIR)

install.include: 
	-$(INSTALL_DIR) $(INCLUDEDIR)
	$(INSTALL_DATA) $(INSTALL_INCLUDE_FILES) $(INCLUDEDIR)

install.man: 

uninstall.bin:
	-$(RM) $(BINDIR)$(DIR_SEP)bibtool$(EXT)

uninstall.lib:
	-$(RM) $(LIBDIR)

uninstall.include:
	-$(RM) $(INCLUDEDIR)

uninstall.man:

status:
	@echo $(LIBDIR)

# =============================================================================
# DO NOT DELETE THIS LINE -- make depend depends on it.
main.o database.o entry.o error.o expand.o init.o key.o macros.o names.o parse.o print.o pxfile.o record.o rewrite.o rsc.o s_parse.o symbols.o stack.o sbuffer.o tex_aux.o tex_read.o type.o version.o wordlist.o: config.h include/bibtool/database.h include/bibtool/bibtool.h include/bibtool/config.h include/bibtool/entry.h include/bibtool/error.h include/bibtool/expand.h include/bibtool/general.h include/bibtool/init.h include/bibtool/key.h include/bibtool/keynode.h include/bibtool/macros.h include/bibtool/names.h include/bibtool/parse.h include/bibtool/print.h include/bibtool/pxfile.h include/bibtool/record.h include/bibtool/regex.h include/bibtool/resource.h include/bibtool/rewrite.h include/bibtool/rsc.h include/bibtool/s_parse.h include/bibtool/sbuffer.h include/bibtool/stack.h include/bibtool/symbols.h include/bibtool/tex_aux.h include/bibtool/tex_read.h include/bibtool/type.h include/bibtool/version.h include/bibtool/wordlist.h main.c database.c entry.c error.c expand.c init.c key.c macros.c names.c parse.c print.c pxfile.c record.c rewrite.c rsc.c s_parse.c symbols.c stack.c sbuffer.c tex_aux.c tex_read.c version.c type.c wordlist.c