(GET_UNSIGNED_NUMBER): Give proper error for spaces.
[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   gettime.c \
46   getugroups.c \
47   group-member.h \
48   hard-locale.c hard-locale.h \
49   human.c human.h \
50   idcache.c \
51   isdir.c \
52   lchown.h \
53   linebuffer.c linebuffer.h \
54   localcharset.c \
55   long-options.c long-options.h \
56   makepath.c makepath.h \
57   mbswidth.c mbswidth.h \
58   md5.c md5.h \
59   memcasecmp.c memcasecmp.h \
60   memcoll.c memcoll.h \
61   modechange.c modechange.h \
62   mountlist.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   settime.c \
76   sha.c sha.h \
77   stdio-safer.h \
78   stripslash.c \
79   strverscmp.h \
80   timespec.h \
81   unicodeio.c unicodeio.h \
82   unistd-safer.h \
83   userspec.c \
84   version-etc.c version-etc.h \
85   xalloc.h \
86   xgetcwd.c \
87   xgethostname.c \
88   xmalloc.c \
89   xmemcoll.c xmemcoll.h \
90   xreadlink.c xreadlink.h \
91   xstrdup.c \
92   xstrtod.c xstrtod.h \
93   xstrtol.c xstrtol.h \
94   xstrtoul.c \
95   xstrtoimax.c \
96   xstrtoumax.c \
97   yesno.c
98
99 libfetish_a_LIBADD = @LIBOBJS@ @ALLOCA@
100 libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
101
102
103 BUILT_SOURCES = getdate.c lstat.c stat.c unlocked-io.h
104 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
105 DISTCLEANFILES = lstat.c stat.c unlocked-io.h
106
107 EXTRA_DIST = xstat.in config.charset ref-add.sin ref-del.sin gen-uio
108 lstat.c: xstat.in
109         sed \
110           -e '/@IGNORE@/d' \
111           -e 's/@xstat@/lstat/g' \
112           -e '/_LSTAT_ONLY@/d' \
113           -e '/@BEGIN_STAT_ONLY@/,/@END_STAT_ONLY@/d' \
114           $(srcdir)/xstat.in > $@-t
115         mv $@-t $@
116
117 stat.c: xstat.in
118         sed \
119           -e '/@IGNORE@/d' \
120           -e 's/@xstat@/stat/g' \
121           -e '/_STAT_ONLY@/d' \
122           -e '/@BEGIN_LSTAT_ONLY@/,/@END_LSTAT_ONLY@/d' \
123           $(srcdir)/xstat.in > $@-t
124         mv $@-t $@
125
126 # The following is needed in order to install a simple file in $(libdir)
127 # which is shared with other installed packages. We use a list of referencing
128 # packages so that "make uninstall" will remove the file if and only if it
129 # is not used by another installed package.
130 # On systems with glibc-2.1 or newer, the file is redundant, therefore we
131 # avoid installing it.
132
133 all-local: charset.alias ref-add.sed ref-del.sed lstat.c stat.c unlocked-io.h
134
135 charset_alias = $(DESTDIR)$(libdir)/charset.alias
136 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
137 install-exec-local: all-local
138         $(mkinstalldirs) $(DESTDIR)$(libdir)
139         if test -f $(charset_alias); then \
140           sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
141           $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
142           rm -f $(charset_tmp) ; \
143         else \
144           if test @GLIBC21@ = no; then \
145             sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
146             $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
147             rm -f $(charset_tmp) ; \
148           fi ; \
149         fi
150
151 uninstall-local: all-local
152         if test -f $(charset_alias); then \
153           sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
154           if grep '^# Packages using this file: $$' $(charset_tmp) \
155               > /dev/null; then \
156             rm -f $(charset_alias); \
157           else \
158             $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
159           fi; \
160           rm -f $(charset_tmp); \
161         fi
162
163 charset.alias: config.charset
164         $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
165         mv t-$@ $@
166
167 SUFFIXES = .sed .sin
168 .sin.sed:
169         sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > $@-t
170         mv $@-t $@
171
172 CLEANFILES = charset.alias ref-add.sed ref-del.sed
173
174 ###############################################
175
176 # FIXME: remove this dependency once automake handles it.
177 # As of cvs automake of about 2002-01-13,
178 # this dependency is necessary to avoid a build failure
179 # when running `make check' before running `make all'.
180 # Otherwise, unlocked-io.h is not built before it's needed.
181 getdate$U.o: unlocked-io.h
182
183 # FIXME: CAUTION this list is a duplicate of one in ../Makefile.cfg.
184 io_functions = \
185   clearerr feof ferror fflush fgets fputc fputs \
186   fread fwrite getc getchar putc putchar
187
188 unlocked-io.h: $(srcdir)/gen-uio Makefile.am
189         srcdir=$(srcdir) $(SHELL) $(srcdir)/gen-uio $(io_functions) > $@t
190         mv $@t $@