
/*
 * Change CONFIGROOTDIR if you are going to install imboot and the value
 * below is incorrect for your system.  (You need to create the directory,
 * too, if it doesn't exist.)
 */

CONFIGROOTDIR = /usr/local/lib/config

/*
 * For UNIX:
 * Change PERLPATH if perl is installed somewhere else on your system
 * Uncomment the UsePerlImboot #define below if you want to use the perl
 * version of imboot.  Comment it out if you want to use the sh version.
 * Uncomment the UsePerlXmkmf #define below if you want to use the perl
 * version of xmkmf.  Comment it out if you want to use the sh version.
 */

     PERLPATH = /usr/local/bin/perl

/*#define UsePerlImboot	YES*/

/*
 * For WinNT:
 * If you have NT perl installed, you can build and use the imdent script
 * and the perl version of imboot.  To do so, uncomment the next
 * WinNTHasPerl define below.  (This requires that you have perl and pl2bat
 * in your path.) Comment out the #define if you don't have perl.
 */

#define WinNTHasPerl YES

/*
 * Do not modify anything past this point
 */


         MSUB = msub

#ifndef UsePerlImboot
#define UsePerlImboot	NO
#endif

#ifndef UsePerlXmkmf
#define UsePerlXmkmf	NO
#endif

#ifndef WinNTHasPerl
#define WinNTHasPerl NO
#endif

/*
 * PerlScriptTarget() creates a perl script by running a template through
 * msub.  This works differently on UNIX and NT.
 *
 * For WinNT, the rule is a nop if perl is not available.  Otherwise a
 * script xxx.pl is used to construct a batch script xxx.bat using the
 * following steps:
 * - build xxx from xxx.pl
 * - run pl2bat to build xxx.bat from xxx
 */

#ifndef PerlScriptTarget
#ifdef Win32Architecture
#if WinNTHasPerl
#define PerlScriptTarget(dst,src,deps)					@@\
AllTarget(dst.bat)							@@\
dst.bat:: src deps							@@\
	ProgramTargetName($(MSUB:/=\)) src > dst			@@\
	pl2bat dst							@@\
	RemoveFile(dst)							@@\
clean::									@@\
	RemoveFile(dst.bat)						@@\
install:: install.dst.bat						@@\
InstallMultipleDestFlags(install.dst.bat,dst.bat,$(BINDIR),$(INSTBINFLAGS))
#else
#define PerlScriptTarget(dst,src,deps)					@@\
AllTarget(dst.bat)							@@\
dst.bat::								@@\
	@echo sorry, dst.bat cannot be built unless you have perl
#endif /* WinNTHasPerl */
#else /* !Win32Architecture */
#define PerlScriptTarget(dst,src,deps)					@@\
AllTarget(ProgramTargetName(dst))					@@\
ProgramTargetName(dst):: src deps					@@\
	ProgramTargetName($(MSUB)) src > ProgramTargetName(dst)		@@\
	chmod a+x ProgramTargetName(dst)				@@\
clean::									@@\
	RemoveFile(ProgramTargetName(dst))				@@\
install:: install.ProgramTargetName(dst)				@@\
InstallMultipleDestFlags(install.ProgramTargetName(dst),ProgramTargetName(dst),$(BINDIR),$(INSTBINFLAGS))
#endif /* Win32Architecture */
#endif /* PerlScriptTarget */
