#  $Id: Makefile.in 0.24 1996/05/25 00:02:04 tom Exp $
###############################################################################
#
#  Generic Makefile to create the Gcal appointment/reminder files.
#
#  Copyright (C) 1994-1996      Thomas Esken            <esken@uni-muenster.de>
#                               Im Hagenfeld 84
#                               D-48147 M"unster
#                               GERMANY
#
#                               and the FREE SOFTWARE FOUNDATION
#
###############################################################################
#
#
#
#### Start of system configuration section. ####

PACKAGE = @PACKAGE@
VERSION = @VERSION@

srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@

subdir = data

@SET_MAKE@

PERL = @PERL@
AWK = @AWK@

INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@

prefix = @prefix@

datadir = $(prefix)/share
# Where to install the converted reminder/appointment files.
datesdir = `echo $(datadir)/$(PACKAGE) | sed -e 's/\/\//\//g'`
# Where to install the `.gcalrc' file.
homedir = $(HOME)

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



#### Start of package specific make variable definition section. ####

SHELL = /bin/sh

#
# File owner permissions used for installdates targets and
# for resetting the permissions after running a distribution target.
#
BINPERMS = `echo $(INSTALL_PROGRAM) | sed -e 's/[^0-9]//g'`
SRCPERMS = `echo $(INSTALL_DATA) | sed -e 's/[^0-9]//g'`
#
# File owner permissions used for installdates targets and
# for resetting the permissions after running a distribution target
# if the configure script doesn't set $(BINPERMS) or $(SRCPERMS).
#
BINPERMS2 = 0755
SRCPERMS2 = 0644

#
# Standard names.
#

dataMISCFILES = Makefile.in README gcalrc

calendarsDIR = calendars#
calendarsFILES = $(calendarsDIR)/calendar.birth $(calendarsDIR)/calendar.chris \
  $(calendarsDIR)/calendar.compu $(calendarsDIR)/calendar.histo \
  $(calendarsDIR)/calendar.holid $(calendarsDIR)/calendar.judai \
  $(calendarsDIR)/calendar.music $(calendarsDIR)/calendar.ushol

datesDIR = dates#
datesFILES = $(datesDIR)/ancient $(datesDIR)/can_holiday $(datesDIR)/celtic \
  $(datesDIR)/computing $(datesDIR)/events $(datesDIR)/events1 \
  $(datesDIR)/events2 $(datesDIR)/events3 $(datesDIR)/events4 \
  $(datesDIR)/events5 $(datesDIR)/events6 $(datesDIR)/gdead \
  $(datesDIR)/hawaii $(datesDIR)/literature $(datesDIR)/lives \
  $(datesDIR)/lives1 $(datesDIR)/lives2 $(datesDIR)/lives3 \
  $(datesDIR)/lives4 $(datesDIR)/lives5 $(datesDIR)/lives6 $(datesDIR)/lotr \
  $(datesDIR)/movies $(datesDIR)/music $(datesDIR)/radio $(datesDIR)/sfo \
  $(datesDIR)/space $(datesDIR)/sports $(datesDIR)/television \
  $(datesDIR)/usa_holiday $(datesDIR)/usa_other $(datesDIR)/usa_states \
  $(datesDIR)/witchcraft $(datesDIR)/world
datesMISCFILES = $(datesDIR)/CREDITS $(datesDIR)/README

datascriptDIR = scripts#
datascriptFILES = $(datascriptDIR)/cal2gcal.awk $(datascriptDIR)/cal2gcal.pl \
  $(datascriptDIR)/ct2gcal.awk $(datascriptDIR)/ct2gcal.pl

DISTFILES = $(dataMISCFILES) $(calendarFILES) $(datesFILES) $(datesMISCFILES) $(datascriptFILES)

#### End of package specific make variable definition section. ####



#### Start of default targets section. ####

all: default

default check installbin install-strip clean id ID tags TAGS:
	@echo "Nothing to be done for \`$@'"

#### End of default targets section. ####



#### Start of install section. ####

install: installdirs installdata installdates
	@echo "All installs in $(subdir) done"

installdirs: $(top_srcdir)/mkinstalldirs
	$(SHELL) $(top_srcdir)/mkinstalldirs $(homedir)
	if test -n "$(AWK)" || test -n "$(PERL)"; \
	then \
	  $(SHELL) $(top_srcdir)/mkinstalldirs $(datesdir); \
	else \
	  echo "Dates files will not be installed because \`awk' and \`perl'"; \
	  echo "are missing.  Therefore, creation of dates file directory unnecessary"; \
	fi

installdata: $(srcdir)/gcalrc installdirs
	@echo "Installing \`$(srcdir)/gcalrc' to \`$(homedir)/.gcalrc'"
	$(INSTALL_DATA) $(srcdir)/gcalrc $(homedir)/.gcalrc
	@echo "Data file \`.gcalrc' installed"

#
# Only if a reminder/appointment file which we have to install,
# is NOT in the library directory, then we will install it.
# This is because the complete installation process is rather slow.
# Prefering perl!
#
installdates: $(calendarsFILES) $(datesMISCFILES) $(datesFILES) installdirs
	if test -n "$(AWK)" || test -n "$(PERL)"; \
	then \
	  we_installed=no; \
	  for file in $(calendarsFILES); \
	  do \
	    install_target=$(datesdir)/`echo $$file | sed -e 's/$(calendarsDIR)\///'`; \
	    if test ! -f "$$install_target"; \
	    then \
	      if test -n "$(PERL)"; \
	      then \
	        echo "$(PERL) installs \`$$file' to \`$$install_target'"; \
	        $(PERL) $(datascriptDIR)/cal2gcal.pl $$file > $$install_target; \
	      else \
	        echo "$(AWK) installs \`$$file' to \`$$install_target'"; \
	        $(AWK) -f $(datascriptDIR)/cal2gcal.awk $$file > $$install_target; \
	      fi; \
	      if test -n "$(SRCPERMS)"; \
	      then \
	        chmod $(SRCPERMS) $$install_target; \
	      else \
	        chmod $(SRCPERMS2) $$install_target; \
	      fi; \
	      we_installed=yes; \
	    fi; \
	  done; \
	  for file in $(datesFILES); \
	  do \
	    install_target=$(datesdir)/`echo $$file | sed -e 's/$(datesDIR)\///'`; \
	    if test ! -f "$$install_target"; \
	    then \
	      if test -n "$(PERL)"; \
	      then \
	        echo "$(PERL) installs \`$$file' to \`$$install_target'"; \
	        $(PERL) $(datascriptDIR)/ct2gcal.pl $$file > $$install_target; \
	      else \
	        echo "$(AWK) installs \`$$file' to \`$$install_target'"; \
	        $(AWK) -f $(datascriptDIR)/ct2gcal.awk $$file > $$install_target; \
	      fi; \
	      if test -n "$(SRCPERMS)"; \
	      then \
	        chmod $(SRCPERMS) $$install_target; \
	      else \
	        chmod $(SRCPERMS2) $$install_target; \
	      fi; \
	      we_installed=yes; \
	    fi; \
	  done; \
	  for file in $(datesMISCFILES); \
	  do \
	    install_target=$(datesdir)/`echo $$file | sed -e 's/$(datesDIR)\///'`; \
	    if test ! -f "$$install_target"; \
	    then \
	      echo "Installing \`$$file' to \`$$install_target'"; \
	      $(INSTALL_DATA) $$file $$install_target; \
	      we_installed=yes; \
	    fi; \
	  done; \
	  if test "$$we_installed" = "yes"; \
	  then \
	    if test -n "$(BINPERMS)"; \
	    then \
	      chmod $(BINPERMS) $(datesdir); \
	    else \
	      chmod $(BINPERMS2) $(datesdir); \
	    fi; \
	    echo "Dates files installed"; \
	  else \
	    echo "Installation of dates files unnecessary,"; \
	    echo "already existent. You have to erase these files first"; \
	  fi; \
	else \
	  echo "Unable to install dates files, missing \`awk' and \`perl'"; \
	fi

uninstall:
	@echo "Please wait..."
	rm -f $(homedir)/.gcalrc
	if test -n "$(AWK)" || test -n "$(PERL)"; \
	then \
	  for file in $(calendarsFILES); \
	  do \
	    uninstall_target=$(datesdir)/`echo $$file | sed -e 's/$(calendarsDIR)\///'`; \
	    rm -f $$uninstall_target; \
	  done; \
	  for file in $(datesFILES) $(datesMISCFILES); \
	  do \
	    uninstall_target=$(datesdir)/`echo $$file | sed -e 's/$(datesDIR)\///'`; \
	    rm -f $$uninstall_target; \
	  done; \
	fi
	@echo "Appointment/reminder files of distribution uninstalled"

#### End of install section. ####



#### Start of clean section. ####

distclean:
	rm -f Makefile

mostlyclean: distclean

realclean: distclean
	rm -f id ID tags TAGS

maintainer-clean: realclean
	@echo "This command is intended for maintainers to use;"
	@echo "it deletes files that may require special tools to rebuild."

#### End of clean section. ####



dist dist-gcal distzip distzoo distlha distshar: Makefile $(DISTFILES)

Makefile: Makefile.in ../config.status
	cd .. \
	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
	       $(SHELL) ./config.status



# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

# End of file
