(libfetish_a_SOURCES): Add acl.h, acl.c.
[gnulib.git] / lib / Makefile.am
1 ## Process this file with automake to produce Makefile.in -*-Makefile-*-
2
3 AUTOMAKE_OPTIONS = ../src/ansi2knr
4
5 noinst_LIBRARIES = libfetish.a
6
7 INCLUDES = -I.. -I$(srcdir) -I../intl
8 DEFS = -DLIBDIR=\"$(libdir)\" @DEFS@
9
10 ## Put relatively complex files at the beginning of the list so
11 ## that parallel compiles finish a tiny bit sooner.  I don't see
12 ## a way to make regex.c appear earlier in the list, since it's
13 ## added by automake, but on systems with an up to date GNU libc,
14 ## regex.c isn't even compiled.
15 libfetish_a_SOURCES = \
16   acl.h acl.c \
17   getdate.h getdate.y \
18   posixtm.c posixtm.h \
19   posixver.c posixver.h \
20   strftime.c \
21   getopt.c getopt.h getopt1.c \
22   hash.c hash.h \
23   hash-pjw.c hash-pjw.h \
24   __fpending.h \
25   addext.c \
26   argmatch.c argmatch.h \
27   backupfile.c backupfile.h \
28   basename.c \
29   bumpalloc.h \
30   canon-host.c \
31   closeout.c closeout.h \
32   diacrit.c diacrit.h \
33   dirname.c dirname.h \
34   dirfd.h \
35   dup-safer.c \
36   exclude.c exclude.h \
37   filemode.c filemode.h \
38   fnmatch.h \
39   fopen-safer.c \
40   fsusage.h \
41   full-write.c full-write.h \
42   getline.h \
43   getpagesize.h \
44   getstr.c getstr.h \
45   getugroups.c \
46   group-member.h \
47   hard-locale.c hard-locale.h \
48   human.c human.h \
49   idcache.c \
50   isdir.c \
51   lchown.h \
52   linebuffer.c linebuffer.h \
53   localcharset.c \
54   long-options.c long-options.h \
55   makepath.c makepath.h \
56   mbswidth.c mbswidth.h \
57   md5.c md5.h \
58   memcasecmp.c memcasecmp.h \
59   memcoll.c memcoll.h \
60   modechange.c modechange.h \
61   mountlist.h \
62   nanosleep.h \
63   path-concat.c path-concat.h \
64   pathmax.h \
65   physmem.c physmem.h \
66   quote.c quote.h \
67   quotearg.c quotearg.h \
68   readtokens.c readtokens.h \
69   readutmp.h \
70   regex.h \
71   safe-read.c safe-read.h \
72   same.c same.h \
73   save-cwd.c save-cwd.h \
74   savedir.c savedir.h \
75   sha.c sha.h \
76   stdio-safer.h \
77   stripslash.c \
78   strverscmp.h \
79   unicodeio.c unicodeio.h \
80   unistd-safer.h \
81   userspec.c \
82   version-etc.c version-etc.h \
83   xalloc.h \
84   xgetcwd.c \
85   xgethostname.c \
86   xmalloc.c \
87   xmemcoll.c xmemcoll.h \
88   xreadlink.c xreadlink.h \
89   xstrdup.c \
90   xstrtod.c xstrtod.h \
91   xstrtol.c xstrtol.h \
92   xstrtoul.c \
93   xstrtoimax.c \
94   xstrtoumax.c \
95   yesno.c
96
97 libfetish_a_LIBADD = @LIBOBJS@ @ALLOCA@
98 libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
99
100
101 BUILT_SOURCES = getdate.c lstat.c stat.c unlocked-io.h
102 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
103 DISTCLEANFILES = lstat.c stat.c unlocked-io.h
104
105 EXTRA_DIST = xstat.in config.charset ref-add.sin ref-del.sin gen-uio
106 lstat.c: xstat.in
107         sed \
108           -e '/@IGNORE@/d' \
109           -e 's/@xstat@/lstat/g' \
110           -e '/_LSTAT_ONLY@/d' \
111           -e '/@BEGIN_STAT_ONLY@/,/@END_STAT_ONLY@/d' \
112           $(srcdir)/xstat.in > $@-t
113         mv $@-t $@
114
115 stat.c: xstat.in
116         sed \
117           -e '/@IGNORE@/d' \
118           -e 's/@xstat@/stat/g' \
119           -e '/_STAT_ONLY@/d' \
120           -e '/@BEGIN_LSTAT_ONLY@/,/@END_LSTAT_ONLY@/d' \
121           $(srcdir)/xstat.in > $@-t
122         mv $@-t $@
123
124 # The following is needed in order to install a simple file in $(libdir)
125 # which is shared with other installed packages. We use a list of referencing
126 # packages so that "make uninstall" will remove the file if and only if it
127 # is not used by another installed package.
128 # On systems with glibc-2.1 or newer, the file is redundant, therefore we
129 # avoid installing it.
130
131 all-local: charset.alias ref-add.sed ref-del.sed lstat.c stat.c unlocked-io.h
132
133 charset_alias = $(DESTDIR)$(libdir)/charset.alias
134 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
135 install-exec-local: all-local
136         $(mkinstalldirs) $(DESTDIR)$(libdir)
137         if test -f $(charset_alias); then \
138           sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
139           $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
140           rm -f $(charset_tmp) ; \
141         else \
142           if test @GLIBC21@ = no; then \
143             sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
144             $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
145             rm -f $(charset_tmp) ; \
146           fi ; \
147         fi
148
149 uninstall-local: all-local
150         if test -f $(charset_alias); then \
151           sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
152           if grep '^# Packages using this file: $$' $(charset_tmp) \
153               > /dev/null; then \
154             rm -f $(charset_alias); \
155           else \
156             $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
157           fi; \
158           rm -f $(charset_tmp); \
159         fi
160
161 charset.alias: config.charset
162         $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
163         mv t-$@ $@
164
165 SUFFIXES = .sed .sin
166 .sin.sed:
167         sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > $@-t
168         mv $@-t $@
169
170 CLEANFILES = charset.alias ref-add.sed ref-del.sed
171
172 ###############################################
173
174 # FIXME: remove this dependency once automake handles it.
175 # As of cvs automake of about 2002-01-13,
176 # this dependency is necessary to avoid a build failure
177 # when running `make check' before running `make all'.
178 # Otherwise, unlocked-io.h is not built before it's needed.
179 getdate$U.o: unlocked-io.h
180
181 # FIXME: CAUTION this list is a duplicate of one in ../Makefile.cfg.
182 io_functions = \
183   clearerr feof ferror fflush fgets fputc fputs \
184   fread fwrite getc getchar putc putchar
185
186 unlocked-io.h: $(srcdir)/gen-uio Makefile.am
187         srcdir=$(srcdir) $(SHELL) $(srcdir)/gen-uio $(io_functions) > $@t
188         mv $@t $@