2 # awklib/Makefile.am --- automake input file for gawk
4 # Copyright (C) 1995-2006 the Free Software Foundation, Inc.
6 # This file is part of GAWK, the GNU implementation of the
7 # AWK Programming Language.
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.
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.
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
24 ## process this file with automake to produce Makefile.in
26 EXTRA_DIST = ChangeLog ChangeLog.0 extract.awk eg $(srcdir)/stamp-eg
27 # With some locales, the script extract.awk fails.
28 # So we fix the locale to some sensible value.
31 AWKPROG = LC_ALL=C LANG=C awk$(EXEEXT)
33 AWKPROG = LC_ALL=C LANG=C $(abs_top_builddir)/gawk$(EXEEXT)
36 # Get config.h from the build directory and custom.h from the source directory.
37 AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)
39 pkgdatadir = $(datadir)/awk
40 pkglibexecdir = $(libexecdir)/awk
43 pkglibexec_PROGRAMS = pwcat grcat
44 AUXAWK = passwd.awk group.awk
45 nodist_grcat_SOURCES = grcat.c
46 nodist_pwcat_SOURCES = pwcat.c
48 all: $(srcdir)/stamp-eg $(AUXPROGS) igawk $(AUXAWK)
50 install-exec-hook: $(AUXAWK)
51 $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
52 for i in $(AUXAWK) $(srcdir)/eg/lib/*.awk ; do \
53 progname=`echo $$i | sed 's;.*/;;'` ; \
54 $(INSTALL_DATA) $$i $(DESTDIR)$(pkgdatadir)/$$progname ; \
57 # pkglibexecdir and pkgdatadir are removed in the top level Makefile's uninstall
59 rm -fr $(DESTDIR)$(pkglibexecdir)/* $(DESTDIR)$(pkgdatadir)/*
60 rm -f $(DESTDIR)$(bindir)/igawk
63 rm -f $(AUXAWK) igawk *.exe
65 rm -fr grcat.dSYM pwcat.dSYM
67 $(srcdir)/stamp-eg: $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi
71 $(AWKPROG) -f extract.awk ../doc/gawk.texi ../doc/gawkinet.texi
72 @echo 'some makes are stupid and will not check a directory' > $(srcdir)/stamp-eg
73 @echo 'against a file, so this file is a place holder. gack.' >> $(srcdir)/stamp-eg
75 $(srcdir)/eg/lib/pwcat.c $(srcdir)/eg/lib/grcat.c $(srcdir)/eg/prog/igawk.sh \
76 $(srcdir)/eg/lib/passwdawk.in $(srcdir)/eg/lib/groupawk.in: stamp-eg; @:
78 pwcat$(EXEEXT): $(srcdir)/eg/lib/pwcat.c
79 $(COMPILE) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@
81 grcat$(EXEEXT): $(srcdir)/eg/lib/grcat.c
82 $(COMPILE) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@
84 igawk: $(srcdir)/eg/prog/igawk.sh
85 cp $(srcdir)/eg/prog/igawk.sh $@ ; chmod 755 $@
87 passwd.awk: $(srcdir)/eg/lib/passwdawk.in
88 sed 's;/usr/local/libexec/awk;$(pkglibexecdir);' < $(srcdir)/eg/lib/passwdawk.in > passwd.awk
90 group.awk: $(srcdir)/eg/lib/groupawk.in
91 sed 's;/usr/local/libexec/awk;$(pkglibexecdir);' < $(srcdir)/eg/lib/groupawk.in > group.awk