9e99f7cc21a085c4363e9d0caa64d6db073c7dba
[gnulib.git] / lib / Makefile.in
1 # Makefile for library files used by GNU file utilities.
2 # Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
3
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 SHELL = /bin/sh
19
20 srcdir = @srcdir@
21 VPATH = @srcdir@
22
23 CC = @CC@
24 AR = ar
25 RANLIB = @RANLIB@
26 DEFS = @DEFS@
27 CFLAGS = @CFLAGS@
28 YACC = @YACC@
29
30 GETOPT = getopt.o getopt1.o
31
32 exec_prefix = @exec_prefix@
33 libdir = $(exec_prefix)/lib
34
35 SOURCES = getdate.y posixtm.y \
36 argmatch.c backupfile.c basename.c dirname.c euidaccess.c \
37 error.c filemode.c fsusage.c full-write.c getopt.c getopt1.c \
38 getversion.c group-member.c idcache.c isdir.c makepath.c \
39 modechange.c mountlist.c obstack.c safe-read.c savedir.c \
40 stripslash.c xgetcwd.c xmalloc.c xstrdup.c userspec.c yesno.c \
41 fileblocks.c fnmatch.c ftruncate.c mkdir.c mktime.c rename.c rmdir.c \
42 save-cwd.c stpcpy.c \
43 strdup.c strstr.c strtol.c strtoul.c alloca.c long-options.c \
44 memcmp.c memcpy.c memset.c xstrtol.c xstrtoul.c
45
46 OBJECTS = getdate.o posixtm.o \
47 argmatch.o backupfile.o basename.o dirname.o \
48 error.o filemode.o full-write.o $(GETOPT) \
49 getversion.o group-member.o idcache.o isdir.o long-options.o makepath.o \
50 modechange.o obstack.o safe-read.o save-cwd.o savedir.o \
51 stripslash.o xgetcwd.o xmalloc.o xstrdup.o userspec.o yesno.o \
52 xstrtol.o xstrtoul.o @LIBOBJS@ @ALLOCA@
53
54 DISTFILES = Makefile.in backupfile.h getopt.h long-options.h modechange.h \
55 fnmatch.h fsusage.h group-member.h makepath.h mountlist.h obstack.h pathmax.h \
56 save-cwd.h getdate.c posixtm.c error.h xstrtol.h xstrtoul.h $(SOURCES)
57
58 all: libfu.a
59
60 .SUFFIXES:
61 .SUFFIXES: .c .o
62
63 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
64 INCLUDES = -I.. -I$(srcdir)
65 .c.o:
66         $(COMPILE) $<
67
68 subdir = lib
69 Makefile: ../config.status Makefile.in
70         cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
71
72 installdirs:
73
74 install install-exec install-data: all
75
76 uninstall:
77
78 TAGS: $(SOURCES)
79         etags $(SOURCES)
80
81 check:
82
83 clean:
84         rm -f *.a *.o
85
86 mostlyclean: clean
87
88 distclean: clean
89         rm -f Makefile *.tab.c tposixtm.c
90         rm -rf .deps
91
92 maintainer-clean: distclean
93         rm -f TAGS getdate.c posixtm.c
94
95 distdir = ../`cat ../distname`/$(subdir)
96 dist: $(DISTFILES)
97         for file in $(DISTFILES); do \
98           ln $$file $(distdir) \
99             || { echo copying $$file instead; cp -p $$file $(distdir);}; \
100         done
101
102 libfu.a: $(OBJECTS)
103         rm -f $@
104         $(AR) cr $@ $(OBJECTS)
105         -$(RANLIB) $@
106
107 # Since this directory contains two parsers, we have to be careful to avoid
108 # running two $(YACC)s during parallel makes.  See below.
109 getdate.c: getdate.y
110         @echo expect 10 shift/reduce conflicts
111         $(YACC) $(srcdir)/getdate.y
112         mv y.tab.c getdate.c
113
114 # Make the rename atomic, in case sed is interrupted and later rerun.
115 # The artificial dependency on getdate.c keeps the two parsers from being
116 # built in parallel.  Enforcing this little bit of sequentiality lets
117 # everyone (even those without bison) still run mostly parallel builds.
118 posixtm.c: posixtm.y getdate.c
119         $(YACC) $(srcdir)/posixtm.y
120         mv y.tab.c posixtm.tab.c
121         sed -e 's/yy/zz/g' posixtm.tab.c > tposixtm.c
122         mv tposixtm.c posixtm.c
123         rm -f posixtm.tab.c
124
125 rename.o: rename.c
126         $(CC) -c $(CPPFLAGS) -DMVDIR="\"$(libdir)/mvdir\"" $(DEFS) \
127             -I.. -I$(srcdir) $(CFLAGS) $(srcdir)/rename.c
128
129 $(OBJECTS): ../config.h
130
131 backupfile.o getversion.o: backupfile.h
132 fnmatch.o: fnmatch.h
133 fsusage.o: fsusage.h
134 getopt1.o: getopt.h
135 modechange.o: modechange.h
136 mountlist.o: mountlist.h
137 xgetcwd.o: pathmax.h
138 makepath.o: makepath.h
139 obstack.o: obstack.h
140 group-member.o: group-member.h
141
142 .PHONY: all check clean dist distclean install install-data install-exec \
143 installdirs maintainer-clean mostlyclean uninstall
144
145 # Tell versions [3.59,3.63) of GNU make not to export all variables.
146 # Otherwise a system limit (for SysV at least) may be exceeded.
147 .NOEXPORT: