/*****************************************************************************\ BASED ON: $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $ * * * Porting Note * * * * Add the value of BOOTSTRAPCFLAGS to the cpp_argv table (in jmakemdep.h) * * so that it will be passed to the template file. * * * \*****************************************************************************/ /* * * Copyright 1985, 1986, 1987 by the Massachusetts Institute of Technology * * 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, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. * * Original Author: * Todd Brunhoff * Tektronix, inc. * While a guest engineer at Project Athena, MIT * * jmake: the include-make program. * * Usage: jmake [-Idir] [-Ddefine] [-T] [-f jmakefile ] [-s] [-e] [-v] [make flags] * * Jmake takes a template makefile (TEMPLATE.jm) and runs cpp on it * producing a temporary makefile in /tmp. It then runs make on * this pre-processed makefile. * Options: * -D define. Same as cpp -D argument. * -I Include directory. Same as cpp -I argument. * -T template. Designate a template other * than TEMPLATE.jm * -s[F] show. Show the produced makefile on the standard * output. Make is not run is this case. If a file * argument is provided, the output is placed there. * -e[F] execute instead of show; optionally name Makefile F * -v verbose. Show the make command line executed. * * Environment variables: * * JMAKEINCLUDE Include directory to use in addition to "." * JMAKECPP Cpp to use instead of /lib/cpp * JMAKEMAKE make program to use other than what is * found by searching the $PATH variable. * Other features: * jmake reads the entire cpp output into memory and then scans it * for occurences of "@@". If it encounters them, it replaces it with * a newline. It also trims any trailing white space on output lines * (because make gets upset at them). This helps when cpp expands * multi-line macros but you want them to appear on multiple lines. * * The macros MAKEFILE and MAKE are provided as macros * to make. MAKEFILE is set to jmake's makefile (not the constructed, * preprocessed one) and MAKE is set to argv[0], i.e. the name of * the jmake program. * * Theory of operation: * 1. Determine the name of the jmakefile from the command line (-f) * or from the content of the current directory (Jmakefile or jmakefile). * Call this . This gets added to the arguments for * make as MAKEFILE=. * 2. Determine the name of the template from the command line (-T) * or the default, TEMPLATE.jm. Call this