home *** CD-ROM | disk | FTP | other *** search
- # -*-Fun-*-
- # Makefile for GNU e?grep
- # Modified for Turbo C by J Segrave 23:56:06 Fri Nov 23 1990
-
- # To use GLOBARGV.LIB (GNU globbing)
- GLOB_FLAG=-DGNU_GLOBBING
- GLOB_LIB=globargv.lib
- # To include negating options (-H, -N, -I)
- NEG_OPTS=-DNEG_OPTS
- # To include detailed help
- BIG_HELP=-DBIG_HELP
- # To include GREP_OPTS environment variable
- GREP_OPTS=-DGREP_OPTS
- # To make underscore part of a word
- UNDER_WORD=-DUNDER_WORD
- # To allow run time globbing control
- GLOB_CONTROL=-DGLOB_CONTROL
- # To suppress globbing and get argument list from environment
- MKSARGS=-DMKSARGS
- # Add -DUSG for System V.
- # Build Turbo C configuration file (to keep command lines short)
-
- MODEL=c
-
- CFLAGS = -m$(MODEL) -DUSG -Z -O -K- -v -N -w -w-stv
- # -mc compact model
- # -K- default is signed char
- # -v debugging info
- # -Z optimise register usage
- # -O optimise jumps
- # -N generate stack checks
- # -w all warnings
- # -w-stv disable warning on structure passed by value
-
- LDFLAGS=-ms
- LIBDIR=c:\tc\lib
- LIBS=$(GLOB_LIB) + $(LIBDIR)\cc.lib
-
- CC=tcc
-
- # You may add getopt.o if your C library lacks getopt(); note that
- # 4.3BSD getopt() is said to be somewhat broken.
- #
- # Add alloca.o if your machine does not support alloca().
- #
- OBJS = dfa.obj regex.obj getopt.obj tcgrep.obj alloca.obj
- GOBJ = grep.obj
- EOBJ = egrep.obj
-
- all: egrep.exe grep.exe
-
- egrep.exe: $(OBJS) $(EOBJ) $(GLOB_LIB)
- tlink @egrep.lnk
- tdstrip -s egrep
-
- egrep.obj: grep.c dfa.h regex.h turboc.cfg msdosmac.h
- $(CC) $(CFLAGS) -DEGREP -o$* -c grep.c
-
- grep.obj: grep.c dfa.h regex.h turboc.cfg msdosmac.h
- $(CC) $(CFLAGS) -o$* -c grep.c
-
- grep.exe: $(OBJS) $(GOBJ) $(GLOB_LIB)
- tlink @grep.lnk
- tdstrip -s grep
-
- # Compile regex.c with enhancements for matching `$' with `\r\n' sequences.
- regex.obj: regex.c regex.h turboc.cfg
- $(CC) $(CFLAGS) -DDOLLARS_MATCH_CRLF -c $*
-
- ######################################
- # GLOBARGV.LIB (GNU globbing of command line arguments)
-
- # Order is in general significant in GLOB_OBJ
- GLOB_OBJ=globargv.obj glob.obj msd_dir2.obj getwd.obj norm_fil.obj
-
- globargv.lib: $(GLOB_OBJ)
- tlib $* +- globargv.obj +- glob.obj +- msd_dir2.obj +- getwd.obj +-norm_fil, nul
-
- msd_dir2.obj: msd_dir.h turboc.cfg
-
- ######################################
-
- getopt.obj: turboc.cfg
- dfa.obj: dfa.h turboc.cfg
- tcgrep.obj: turboc.cfg
- alloca.obj: turboc.cfg
- norm_fil: turboc.cfg
- getwd.obj: turboc.cfg
- glob.obj: turboc.cfg
- globargv.obj: turboc.cfg
-
- # rebuild Turbo C config file if makefile changes
-
- turboc.cfg: makefile
- echo -Ic:\tc\include > turboc.cfg
- echo $(GLOB_FLAG) >> turboc.cfg
- echo -DMSDOS >> turboc.cfg
- echo $(NEG_OPTS) >> turboc.cfg
- echo $(BIG_HELP) >> turboc.cfg
- echo $(GREP_OPTS) >> turboc.cfg
- echo $(UNDER_WORD) >> turboc.cfg
- echo $(MKSARGS) >> turboc.cfg
- echo $(GLOB_CONTROL) >> turboc.cfg
-
- .c.obj:
- $(CC) $(CFLAGS) -DDOLLARS_MATCH_CRLF -c $*
-
-