From 62efc91020789d88fb4796a943801fadfa7f15c9 Mon Sep 17 00:00:00 2001 From: mar Date: Thu, 10 Jan 1991 17:50:44 +0000 Subject: [PATCH] new version --- util/imake/Makefile | 44 ++++++----- util/imake/ccimake.c | 21 ++++++ util/imake/imake.c | 169 +++++++++++++++++++++++++------------------ 3 files changed, 145 insertions(+), 89 deletions(-) create mode 100644 util/imake/ccimake.c diff --git a/util/imake/Makefile b/util/imake/Makefile index 22daa9be..4c46c67b 100644 --- a/util/imake/Makefile +++ b/util/imake/Makefile @@ -1,45 +1,51 @@ # -# WARNING! This is NOT an automatically generated Makefile! -# This is hand-crafted as a bootstrap, may need editing for your system. +# WARNING WARNING WARNING WARNING WARNING WARNING WARNING +# +# This is NOT an automatically generated Makefile! It is hand-crafted as a +# bootstrap, may need editing for your system. The BOOTSTRAPCFLAGS variable +# may be given at the top of the build tree for systems that do not define +# any machine-specific preprocessor symbols. +# +BOOTSTRAPCFLAGS = + CDEBUGFLAGS = -O + CFLAGS = $(BOOTSTRAPCFLAGS) $(CDEBUGFLAGS) SHELL = /bin/sh RM = rm -f MAKE = make RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a \ tags TAGS make.log - LN = cp - DESTDIR = - SRCDIR = /mit/kerberos/src - SOURCES = ${SRCDIR}/util/imake/imake.c ${SRCDIR}/util/imake/ccflags.c ${SRCDIR}/util/imake/Makefile + NPROC = 1 -all: imake +imake:: + @echo "making imake with BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS)" -imake: ccflags imake.c - $(CC) -o imake imake.c `./ccflags` +imake:: ccimake imake.c + $(CC) -o imake $(CFLAGS) imake.c `./ccimake` -ccflags: ccflags.c - $(CC) -o ccflags ccflags.c +ccimake: ccimake.c + $(CC) -o ccimake $(CFLAGS) ccimake.c relink: $(RM) imake $(MAKE) $(MFLAGS) imake clean: - $(RM) ccflags imake + $(RM) ccimake imake $(RM_CMD) \#* depend: -Makefile: + +# for manual use + +Makefile: imake + imake -DNEWTOP=../ tags: install: -Makefiles: +install.man: -config: $(SOURCES) - -mkdir $(DESTDIR)/util/imake - for i in $(SOURCES); do \ - $(RM) ${DESTDIR}/util/imake/`basename $$i`; \ - $(LN) $$i ${DESTDIR}/util/imake/`basename $$i`; done +Makefiles: diff --git a/util/imake/ccimake.c b/util/imake/ccimake.c new file mode 100644 index 00000000..6f13d64c --- /dev/null +++ b/util/imake/ccimake.c @@ -0,0 +1,21 @@ +/* + * $XConsortium: ccimake.c,v 1.12 89/10/16 12:09:23 jim Exp $ + * + * Warning: This file must be kept as simple as posible so that it can + * compile without any special flags on all systems. Do not touch it unless + * you *really* know what you're doing. Make changes in imakemdep.h, not here. + */ + +#define CCIMAKE /* only get imake_ccflags definitions */ +#include "imakemdep.h" /* things to set when porting imake */ + +#ifndef imake_ccflags +#define imake_ccflags "-O" +#endif + +main() +{ + write(1, imake_ccflags, sizeof(imake_ccflags) - 1); + exit(0); +} + diff --git a/util/imake/imake.c b/util/imake/imake.c index 6127b70a..3ac234cc 100644 --- a/util/imake/imake.c +++ b/util/imake/imake.c @@ -1,3 +1,14 @@ +/*****************************************************************************\ + * * + * Porting Note * + * * + * Add the value of BOOTSTRAPCFLAGS to the cpp_argv table so that it will be * + * passed to the template file. * + * * +\*****************************************************************************/ + + + /* * * Copyright 1985, 1986, 1987 by the Massachusetts Institute of Technology @@ -14,7 +25,7 @@ * this software for any purpose. It is provided "as is" * without express or implied warranty. * - * $Header$ + * $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $ * $Locker$ * * Author: @@ -24,25 +35,25 @@ * * imake: the include-make program. * - * Usage: imake [-Idir] [-Ddefine] [-T] [-f imakefile ] [-s] [-v] [make flags] + * Usage: imake [-Idir] [-Ddefine] [-T] [-f imakefile ] [-s] [-e] [-v] [make flags] * - * Imake takes a template makefile (Imake.template) and runs cpp on it - * producing a temporary makefile in /usr/tmp. It then runs make on + * Imake takes a template makefile (Imake.tmpl) 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 Imake.template - * -s show. Show the produced makefile on the standard + * than Imake.tmpl + * -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 - * "." and "/usr/lib/local/imake.include". + * 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. @@ -64,10 +75,10 @@ * 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.template. Call this