*** empty log message ***
[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   getdate.h getdate.y \
17   posixtm.c posixtm.h \
18   strftime.c \
19   getopt.c getopt.h getopt1.c \
20   hash.c hash.h \
21   __fpending.h \
22   addext.c \
23   argmatch.c argmatch.h \
24   backupfile.c backupfile.h \
25   basename.c \
26   bumpalloc.h \
27   canon-host.c \
28   closeout.c closeout.h \
29   diacrit.c diacrit.h \
30   dirname.c dirname.h \
31   dup-safer.c \
32   exclude.c exclude.h \
33   filemode.c filemode.h \
34   fnmatch.h \
35   fopen-safer.c \
36   fsusage.h \
37   full-write.c \
38   getline.h \
39   getpagesize.h \
40   getstr.c getstr.h \
41   getugroups.c \
42   group-member.h \
43   hard-locale.c hard-locale.h \
44   human.c human.h \
45   idcache.c \
46   isdir.c \
47   lchown.h \
48   linebuffer.c linebuffer.h \
49   localcharset.c \
50   long-options.c long-options.h \
51   makepath.c makepath.h \
52   mbswidth.c mbswidth.h \
53   md5.c md5.h \
54   memcasecmp.c memcasecmp.h \
55   memcoll.c memcoll.h \
56   modechange.c modechange.h \
57   mountlist.h \
58   nanosleep.h \
59   path-concat.c path-concat.h \
60   pathmax.h \
61   physmem.c physmem.h \
62   quote.c quote.h \
63   quotearg.c quotearg.h \
64   readtokens.c readtokens.h \
65   readutmp.h \
66   regex.h \
67   safe-read.c safe-read.h \
68   same.c same.h \
69   save-cwd.c save-cwd.h \
70   savedir.c savedir.h \
71   sha.c sha.h \
72   stdio-safer.h \
73   stripslash.c \
74   strverscmp.h \
75   unicodeio.c unicodeio.h \
76   unistd-safer.h \
77   userspec.c \
78   version-etc.c version-etc.h \
79   xalloc.h \
80   xgetcwd.c \
81   xgethostname.c \
82   xmalloc.c \
83   xstrdup.c \
84   xstrtod.c xstrtod.h \
85   xstrtol.c xstrtol.h \
86   xstrtoul.c \
87   xstrtoumax.c \
88   yesno.c
89
90 libfetish_a_LIBADD = @LIBOBJS@ @ALLOCA@
91 libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
92
93
94 BUILT_SOURCES = getdate.c lstat.c stat.c
95 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
96 DISTCLEANFILES = lstat.c stat.c
97
98 EXTRA_DIST = xstat.in config.charset ref-add.sin ref-del.sin
99 lstat.c: xstat.in
100         sed \
101           -e '/@IGNORE@/d' \
102           -e 's/@xstat@/lstat/g' \
103           -e '/_LSTAT_ONLY@/d' \
104           -e '/@BEGIN_STAT_ONLY@/,/@END_STAT_ONLY@/d' \
105           $(srcdir)/xstat.in > $@-t
106         mv $@-t $@
107
108 stat.c: xstat.in
109         sed \
110           -e '/@IGNORE@/d' \
111           -e 's/@xstat@/stat/g' \
112           -e '/_STAT_ONLY@/d' \
113           -e '/@BEGIN_LSTAT_ONLY@/,/@END_LSTAT_ONLY@/d' \
114           $(srcdir)/xstat.in > $@-t
115         mv $@-t $@
116
117
118 # The following is needed in order to install a simple file in $(libdir)
119 # which is shared with other installed packages. We use a list of referencing
120 # packages so that "make uninstall" will remove the file if and only if it
121 # is not used by another installed package.
122 # On systems with glibc-2.1 or newer, the file is redundant, therefore we
123 # avoid installing it.
124
125 all-local: charset.alias ref-add.sed ref-del.sed lstat.c stat.c
126
127 charset_alias = $(DESTDIR)$(libdir)/charset.alias
128 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
129 install-exec-local: all-local
130         $(mkinstalldirs) $(DESTDIR)$(libdir)
131         if test -f $(charset_alias); then \
132           sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
133           $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
134           rm -f $(charset_tmp) ; \
135         else \
136           if test @GLIBC21@ = no; then \
137             sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
138             $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
139             rm -f $(charset_tmp) ; \
140           fi ; \
141         fi
142
143 uninstall-local: all-local
144         if test -f $(charset_alias); then \
145           sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
146           if grep '^# Packages using this file: $$' $(charset_tmp) \
147               > /dev/null; then \
148             rm -f $(charset_alias); \
149           else \
150             $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
151           fi; \
152           rm -f $(charset_tmp); \
153         fi
154
155 charset.alias: config.charset
156         $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
157         mv t-$@ $@
158
159 SUFFIXES = .sed .sin
160 .sin.sed:
161         sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > $@-t
162         mv $@-t $@
163
164 CLEANFILES = charset.alias ref-add.sed ref-del.sed