.
[pspp] / 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 = -Dlint @DEFS@
27 CFLAGS = @CFLAGS@
28 YACC = @YACC@
29
30 exec_prefix = @exec_prefix@
31 libdir = $(exec_prefix)/lib
32 SOURCES = getdate.y posixtm.y \
33 argmatch.c backupfile.c basename.c dirname.c eaccess.c \
34 error.c filemode.c fsusage.c full-write.c getopt.c getopt1.c \
35 getversion.c group-member.c idcache.c isdir.c makepath.c \
36 modechange.c mountlist.c safe-read.c savedir.c \
37 stripslash.c xgetcwd.c xmalloc.c xstrdup.c userspec.c yesno.c \
38 fileblocks.c fnmatch.c ftruncate.c mkdir.c mktime.c rename.c rmdir.c stpcpy.c \
39 strdup.c strstr.c alloca.c long-options.c
40
41 OBJECTS = getdate.o posixtm.o \
42 argmatch.o backupfile.o basename.o dirname.o eaccess.o \
43 error.o filemode.o full-write.o getopt.o getopt1.o \
44 getversion.o group-member.o idcache.o isdir.o long-options.o makepath.o \
45 modechange.o safe-read.o safe-stat.o safe-lstat.o savedir.o \
46 stripslash.o xgetcwd.o xmalloc.o xstrdup.o userspec.o yesno.o \
47 @LIBOBJS@ @ALLOCA@
48
49 DISTFILES = Makefile.in backupfile.h getopt.h modechange.h \
50 fnmatch.h fsusage.h mountlist.h pathmax.h safe-xstat.cin safe-xstat.hin \
51 getdate.c posixtm.c $(SOURCES)
52
53 all: libfu.a
54
55 .SUFFIXES:
56 .SUFFIXES: .c .o
57
58 .c.o:
59         $(CC) -c $(CPPFLAGS) $(DEFS) -I. -I.. -I$(srcdir) $(CFLAGS) $<
60
61 Makefile: ../config.status Makefile.in
62         cd ..; CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
63
64 installdirs:
65
66 install: all
67
68 uninstall:
69
70 TAGS: $(SOURCES)
71         etags $(SOURCES)
72
73 check:
74
75 clean:
76         rm -f *.a *.o
77
78 mostlyclean: clean
79
80 distclean: clean
81         rm -f Makefile *.tab.c getdate.c *posixtm.c \
82           safe-stat.c safe-stat.h safe-lstat.c safe-lstat.h
83
84 realclean: distclean
85         rm -f TAGS
86
87 distdir = ../`cat ../distname`/$(subdir)
88 dist: $(DISTFILES)
89         for file in $(DISTFILES); do \
90           ln $$file $(distdir) \
91             || { echo copying $$file instead; cp -p $$file $(distdir);}; \
92         done
93
94 libfu.a: $(OBJECTS)
95         rm -f $@
96         $(AR) cr $@ $(OBJECTS)
97         -$(RANLIB) $@
98
99 extract_stat = sed -e 's/@l@//g' -e 's/@L@//g'
100 extract_lstat = sed -e 's/@l@/l/g' -e 's/@L@/L/g'
101
102 safe-lstat.c: safe-xstat.cin
103         $(extract_lstat) $(srcdir)/safe-xstat.cin > $@-t
104         mv $@-t $@
105
106 safe-lstat.h: safe-xstat.hin
107         $(extract_lstat) $(srcdir)/safe-xstat.hin > $@-t
108         mv $@-t $@
109
110 safe-stat.c: safe-xstat.cin
111         $(extract_stat) $(srcdir)/safe-xstat.cin > $@-t
112         mv $@-t $@
113
114 safe-stat.h: safe-xstat.hin
115         $(extract_stat) $(srcdir)/safe-xstat.hin > $@-t
116         mv $@-t $@
117
118 safe-stat.o: safe-stat.h
119 safe-lstat.o: safe-lstat.h
120
121 # Since this directory contains two parsers, we have to be careful to avoid
122 # running two $(YACC)s during parallel makes.  See below.
123 getdate.c: getdate.y
124         @echo expect 10 shift/reduce conflicts
125         $(YACC) $(srcdir)/getdate.y
126         mv y.tab.c getdate.c
127
128 # Make the rename atomic, in case sed is interrupted and later rerun.
129 # The artificial dependency on getdate.c keeps the two parsers from being
130 # built in parallel.  Enforcing this little bit of sequentiality lets
131 # everyone (even those without bison) still run mostly parallel builds.
132 posixtm.c: posixtm.y getdate.c
133         $(YACC) $(srcdir)/posixtm.y
134         mv y.tab.c posixtm.tab.c
135         sed -e 's/yy/zz/g' posixtm.tab.c > tposixtm.c
136         mv tposixtm.c posixtm.c
137         rm -f posixtm.tab.c
138
139 rename.o: rename.c
140         $(CC) -c $(CPPFLAGS) -DMVDIR="\"$(libdir)/mvdir\"" $(DEFS) \
141             -I.. -I$(srcdir) $(CFLAGS) $(srcdir)/rename.c
142
143 $(OBJECTS): ../config.h
144
145 backupfile.o getversion.o: backupfile.h
146 fnmatch.o: fnmatch.h
147 fsusage.o: fsusage.h
148 getopt1.o: getopt.h
149 modechange.o: modechange.h
150 mountlist.o: mountlist.h
151 xgetcwd.o: pathmax.h
152 eaccess.o fsusage.o isdir.o makepath.o mkdir.o rename.o: safe-stat.h
153
154 # Tell versions [3.59,3.63) of GNU make not to export all variables.
155 # Otherwise a system limit (for SysV at least) may be exceeded.
156 .NOEXPORT: