/*
 * partain: from...
 *
 * $XConsortium: Jmakefile,v 1.7 89/12/12 12:37:28 jim Exp $
 * 
 * This is used to recreate jmake.  Makefile.BOOT is used to generate jmake
 * if there is no Makefile in this directory (i.e., the first time).
 */

#define IHaveSubdirs

/* just documents subdir */
#define NoAllTargetForSubdirs
#define NoInstallTargetForSubdirs
#define NoTagTargetForSubdirs

SUBDIRS = docs

/* ------------------------- */

SRCS_C = jmake.c ccjmake.c
DEPLIBS = 
HEADERS = jmakemdep.h 

JCONFIGFILES = $(HEADERS) TEMPLATE.jm \
		install-GEN.jm macros-GEN.jm \
		plat-DEF.jm plat-TRIGGERS.jm \
		plat-mipsriscos.jm plat-sun.jm plat-linux.jm plat-alpha.jm \
		site-DEF.jm site.jm \
		suffixes-GEN.jm utils-GEN.jm

DEFINES = $(SIGNAL_DEFINES)

all:: jmake jmkmf

MsubNeededHere(jmkmf)

/* override the usual rule */
#undef JmakeNeededHere
#define JmakeNeededHere(dummy) @@\
Makefile::  jmake

/* BUILDING =======================================================*/

BuildPgmFromCFiles(jmake,jmake.o,,)

/* modelled on X11R4's xmkmf (via DuBois) */
MsubMakefileDependentProgramScriptTarget(PerlCmd,jmkmf,jmkmf.prl,/*no flags*/,/*Makefile*/)

/* INSTALLATION ===================================================*/

INSTDATADIR_MKWORLD = $(INSTDATADIR)/mkworld

MakeDirectories(install,$(INSTBINDIR) $(INSTSCRIPTDIR) $(INSTDATADIR_MKWORLD))
InstallBinaryTarget(jmake,$(INSTBINDIR))

InstallMsubbedScriptTarget(PerlCmd,jmkmf,jmkmf.prl,$(INSTSCRIPTDIR))

InstallScriptTarget(jrestoredeps,$(INSTSCRIPTDIR))

jconfigfiles : $(JCONFIGFILES)
InstallTarget(jconfigfiles)
InstallMultNonExecTargets(jconfigfiles,$(JCONFIGFILES),$(INSTDATADIR_MKWORLD))

/* OTHER STUFF ===================================================*/
ExtraStuffToClean(ccjmake)

ExtraStuffToBeVeryClean( ccjmake $(STD_VERY_CLEAN) $(JCONFIGFILES) )

EtagsNeededHere(tags) /* need this to do "make tags" */
ClearTagsFile()
CTagsTarget( $(SRCS_C) $(JCONFIGFILES) )