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