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@
43 LOCAL_CFLAGS = @LOCAL_CFLAGS@
45 LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@
48 LOCAL_DEFS = @LOCAL_DEFS@
50 BASHINCDIR = ${topdir}/include
52 INCLUDES = -I. -I../.. -I$(topdir) -I$(BASHINCDIR) -I$(topdir)/lib
54 CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) ${INCLUDES} $(LOCAL_CFLAGS) $(CFLAGS)
56 # Here is a rule for making .o files from .c files that doesn't force
57 # the type of the machine (like -sun3) into the flags.
59 $(CC) -c $(CCFLAGS) $<
61 # The name of the library target.
62 LIBRARY_NAME = libglob.a
64 # The C code source files for this library.
65 CSOURCES = $(srcdir)/glob.c $(srcdir)/strmatch.c
67 # The header files for this library.
68 HSOURCES = $(srcdir)/strmatch.h
70 OBJECTS = glob.o strmatch.o
72 # The texinfo files which document this library.
73 DOCSOURCE = doc/glob.texi
74 DOCOBJECT = doc/glob.dvi
75 DOCSUPPORT = doc/Makefile
76 DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
78 SUPPORT = Makefile ChangeLog $(DOCSUPPORT)
80 SOURCES = $(CSOURCES) $(HSOURCES) $(DOCSOURCE)
82 THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
84 ######################################################################
88 $(LIBRARY_NAME): $(OBJECTS)
90 $(AR) $(ARFLAGS) $@ $(OBJECTS)
91 -test -n "$(RANLIB)" && $(RANLIB) $@
94 @for file in $(THINGS_TO_TAR); do \
95 echo $(selfdir)$$file; \
99 -(cd doc; $(MAKE) $(MFLAGS))
102 # The rule for 'includes' is written funny so that the if statement
103 # always returns TRUE unless there really was an error installing the
108 rm -f $(OBJECTS) $(LIBRARY_NAME)
109 -(cd doc && $(MAKE) $(MFLAGS) $@ )
111 realclean distclean maintainer-clean: clean
112 -( cd doc && $(MAKE) $(MFLAGS) $@ )
116 -( cd doc && $(MAKE) $(MFLAGS) $@ )
118 ######################################################################
120 # Dependencies for the object files which make up this library. #
122 ######################################################################
124 strmatch.o: strmatch.h
125 strmatch.o: $(BUILD_DIR)/config.h
126 strmatch.o: $(BASHINCDIR)/chartypes.h
128 glob.o: $(BUILD_DIR)/config.h
129 glob.o: $(topdir)/bashtypes.h $(BASHINCDIR)/ansi_stdlib.h $(topdir)/bashansi.h
130 glob.o: $(BASHINCDIR)/posixstat.h $(BASHINCDIR)/memalloc.h
133 # Rules for deficient makes, like SunOS and Solaris
134 strmatch.o: strmatch.c