1 ## -*- text -*- ####################################################
3 # Makefile for the GNU Glob Library. #
5 ####################################################################
10 BUILD_DIR = @BUILD_DIR@
13 INSTALL_PROGRAM = @INSTALL_PROGRAM@
14 INSTALL_DATA = @INSTALL_DATA@
27 LOCAL_CFLAGS = @LOCAL_CFLAGS@
29 LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@
32 LOCAL_DEFS = @LOCAL_DEFS@
34 INCLUDES = -I. -I../.. -I$(topdir) -I$(topdir)/lib
36 CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) ${INCLUDES} $(LOCAL_CFLAGS) $(CFLAGS)
38 # Here is a rule for making .o files from .c files that doesn't force
39 # the type of the machine (like -sun3) into the flags.
41 $(CC) -c $(CCFLAGS) $<
43 # The name of the library target.
44 LIBRARY_NAME = libglob.a
46 # The C code source files for this library.
47 CSOURCES = $(srcdir)/glob.c $(srcdir)/fnmatch.c
49 # The header files for this library.
50 HSOURCES = $(srcdir)/fnmatch.h
52 OBJECTS = glob.o fnmatch.o
54 # The texinfo files which document this library.
55 DOCSOURCE = doc/glob.texi
56 DOCOBJECT = doc/glob.dvi
57 DOCSUPPORT = doc/Makefile
58 DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
60 SUPPORT = Makefile ChangeLog $(DOCSUPPORT)
62 SOURCES = $(CSOURCES) $(HSOURCES) $(DOCSOURCE)
64 THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
66 ######################################################################
70 $(LIBRARY_NAME): $(OBJECTS)
72 $(AR) $(ARFLAGS) $@ $(OBJECTS)
73 -test -n "$(RANLIB)" && $(RANLIB) $@
76 @for file in $(THINGS_TO_TAR); do \
77 echo $(selfdir)$$file; \
81 -(cd doc; $(MAKE) $(MFLAGS))
84 # The rule for 'includes' is written funny so that the if statement
85 # always returns TRUE unless there really was an error installing the
90 rm -f $(OBJECTS) $(LIBRARY_NAME)
91 -(cd doc && $(MAKE) $(MFLAGS) $@ )
93 realclean distclean maintainer-clean: clean
94 -( cd doc && $(MAKE) $(MFLAGS) $@ )
98 -( cd doc && $(MAKE) $(MFLAGS) $@ )
100 ######################################################################
102 # Dependencies for the object files which make up this library. #
104 ######################################################################
107 fnmatch.o: $(BUILD_DIR)/config.h
109 glob.o: $(BUILD_DIR)/config.h
110 glob.o: $(topdir)/bashtypes.h $(topdir)/ansi_stdlib.h $(topdir)/bashansi.h
111 glob.o: $(topdir)/posixstat.h $(topdir)/memalloc.h
114 # Rules for deficient makes, like SunOS and Solaris