source: vendor/grep/2.12/Makefile.boot@ 3138

Last change on this file since 3138 was 2595, checked in by bird, 13 years ago

gnu grep version 2.12 (grep-2.12.tar.xz, md5sum=8d2f0346d08b13c18afb81f0e8aa1e2f)

File size: 4.7 KB
Line 
1# Copyright 1997-1998, 2005-2012 Free Software Foundation, Inc.
2#
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 3, or (at your option)
6# any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16# Define for DOS/WIN (not including DJGPP):
17#OBJEXT = obj
18#EXEEXT = .exe
19EXEEXT =
20OBJEXT = o
21
22# Source of grep.
23grep_OBJS = \
24 grep.$(OBJEXT) \
25 search.$(OBJEXT) \
26 kwset.$(OBJEXT) \
27 dfa.$(OBJEXT)
28egrep_OBJS = \
29 egrep.$(OBJEXT) \
30 esearch.$(OBJEXT) \
31 kwset.$(OBJEXT) \
32 dfa.$(OBJEXT)
33fgrep_OBJS = \
34 fgrep.$(OBJEXT) \
35 fsearch.$(OBJEXT) \
36 kwset.$(OBJEXT)
37
38# Supporting routines.
39LIB_OBJS_core = \
40 $(libdir)/closeout.$(OBJEXT) \
41 $(libdir)/error.$(OBJEXT) \
42 $(libdir)/exclude.$(OBJEXT) \
43 $(libdir)/hard-locale.$(OBJEXT) \
44 $(libdir)/quotearg.$(OBJEXT) \
45 $(libdir)/regex.$(OBJEXT) \
46 $(libdir)/strtoumax.$(OBJEXT) \
47 $(libdir)/xmalloc.$(OBJEXT) \
48 $(libdir)/xstrtol.$(OBJEXT) \
49 $(libdir)/xstrtoumax.$(OBJEXT)
50
51# Comment out functions already supported as needed.
52#LIB_OBJ_atexit = $(libdir)/atexit.$(OBJEXT)
53#LIB_OBJ_alloca = $(libdir)/alloca.$(OBJEXT)
54#LIB_OBJ_fnmatch = $(libdir)/fnmatch.$(OBJEXT)
55LIB_OBJ_getopt = $(libdir)/getopt.$(OBJEXT) $(libdir)/getopt1.$(OBJEXT)
56#LIB_OBJ_memchr = $(libdir)/memchr.$(OBJEXT)
57LIB_OBJ_obstack = $(libdir)/obstack.$(OBJEXT)
58#LIB_OBJ_strtoul = $(libdir)/strtoul.$(OBJEXT)
59
60LIB_OBJS = $(LIB_OBJS_core) $(LIB_OBJ_atexit) $(LIB_OBJ_alloca) \
61 $(LIB_OBJ_fnmatch) $(LIB_OBJ_getopt) $(LIB_OBJ_memchr) \
62 $(LIB_OBJ_obstack) $(LIB_OBJ_strtoul)
63
64# For Linux
65#LIB_OBJS = $(LIB_OBJS_core)
66
67# For QNX/Neutrino
68#LIB_OBJS = $(LIB_OBJS_core) $(LIB_OBJ_getopt) $(LIB_OBJ_obstack)
69
70# Where is DIR and opendir/readdir defined.
71# or -DHAVE_DIRENT_H
72# or -DHAVE_SYS_NDIR_H
73# or -DHAVE_SYS_DIR_H
74# or -DHAVE_NDIR_H
75#
76# undef HAVE_STRERROR if lacking strerror()
77# undef HAVE_MEMCHR if lacking memchr()
78#
79
80# default dry run
81DEFS_core = \
82 -DSTDC_HEADERS \
83 -DHAVE_MEMCHR \
84 -DHAVE_DIRENT_H \
85 -DHAVE_STRERROR \
86 -Dconst= \
87 -Duintmax_t=long
88
89# SunOS-4.1.x k&r cc
90#DEFS_sunos = -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_DIRENT_H -Dconst=
91
92# Solaris
93#DEFS_solaris = -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_DIRENT_H -DHAVE_STRERROR
94
95# DOS/WIN (change also OBJEXT/EXEEXT, see above)
96# DOS/DJGPP
97DEFS_dos = -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_STRERROR -DHAVE_DIRENT_H \
98 -DHAVE_DOS_FILE_CONTENTS \
99 -DHAVE_DOS_FILE_NAMES -DHAVE_UNISTD_H -DHAVE_SETMODE
100
101# If support ANSI C prototypes
102DEFS_ansi_c = -DPROTOTYPES
103
104# No wchar support
105# DEFS_wchar = -DUSE_WIDE_CHAR -DHAVE_WCHAR_H
106# DEFS_wchar = -Dwchar_t=int -Dmbstate_t=int
107DEFS_wchar = -DHAVE_WCHAR_H
108
109# Are strtol() and strtoul() declared?
110#DEFS_strtol = -DHAVE_DECL_STRTOULL=0 -DHAVE_DECL_STRTOUL=0
111DEFS_strtol = -DHAVE_DECL_STRTOULL=1 -DHAVE_DECL_STRTOUL=1
112
113# Define if malloc(0)/realloc(0) works
114#DEFS_alloc = -DHAVE_DONE_WORKING_MALLOC_CHECK=0 \
115# -DHAVE_DONE_WORKING_REALLOC_CHECK=0
116DEFS_alloc = -DHAVE_DONE_WORKING_MALLOC_CHECK=1 \
117 -DHAVE_DONE_WORKING_REALLOC_CHECK=1
118
119DEFS = $(DEFS_core) $(DEFS_ansi_c) $(DEFS_wchar) $(DEFS_strtol) $(DEFS_alloc) \
120 -DHAVE_DECL_STRERROR_R=1 -DHAVE_VPRINTF -DCHAR_BIT=8 \
121 -DSTDOUT_FILENO=1
122
123
124####
125
126CFLAGS = $(DEFS) -I. -I.. -I$(libdir) \
127 -DVERSION=\"bootstrap\" -DPACKAGE=\"grep\" \
128 -DPACKAGE_STRING=\"grep\ bootstrap\" \
129 -DPACKAGE_BUGREPORT=\"bug-grep@gnu.org\"
130
131libdir = ../lib
132
133PROGS = grep$(EXEEXT) egrep$(EXEEXT) fgrep$(EXEEXT)
134
135libgreputils_a = $(libdir)/libgreputils.a
136
137all : $(libgreputils_a) $(PROGS)
138
139grep$(EXEEXT) : $(grep_OBJS) $(libgreputils_a)
140 $(CC) $(grep_OBJS) -o grep $(libgreputils_a)
141
142egrep$(EXEEXT) : $(egrep_OBJS) $(libgreputils_a)
143 $(CC) $(egrep_OBJS) -o egrep $(libgreputils_a)
144
145fgrep$(EXEEXT) : $(fgrep_OBJS) $(libgreputils_a)
146 $(CC) $(fgrep_OBJS) -o fgrep $(libgreputils_a)
147
148$(libgreputils_a) : $(LIB_OBJS)
149 $(AR) $(ARFLAGS) $(libgreputils_a) $(LIB_OBJS)
150
151clean :
152 $(RM) grep.$(OBJEXT) egrep.$(OBJEXT) fgrep.$(OBJEXT)
153 $(RM) search.$(OBJEXT) esearch.$(OBJEXT) fsearch.$(OBJEXT)
154 $(RM) kwset.$(OBJEXT) dfa.$(OBJEXT)
155 $(RM) $(PROGS)
156 $(RM) $(libgreputils_a) $(LIB_OBJS)
Note: See TracBrowser for help on using the repository browser.