# Makefile for gperf

# Copyright (C) 1989, 1992, 1993, 1998, 2002, 2012, 2016 Free Software Foundation, Inc.
# Written by Douglas C. Schmidt <schmidt@ics.uci.edu>
# and Bruno Haible <bruno@clisp.org>.
#
# This file is part of GNU GPERF.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

#### Start of system configuration section. ####

# Programs used by "make":
RM = rm -f
@SET_MAKE@

#### End of system configuration section. ####

SHELL = /bin/sh

all : force
	cd @subdir@; $(MAKE) all

install : force
	cd @subdir@; $(MAKE) install

installdirs : force
	cd @subdir@; $(MAKE) installdirs

uninstall : force
	cd @subdir@; $(MAKE) uninstall

check : force
	cd @subdir@; $(MAKE) check

mostlyclean : force
	cd @subdir@; $(MAKE) mostlyclean

clean : force
	cd @subdir@; $(MAKE) clean

distclean : force
	cd @subdir@; if test -f Makefile; then $(MAKE) distclean; fi
	$(RM) config.status config.log config.cache Makefile

maintainer-clean : force
	cd @subdir@; if test -f Makefile; then $(MAKE) maintainer-clean; fi
	$(RM) config.status config.log config.cache Makefile

# List of source files.
SOURCE_FILES = \
  README README.windows README.vms NEWS AUTHORS \
  configure.ac aclocal.m4 Makefile.in Makefile.vms \
  Makefile.devel ChangeLog
# List of distributed files imported from other packages.
IMPORTED_FILES = \
  COPYING INSTALL \
  build-aux/install-sh build-aux/mkinstalldirs \
  build-aux/compile build-aux/ar-lib
# List of distributed files generated by autotools or Makefile.devel.
GENERATED_FILES = configure
# List of distributed files generated by "make".
DISTRIBUTED_BUILT_FILES =
# List of distributed files.
DISTFILES = $(SOURCE_FILES) $(IMPORTED_FILES) $(GENERATED_FILES) $(DISTRIBUTED_BUILT_FILES)

distdir : $(DISTFILES)
	for file in $(DISTFILES); do \
	  if test -f $$file; then dir='.'; else dir='$(srcdir)'; fi; \
	  destdir=`echo '$(distdir)'/$$file | sed -e 's|//*[^/]*$$||'`; \
	  test -d "$$destdir" || mkdir "$$destdir"; \
	  cp -p $$dir/$$file '$(distdir)'/$$file || exit 1; \
	done
	subdir=@subdir@; test -d '$(distdir)'/$$subdir || mkdir '$(distdir)'/$$subdir; cd $$subdir; $(MAKE) distdir distdir='$(distdir)'/$$subdir

# Creating a distribution tarball.
PACKAGE = gperf
VERSION = `sed -n -e 's/.*version_string = "\(.*\)".*/\1/p' < src/version.cc`
TAR = tar
GZIP = gzip

dist : force
	tmpdistdir=$(PACKAGE)-$(VERSION); \
	abstmpdistdir=`pwd`/$$tmpdistdir; \
	rm -rf $$tmpdistdir $$tmpdistdir.tar $$tmpdistdir.tar.gz \
	  && mkdir $$tmpdistdir \
	  && $(MAKE) distdir distdir="$$abstmpdistdir" \
	  && $(TAR) chof $$tmpdistdir.tar --owner=root --group=root $$tmpdistdir \
	  && $(GZIP) -9 $$tmpdistdir.tar \
	  && rm -rf $$tmpdistdir

force :

