Debian Codegraph @

awklib/Makefile.am

raw
1 #
2 # awklib/Makefile.am --- automake input file for gawk
3 #
4 # Copyright (C) 1995-2006, 2022 the Free Software Foundation, Inc.
5 #
6 # This file is part of GAWK, the GNU implementation of the
7 # AWK Programming Language.
8 #
9 # GAWK is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3 of the License, or
12 # (at your option) any later version.
13 #
14 # GAWK is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 #
23
24 ## process this file with automake to produce Makefile.in
25
26 EXTRA_DIST = ChangeLog ChangeLog.0 ChangeLog.1 \
27 extract.awk eg $(srcdir)/stamp-eg
28 # With some locales, the script extract.awk fails.
29 # So we fix the locale to some sensible value.
30
31 if TEST_CROSS_COMPILE
32 AWKPROG = LC_ALL=C LANG=C $(AWK)
33 else
34 AWKPROG = LC_ALL=C LANG=C "$(abs_top_builddir)/gawk$(EXEEXT)"
35 endif
36
37 # Get config.h from the build directory and custom.h from the source directory.
38 AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/support
39
40 pkgdatadir = $(datadir)/awk
41 pkglibexecdir = $(libexecdir)/awk
42
43 pkglibexec_PROGRAMS = pwcat grcat
44 AUXAWK = passwd.awk group.awk
45 nodist_grcat_SOURCES = grcat.c
46 nodist_pwcat_SOURCES = pwcat.c
47
48 CLEANFILES = $(nodist_grcat_SOURCES) $(nodist_pwcat_SOURCES)
49
50 all: $(srcdir)/stamp-eg $(AUXPROGS) $(AUXAWK)
51
52 install-exec-hook: $(AUXAWK)
53 $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
54 for i in $(AUXAWK) $(srcdir)/eg/lib/*.awk ; do \
55 progname=`echo $$i | sed 's;.*/;;'` ; \
56 $(INSTALL_DATA) $$i $(DESTDIR)$(pkgdatadir)/$$progname ; \
57 done
58
59 # pkglibexecdir and pkgdatadir are removed in the top level Makefile's uninstall
60 uninstall-local:
61 rm -fr $(DESTDIR)$(pkglibexecdir)/* $(DESTDIR)$(pkgdatadir)/*
62
63 clean-local:
64 rm -f $(AUXAWK) *.exe
65 rm -fr eg.old
66 rm -fr grcat.dSYM pwcat.dSYM
67
68 $(srcdir)/stamp-eg: $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi
69 cd $(srcdir) && \
70 rm -fr eg && \
71 rm -fr stamp-eg && \
72 $(AWKPROG) -f ./extract.awk ../doc/gawk.texi ../doc/gawkinet.texi
73 @echo 'some makes are stupid and will not check a directory' > $(srcdir)/stamp-eg
74 @echo 'against a file, so this file is a place holder. gack.' >> $(srcdir)/stamp-eg
75
76 pwcat.c: $(srcdir)/eg/lib/pwcat.c
77 rm -f $@
78 $(LN_S) $(srcdir)/eg/lib/pwcat.c .
79
80 grcat.c: $(srcdir)/eg/lib/grcat.c
81 rm -f $@
82 $(LN_S) $(srcdir)/eg/lib/grcat.c .
83
84 $(srcdir)/eg/lib/pwcat.c $(srcdir)/eg/lib/grcat.c $(srcdir)/eg/prog/igawk.sh \
85 $(srcdir)/eg/lib/passwdawk.in $(srcdir)/eg/lib/groupawk.in: stamp-eg; @:
86
87 passwd.awk: $(srcdir)/eg/lib/passwdawk.in
88 sed 's;/usr/local/libexec/awk;$(pkglibexecdir);' < $(srcdir)/eg/lib/passwdawk.in > passwd.awk
89
90 group.awk: $(srcdir)/eg/lib/groupawk.in
91 sed 's;/usr/local/libexec/awk;$(pkglibexecdir);' < $(srcdir)/eg/lib/groupawk.in > group.awk
92
93 distclean-local:
94 rm -fr .deps