1 ## -*- text -*- ####################################################
3 # Makefile for the GNU Glob Library. #
5 ####################################################################
7 # Copyright (C) 1996 Free Software Foundation, Inc.
9 # 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 2, or (at your option)
14 # 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.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
26 BUILD_DIR = @BUILD_DIR@
29 INSTALL_PROGRAM = @INSTALL_PROGRAM@
30 INSTALL_DATA = @INSTALL_DATA@
42 PROFILE_FLAGS = @PROFILE_FLAGS@
45 LOCAL_CFLAGS = @LOCAL_CFLAGS@
47 LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@
50 LOCAL_DEFS = @LOCAL_DEFS@
52 BASHINCDIR = ${topdir}/include
54 INCLUDES = -I. -I../.. -I$(topdir) -I$(BASHINCDIR) -I$(topdir)/lib
56 CCFLAGS = $(PROFILE_FLAGS) $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) ${INCLUDES} \
57 $(LOCAL_CFLAGS) $(CFLAGS)
59 # Here is a rule for making .o files from .c files that doesn't force
60 # the type of the machine (like -sun3) into the flags.
62 $(CC) -c $(CCFLAGS) $<
64 # The name of the library target.
65 LIBRARY_NAME = libglob.a
67 # The C code source files for this library.
68 CSOURCES = $(srcdir)/glob.c $(srcdir)/strmatch.c $(srcdir)/smatch.c \
69 $(srcdir)/xmbsrtowcs.c
71 # The header files for this library.
72 HSOURCES = $(srcdir)/strmatch.h
74 OBJECTS = glob.o strmatch.o smatch.o xmbsrtowcs.o
76 # The texinfo files which document this library.
77 DOCSOURCE = doc/glob.texi
78 DOCOBJECT = doc/glob.dvi
79 DOCSUPPORT = doc/Makefile
80 DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
82 SUPPORT = Makefile ChangeLog $(DOCSUPPORT)
84 SOURCES = $(CSOURCES) $(HSOURCES) $(DOCSOURCE)
86 THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
88 ######################################################################
92 $(LIBRARY_NAME): $(OBJECTS)
94 $(AR) $(ARFLAGS) $@ $(OBJECTS)
95 -test -n "$(RANLIB)" && $(RANLIB) $@
98 @for file in $(THINGS_TO_TAR); do \
99 echo $(selfdir)$$file; \
103 -(cd doc; $(MAKE) $(MFLAGS))
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
112 rm -f $(OBJECTS) $(LIBRARY_NAME)
113 -(cd doc && $(MAKE) $(MFLAGS) $@ )
115 realclean distclean maintainer-clean: clean
116 -( cd doc && $(MAKE) $(MFLAGS) $@ )
120 -( cd doc && $(MAKE) $(MFLAGS) $@ )
122 ######################################################################
124 # Dependencies for the object files which make up this library. #
126 ######################################################################
129 smatch.o: $(BUILD_DIR)/config.h
130 smatch.o: $(BASHINCDIR)/chartypes.h
131 smatch.o: $(BASHINCDIR)/ansi_stdlib.h $(topdir)/bashansi.h
132 smatch.o: $(BASHINCDIR)/shmbutil.h
133 smatch.o: $(topdir)/xmalloc.h
135 strmatch.o: strmatch.h
136 strmatch.o: $(BUILD_DIR)/config.h
137 strmatch.o: $(BASHINCDIR)/stdc.h
139 glob.o: $(BUILD_DIR)/config.h
140 glob.o: $(topdir)/bashtypes.h $(BASHINCDIR)/ansi_stdlib.h $(topdir)/bashansi.h
141 glob.o: $(BASHINCDIR)/posixstat.h $(BASHINCDIR)/memalloc.h
142 glob.o: strmatch.h glob.h
143 glob.o: $(BASHINCDIR)/shmbutil.h
144 glob.o: $(topdir)/xmalloc.h
146 xmbsrtowcs.o: ${BUILD_DIR}/config.h
147 xmbsrtowcs.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h
148 xmbsrtowcs.o: ${BASHINCDIR}/shmbutil.h
150 # Rules for deficient makes, like SunOS and Solaris
152 strmatch.o: strmatch.c
154 xmbsrtowcs.o: xmbsrtowcs.c
156 # dependencies for C files that include other C files