affeea23dac8699d8cc8eb6eafb344e21f734117
[gnulib.git] / lib / Makefile.in
1 # Makefile for library files used by GNU fileutils.
2 # Do not use this makefile directly, but only from `../Makefile'.
3 # Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc.
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19 SHELL = /bin/sh
20
21 srcdir = @srcdir@
22 VPATH = @srcdir@
23
24 SOURCES = argmatch.c backupfile.c basename.c dirname.c eaccess.c \
25 error.c filemode.c fsusage.c getopt.c getopt1.c \
26 getversion.c idcache.c isdir.c makepath.c \
27 modechange.c mountlist.c savedir.c \
28 stripslash.c xgetcwd.c xmalloc.c xstrdup.c userspec.c yesno.c \
29 getdate.y posixtm.y \
30 fileblocks.c fnmatch.c ftruncate.c mkdir.c mktime.c rename.c stpcpy.c \
31 strdup.c strstr.c alloca.c
32
33 OBJECTS = argmatch.o backupfile.o basename.o dirname.o eaccess.o \
34 error.o filemode.o getopt.o getopt1.o \
35 getversion.o idcache.o isdir.o makepath.o \
36 modechange.o savedir.o \
37 stripslash.o xgetcwd.o xmalloc.o xstrdup.o userspec.o yesno.o \
38 getdate.o posixtm.o @LIBOBJS@ @ALLOCA@
39
40 DISTFILES = Makefile.in backupfile.h getopt.h modechange.h \
41 fnmatch.h fsusage.h mountlist.h pathmax.h system.h $(SOURCES)
42
43 all: libfu.a
44
45 .c.o:
46         $(CC) -c $(CFLAGS) $(CPPFLAGS) $(DEFS) -I$(srcdir) $<
47
48 install: all
49
50 uninstall:
51
52 TAGS: $(SOURCES)
53         etags $(SOURCES)
54
55 clean:
56         rm -f *.a *.o
57
58 mostlyclean: clean
59
60 distclean: clean
61         rm -f Makefile *.tab.c getdate.c *posixtm.c
62
63 realclean: distclean
64         rm -f TAGS
65
66 dist:
67         for file in $(DISTFILES); do \
68           ln $$file ../`cat ../.fname`/lib \
69             || cp $$file ../`cat ../.fname`/lib; \
70         done
71
72 libfu.a: $(OBJECTS)
73         rm -f $@
74         $(AR) cr $@ $(OBJECTS)
75         -$(RANLIB) $@
76
77 # Since this directory contains two parsers, using bison without -y
78 # is the only way to reliably do a parallel make.
79 getdate.c: getdate.y
80         @echo expect 9 shift/reduce conflicts
81         -bison -o getdate.c $(srcdir)/getdate.y || $(YACC) $(srcdir)/getdate.y
82         test ! -f y.tab.c || mv y.tab.c getdate.c
83
84 # Make the rename atomic, in case sed is interrupted and later rerun.
85 posixtm.c: posixtm.y
86         -bison -o posixtm.tab.c $(srcdir)/posixtm.y \
87             || $(YACC) $(srcdir)/posixtm.y
88         test ! -f y.tab.c || mv y.tab.c posixtm.tab.c
89         sed -e 's/yy/zz/g' posixtm.tab.c > tposixtm.c
90         mv tposixtm.c posixtm.c
91         rm -f posixtm.tab.c
92
93 backupfile.o getversion.o: backupfile.h
94 fnmatch.o: fnmatch.h
95 fsusage.o: fsusage.h
96 getopt1.o: getopt.h
97 modechange.o: modechange.h
98 mountlist.o: mountlist.h
99 xgetcwd.o: pathmax.h
100
101 # Prevent GNU make v3 from overflowing arg limit on SysV.
102 .NOEXPORT: