/* Imakefile for pbmplus tools.
 *
 * Copyright (C) 1991 by Rainer Klute.
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose and without fee is hereby granted, provided
 * that the above copyright notice appear in all copies and that both that
 * copyright notice and this permission notice appear in supporting
 * documentation.  This software is provided "as is" without express or
 * implied warranty.
 */

#include <Pbmplus.tmpl>

#define IHaveSubdirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'

#if BuildLibTiff
SUBDIRS = TiffDir PbmDir PgmDir PpmDir PnmDir
#else
SUBDIRS = PbmDir PgmDir PpmDir PnmDir
#endif

NETPBMVER	= 20may1999

all::
	stamp-date

MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))

World::
	@echo ""
	@echo "Building PBMPLUS"
	@echo ""
	@date
	@echo ""
	$(MAKE) $(MFLAGS) Makefiles
	$(MAKE) $(MFLAGS) clean
	$(MAKE) $(MFLAGS) includes
	$(MAKE) $(MFLAGS) depend
	$(MAKE) $(MFLAGS)
	@echo ""
	@date
	@echo ""
	@echo "Full build of PBMPLUS complete."
	@echo ""

Everything::
	@echo ""
	@echo "Rebuilding PBMPLUS"
	@echo ""
	@date
	@echo ""
	$(MAKE) $(MFLAGS) Makefiles
	$(MAKE) $(MFLAGS) includes
	$(MAKE) $(MFLAGS) depend
	$(MAKE) $(MFLAGS)
	@echo ""
	@date
	@echo ""
	@echo "Rebuild of PBMPLUS complete."
	@echo ""

MKFILES	= Imakefile SMakefile Pbmplus.tmpl
SRFILES	= compile.h pbmplus.h version.h \@@\
	  libpbm.h libpgm.h libppm.h pbm.h pgm.h pnm.h ppm.h tiff.h
REFILES	= README README.15nov1997 README.1mar1994 README.20may1999 \@@\
	  README.CONFOCAL README.VMS netpbm-1mar1994.p1.README
SHFILES	= compat.csh compat.ksh
MIFILES	= CHANGES COPYRIGHT FORMATS MSDOS OTHER.SYSTEMS magic \@@\
	  mantocat scoptions stamp-date stamp-date.amiga TODO \@@\
	  Netpbm Netpbm.Changes Netpbm.programming doslistmake dosnames
SBDRS	= amiga libtiff pbm pgm pnm ppm vms

distr::
	rm -f netpbm-$(NETPBMVER).tar/**/*
	tar cvf netpbm-$(NETPBMVER).tar \@@\
		$(MKFILES) \@@\
		$(SRFILES) \@@\
		$(REFILES) \@@\
		$(SHFILES) \@@\
		$(MIFILES) \@@\
		$(SBDRS)
	rm -rf netpbm-$(NETPBMVER)
	mkdir netpbm-$(NETPBMVER)
	cd netpbm-$(NETPBMVER); tar xvf ../netpbm-$(NETPBMVER).tar; cd ..
	rm -f netpbm-$(NETPBMVER).tar
	tar cvf netpbm-$(NETPBMVER).tar netpbm-$(NETPBMVER)
	rm -rf netpbm-$(NETPBMVER)
	gzip netpbm-$(NETPBMVER).tar

#if InstallIncludes
InstallMultipleFlags(pbmplus.h,$(PBMPLUSDIR)$(PBMPLUSINCDIR),$(INSTINCFLAGS))
#endif
