blob: 12cbb61c22dfa2938cbe72210b7c4ae444c9a90f [file] [log] [blame]
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001## -*- text -*- ####################################################
2# #
3# Makefile for the GNU Glob Library. #
4# #
5####################################################################
Jari Aaltobb706242000-03-17 21:46:59 +00006#
Jari Aalto31859422009-01-12 13:36:28 +00007# Copyright (C) 1996-2009 Free Software Foundation, Inc.
Jari Aaltobb706242000-03-17 21:46:59 +00008
Jari Aalto31859422009-01-12 13:36:28 +00009# 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 3 of the License, or
12# (at your option) any later version.
Jari Aaltobb706242000-03-17 21:46:59 +000013
Jari Aalto31859422009-01-12 13:36:28 +000014# 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.
Jari Aaltobb706242000-03-17 21:46:59 +000018
Jari Aalto31859422009-01-12 13:36:28 +000019# 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/>.
Jari Aaltoccc6cda1996-12-23 17:02:34 +000021
22srcdir = @srcdir@
23VPATH = .:@srcdir@
24topdir = @top_srcdir@
25BUILD_DIR = @BUILD_DIR@
26
27INSTALL = @INSTALL@
28INSTALL_PROGRAM = @INSTALL_PROGRAM@
29INSTALL_DATA = @INSTALL_DATA@
30
31CC = @CC@
32RANLIB = @RANLIB@
33AR = @AR@
Jari Aaltob72432f1999-02-19 17:11:39 +000034ARFLAGS = @ARFLAGS@
Jari Aalto06285672006-10-10 14:15:34 +000035RM = rm -f
Jari Aaltoccc6cda1996-12-23 17:02:34 +000036CP = cp
37MV = mv
38
Jari Aaltob72432f1999-02-19 17:11:39 +000039SHELL = @MAKE_SHELL@
40
Jari Aalto7117c2d2002-07-17 14:10:11 +000041PROFILE_FLAGS = @PROFILE_FLAGS@
42
Jari Aaltoccc6cda1996-12-23 17:02:34 +000043CFLAGS = @CFLAGS@
44LOCAL_CFLAGS = @LOCAL_CFLAGS@
45CPPFLAGS = @CPPFLAGS@
46LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@
47
48DEFS = @DEFS@
Jari Aaltod166f041997-06-05 14:59:13 +000049LOCAL_DEFS = @LOCAL_DEFS@
Jari Aaltoccc6cda1996-12-23 17:02:34 +000050
Jari Aaltobb706242000-03-17 21:46:59 +000051BASHINCDIR = ${topdir}/include
52
53INCLUDES = -I. -I../.. -I$(topdir) -I$(BASHINCDIR) -I$(topdir)/lib
Jari Aaltoccc6cda1996-12-23 17:02:34 +000054
Jari Aalto7117c2d2002-07-17 14:10:11 +000055CCFLAGS = $(PROFILE_FLAGS) $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) ${INCLUDES} \
56 $(LOCAL_CFLAGS) $(CFLAGS)
Jari Aaltoccc6cda1996-12-23 17:02:34 +000057
58# Here is a rule for making .o files from .c files that doesn't force
59# the type of the machine (like -sun3) into the flags.
60.c.o:
Jari Aalto06285672006-10-10 14:15:34 +000061 $(RM) $@
Jari Aaltoccc6cda1996-12-23 17:02:34 +000062 $(CC) -c $(CCFLAGS) $<
63
64# The name of the library target.
65LIBRARY_NAME = libglob.a
66
67# The C code source files for this library.
Jari Aalto7117c2d2002-07-17 14:10:11 +000068CSOURCES = $(srcdir)/glob.c $(srcdir)/strmatch.c $(srcdir)/smatch.c \
69 $(srcdir)/xmbsrtowcs.c
Jari Aaltoccc6cda1996-12-23 17:02:34 +000070
71# The header files for this library.
Jari Aaltof73dda02001-11-13 17:56:06 +000072HSOURCES = $(srcdir)/strmatch.h
Jari Aaltoccc6cda1996-12-23 17:02:34 +000073
Chet Ramey495aee42011-11-22 19:11:26 -050074OBJECTS = glob.o strmatch.o smatch.o xmbsrtowcs.o gmisc.o
Jari Aaltoccc6cda1996-12-23 17:02:34 +000075
76# The texinfo files which document this library.
77DOCSOURCE = doc/glob.texi
78DOCOBJECT = doc/glob.dvi
79DOCSUPPORT = doc/Makefile
80DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
81
82SUPPORT = Makefile ChangeLog $(DOCSUPPORT)
83
84SOURCES = $(CSOURCES) $(HSOURCES) $(DOCSOURCE)
85
86THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
87
88######################################################################
89
90all: $(LIBRARY_NAME)
91
92$(LIBRARY_NAME): $(OBJECTS)
93 $(RM) -f $@
Jari Aaltob72432f1999-02-19 17:11:39 +000094 $(AR) $(ARFLAGS) $@ $(OBJECTS)
Jari Aaltoccc6cda1996-12-23 17:02:34 +000095 -test -n "$(RANLIB)" && $(RANLIB) $@
96
97what-tar:
98 @for file in $(THINGS_TO_TAR); do \
99 echo $(selfdir)$$file; \
100 done
101
102documentation: force
103 -(cd doc; $(MAKE) $(MFLAGS))
104force:
105
106# The rule for 'includes' is written funny so that the if statement
107# always returns TRUE unless there really was an error installing the
108# include files.
109install:
110
111clean:
112 rm -f $(OBJECTS) $(LIBRARY_NAME)
113 -(cd doc && $(MAKE) $(MFLAGS) $@ )
114
115realclean distclean maintainer-clean: clean
116 -( cd doc && $(MAKE) $(MFLAGS) $@ )
117 $(RM) -f Makefile
118
119mostlyclean: clean
120 -( cd doc && $(MAKE) $(MFLAGS) $@ )
121
Chet Ramey495aee42011-11-22 19:11:26 -0500122${BUILD_DIR}/pathnames.h: ${BUILD_DIR}/config.h ${BUILD_DIR}/Makefile Makefile
123 -( cd ${BUILD_DIR} && ${MAKE} ${MFLAGS} pathnames.h )
124
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000125######################################################################
126# #
127# Dependencies for the object files which make up this library. #
128# #
129######################################################################
130
Jari Aalto7117c2d2002-07-17 14:10:11 +0000131smatch.o: strmatch.h
132smatch.o: $(BUILD_DIR)/config.h
133smatch.o: $(BASHINCDIR)/chartypes.h
134smatch.o: $(BASHINCDIR)/ansi_stdlib.h $(topdir)/bashansi.h
135smatch.o: $(BASHINCDIR)/shmbutil.h
136smatch.o: $(topdir)/xmalloc.h
137
Jari Aaltof73dda02001-11-13 17:56:06 +0000138strmatch.o: strmatch.h
139strmatch.o: $(BUILD_DIR)/config.h
Jari Aalto7117c2d2002-07-17 14:10:11 +0000140strmatch.o: $(BASHINCDIR)/stdc.h
Jari Aaltod166f041997-06-05 14:59:13 +0000141
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000142glob.o: $(BUILD_DIR)/config.h
Chet Ramey495aee42011-11-22 19:11:26 -0500143glob.o: $(topdir)/shell.h $(BUILD_DIR)/pathnames.h
Jari Aaltobb706242000-03-17 21:46:59 +0000144glob.o: $(topdir)/bashtypes.h $(BASHINCDIR)/ansi_stdlib.h $(topdir)/bashansi.h
145glob.o: $(BASHINCDIR)/posixstat.h $(BASHINCDIR)/memalloc.h
Jari Aalto7117c2d2002-07-17 14:10:11 +0000146glob.o: strmatch.h glob.h
147glob.o: $(BASHINCDIR)/shmbutil.h
148glob.o: $(topdir)/xmalloc.h
149
Chet Ramey495aee42011-11-22 19:11:26 -0500150gmisc.o: $(BUILD_DIR)/config.h
151gmisc.o: $(topdir)/bashtypes.h $(BASHINCDIR)/ansi_stdlib.h $(topdir)/bashansi.h
152gmisc.o: $(BASHINCDIR)/shmbutil.h
153
Jari Aalto7117c2d2002-07-17 14:10:11 +0000154xmbsrtowcs.o: ${BUILD_DIR}/config.h
155xmbsrtowcs.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h
156xmbsrtowcs.o: ${BASHINCDIR}/shmbutil.h
Jari Aaltoe8ce7751997-09-22 20:22:27 +0000157
158# Rules for deficient makes, like SunOS and Solaris
Jari Aaltoe8ce7751997-09-22 20:22:27 +0000159glob.o: glob.c
Chet Ramey495aee42011-11-22 19:11:26 -0500160gmisc.o: gmisc.c
Jari Aalto7117c2d2002-07-17 14:10:11 +0000161strmatch.o: strmatch.c
162smatch.o: smatch.c
163xmbsrtowcs.o: xmbsrtowcs.c
164
165# dependencies for C files that include other C files
166glob.o: glob_loop.c
167smatch.o: sm_loop.c