From 069da3cbd66c66454606f9d408b697e65f5684f6 Mon Sep 17 00:00:00 2001 From: Kim Kibum Date: Mon, 21 May 2012 17:59:48 +0900 Subject: Upload Tizen:Main source --- imake.c | 2214 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2214 insertions(+) create mode 100644 imake.c (limited to 'imake.c') diff --git a/imake.c b/imake.c new file mode 100644 index 0000000..3e67590 --- /dev/null +++ b/imake.c @@ -0,0 +1,2214 @@ + +/*************************************************************************** + * * + * Porting Note * + * * + * Add the value of BOOTSTRAPCFLAGS to the cpp_argv table so that it will * + * be passed to the template file. * + * * + ***************************************************************************/ +/* $XFree86: xc/config/imake/imake.c,v 3.63tsi Exp $ */ + +/* + * +Copyright (c) 1985, 1986, 1987, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + * + * Original Author: + * Todd Brunhoff + * Tektronix, inc. + * While a guest engineer at Project Athena, MIT + * + * imake: the include-make program. + * + * Usage: imake [-Idir] [-Ddefine] [-T template] [-f imakefile ] [-C Imakefile.c ] [-s] [-e] [-v] [make flags] + * + * Imake takes a template file (Imake.tmpl) and a prototype (Imakefile) + * and runs cpp on them producing a Makefile. It then optionally runs make + * on the Makefile. + * Options: + * -D define. Same as cpp -D argument. + * -U undefine. Same as cpp -U argument. + * -W warning. Same as cpp -W argument. + * -I Include directory. Same as cpp -I argument. + * -T template. Designate a template other + * than Imake.tmpl + * -f specify the Imakefile file + * -C specify the name to use instead of Imakefile.c + * -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: + * + * IMAKEINCLUDE Include directory to use in addition to "." + * IMAKECPP Cpp to use instead of /lib/cpp + * IMAKEMAKE make program to use other than what is + * found by searching the $PATH variable. + * Other features: + * imake 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. + * It also changes occurences of "XCOMM" to "#", to avoid problems + * with treating commands as invalid preprocessor commands. + * + * The macros MAKEFILE and MAKE are provided as macros + * to make. MAKEFILE is set to imake's makefile (not the constructed, + * preprocessed one) and MAKE is set to argv[0], i.e. the name of + * the imake program. + * + * Theory of operation: + * 1. Determine the name of the imakefile from the command line (-f) + * or from the content of the current directory (Imakefile or imakefile). + * 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, Imake.tmpl. Call this