a23873c6fbf344a593e707ff2c499e78414d09dd
[gnulib.git] / lib / Makefile.in
1 # Makefile for library files used by GNU fileutils.
2 # Copyright (C) 1990, 1991, 1992, 1993 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 = -DMVDIR="\"$(libdir)/mvdir\"" @DEFS@
27 CFLAGS = @CFLAGS@
28 YACC = @YACC@
29
30 SOURCES = getdate.y posixtm.y \
31 argmatch.c backupfile.c basename.c dirname.c eaccess.c \
32 error.c filemode.c fsusage.c getopt.c getopt1.c \
33 getversion.c idcache.c isdir.c makepath.c \
34 modechange.c mountlist.c savedir.c \
35 stripslash.c xgetcwd.c xmalloc.c xstrdup.c userspec.c yesno.c \
36 fileblocks.c fnmatch.c ftruncate.c mkdir.c mktime.c rename.c stpcpy.c \
37 strdup.c strstr.c alloca.c
38
39 OBJECTS = getdate.o posixtm.o \
40 argmatch.o backupfile.o basename.o dirname.o eaccess.o \
41 error.o filemode.o getopt.o getopt1.o \
42 getversion.o idcache.o isdir.o makepath.o \
43 modechange.o savedir.o \
44 stripslash.o xgetcwd.o xmalloc.o xstrdup.o userspec.o yesno.o \
45 @LIBOBJS@ @ALLOCA@
46
47 DISTFILES = Makefile.in backupfile.h getopt.h modechange.h \
48 fnmatch.h fsusage.h mountlist.h pathmax.h system.h $(SOURCES)
49
50 all: libfu.a
51
52 .c.o:
53         $(CC) -c $(CPPFLAGS) $(DEFS) -I.. -I$(srcdir) $(CFLAGS) $<
54
55 install: all
56
57 uninstall:
58
59 TAGS: $(SOURCES)
60         etags $(SOURCES)
61
62 check:
63
64 clean:
65         rm -f *.a *.o
66
67 mostlyclean: clean
68
69 distclean: clean
70         rm -f Makefile *.tab.c getdate.c *posixtm.c
71
72 realclean: distclean
73         rm -f TAGS
74
75 dist:
76         for file in $(DISTFILES); do \
77           ln $$file ../`cat ../.fname`/lib \
78             || cp -p $$file ../`cat ../.fname`/lib; \
79         done
80
81 libfu.a: $(OBJECTS)
82         rm -f $@
83         $(AR) cr $@ $(OBJECTS)
84         -$(RANLIB) $@
85
86 # Since this directory contains two parsers, we have to be careful to avoid
87 # running two $(YACC)s during parallel makes.  See below.
88 getdate.c: getdate.y
89         @echo expect 9 shift/reduce conflicts
90         $(YACC) $(srcdir)/getdate.y
91         mv y.tab.c getdate.c
92
93 # Make the rename atomic, in case sed is interrupted and later rerun.
94 # The artificial dependency on getdate.c keeps the two parsers from being
95 # built in parallel.  Enforcing this little bit of sequentiality lets
96 # everyone (even those without bison) still run mostly parallel builds.
97 posixtm.c: posixtm.y getdate.c
98         $(YACC) $(srcdir)/posixtm.y
99         mv y.tab.c posixtm.tab.c
100         sed -e 's/yy/zz/g' posixtm.tab.c > tposixtm.c
101         mv tposixtm.c posixtm.c
102         rm -f posixtm.tab.c
103
104 backupfile.o getversion.o: backupfile.h
105 fnmatch.o: fnmatch.h
106 fsusage.o: fsusage.h
107 getopt1.o: getopt.h
108 modechange.o: modechange.h
109 mountlist.o: mountlist.h
110 xgetcwd.o: pathmax.h
111
112 # Tell versions [3.59,3.63) of GNU make not to export all variables.
113 # Otherwise a system limit (for SysV at least) may be exceeded.
114 .NOEXPORT: