]>
Commit | Line | Data |
---|---|---|
726f6388 JA |
1 | ## -*- text -*- #################################################### |
2 | # # | |
3 | # Makefile for the GNU Glob Library. # | |
4 | # # | |
5 | #################################################################### | |
bb70624e JA |
6 | # |
7 | # Copyright (C) 1996 Free Software Foundation, Inc. | |
8 | ||
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) | |
12 | # any later version. | |
13 | ||
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. | |
18 | ||
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. | |
726f6388 | 22 | |
ccc6cda3 JA |
23 | srcdir = @srcdir@ |
24 | VPATH = .:@srcdir@ | |
25 | topdir = @top_srcdir@ | |
26 | BUILD_DIR = @BUILD_DIR@ | |
27 | ||
28 | INSTALL = @INSTALL@ | |
29 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
30 | INSTALL_DATA = @INSTALL_DATA@ | |
31 | ||
32 | CC = @CC@ | |
33 | RANLIB = @RANLIB@ | |
34 | AR = @AR@ | |
b72432fd | 35 | ARFLAGS = @ARFLAGS@ |
ccc6cda3 JA |
36 | RM = rm |
37 | CP = cp | |
38 | MV = mv | |
39 | ||
b72432fd JA |
40 | SHELL = @MAKE_SHELL@ |
41 | ||
ccc6cda3 JA |
42 | CFLAGS = @CFLAGS@ |
43 | LOCAL_CFLAGS = @LOCAL_CFLAGS@ | |
44 | CPPFLAGS = @CPPFLAGS@ | |
45 | LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@ | |
46 | ||
47 | DEFS = @DEFS@ | |
d166f048 | 48 | LOCAL_DEFS = @LOCAL_DEFS@ |
ccc6cda3 | 49 | |
bb70624e JA |
50 | BASHINCDIR = ${topdir}/include |
51 | ||
52 | INCLUDES = -I. -I../.. -I$(topdir) -I$(BASHINCDIR) -I$(topdir)/lib | |
ccc6cda3 | 53 | |
d166f048 | 54 | CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) ${INCLUDES} $(LOCAL_CFLAGS) $(CFLAGS) |
726f6388 JA |
55 | |
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. | |
58 | .c.o: | |
ccc6cda3 | 59 | $(CC) -c $(CCFLAGS) $< |
726f6388 JA |
60 | |
61 | # The name of the library target. | |
62 | LIBRARY_NAME = libglob.a | |
63 | ||
64 | # The C code source files for this library. | |
f73dda09 | 65 | CSOURCES = $(srcdir)/glob.c $(srcdir)/strmatch.c |
726f6388 JA |
66 | |
67 | # The header files for this library. | |
f73dda09 | 68 | HSOURCES = $(srcdir)/strmatch.h |
726f6388 | 69 | |
f73dda09 | 70 | OBJECTS = glob.o strmatch.o |
726f6388 JA |
71 | |
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) | |
77 | ||
78 | SUPPORT = Makefile ChangeLog $(DOCSUPPORT) | |
79 | ||
80 | SOURCES = $(CSOURCES) $(HSOURCES) $(DOCSOURCE) | |
81 | ||
82 | THINGS_TO_TAR = $(SOURCES) $(SUPPORT) | |
83 | ||
84 | ###################################################################### | |
85 | ||
86 | all: $(LIBRARY_NAME) | |
87 | ||
88 | $(LIBRARY_NAME): $(OBJECTS) | |
89 | $(RM) -f $@ | |
b72432fd | 90 | $(AR) $(ARFLAGS) $@ $(OBJECTS) |
ccc6cda3 | 91 | -test -n "$(RANLIB)" && $(RANLIB) $@ |
726f6388 JA |
92 | |
93 | what-tar: | |
94 | @for file in $(THINGS_TO_TAR); do \ | |
95 | echo $(selfdir)$$file; \ | |
96 | done | |
97 | ||
98 | documentation: force | |
ccc6cda3 | 99 | -(cd doc; $(MAKE) $(MFLAGS)) |
726f6388 JA |
100 | force: |
101 | ||
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 | |
104 | # include files. | |
105 | install: | |
726f6388 JA |
106 | |
107 | clean: | |
108 | rm -f $(OBJECTS) $(LIBRARY_NAME) | |
ccc6cda3 | 109 | -(cd doc && $(MAKE) $(MFLAGS) $@ ) |
726f6388 | 110 | |
ccc6cda3 JA |
111 | realclean distclean maintainer-clean: clean |
112 | -( cd doc && $(MAKE) $(MFLAGS) $@ ) | |
113 | $(RM) -f Makefile | |
114 | ||
115 | mostlyclean: clean | |
116 | -( cd doc && $(MAKE) $(MFLAGS) $@ ) | |
726f6388 JA |
117 | |
118 | ###################################################################### | |
119 | # # | |
120 | # Dependencies for the object files which make up this library. # | |
121 | # # | |
122 | ###################################################################### | |
123 | ||
f73dda09 JA |
124 | strmatch.o: strmatch.h |
125 | strmatch.o: $(BUILD_DIR)/config.h | |
126 | strmatch.o: $(BASHINCDIR)/chartypes.h | |
d166f048 | 127 | |
ccc6cda3 | 128 | glob.o: $(BUILD_DIR)/config.h |
bb70624e JA |
129 | glob.o: $(topdir)/bashtypes.h $(BASHINCDIR)/ansi_stdlib.h $(topdir)/bashansi.h |
130 | glob.o: $(BASHINCDIR)/posixstat.h $(BASHINCDIR)/memalloc.h | |
f73dda09 | 131 | glob.o: strmatch.h |
e8ce775d JA |
132 | |
133 | # Rules for deficient makes, like SunOS and Solaris | |
f73dda09 | 134 | strmatch.o: strmatch.c |
e8ce775d | 135 | glob.o: glob.c |