/**/#	Copyright (c) 1990, 1991, 1992, 1993, 1994 Novell, Inc. All Rights Reserved.
/**/#	Copyright (c) 1993 Novell, Inc. All Rights Reserved.
/**/#	  All Rights Reserved

/**/#	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF Novell Inc.
/**/#	The copyright notice above does not evidence any
/**/#	actual or intended publication of such source code.

#ident	"@(#)r5config:common/X11R5/config/Imakefile	1.18"

/*
 * $XConsortium: Imakefile,v 1.14 91/12/02 11:24:14 rws Exp $
 * 
 * This is used to recreate imake.  Makefile.ini is used to generate imake
 * the first time.
 */
 OBJS = imake.o
 SRCS = imake.c
 PROGRAM = imake

DEPLIBS = 
HEADERS = imakemdep.h 
CFFILES = $(HEADERS) *.rules *.tmpl site.def *.cf
CPP_PROGRAM = CppCmd
INCLUDES = -I$(BUILDINCDIR)
DEFINES = $(SIGNAL_DEFINES) $(BOOTSTRAPCFLAGS)
STD_DEFINES = -DSVR4 -DI18N $(MEMUTILDEF)

#ifdef MacIIArchitecture
XBSDLIB = /**/
#endif

#undef ImakeDependency
#define ImakeDependency(dummy) @@\
Makefile::  imake

LOCAL_LIBRARIES =
EXTRA_LIBRARIES =
LDLIBS =
/*
 * If you are building the source in a cross, we need to build two versions
 * imake binary - the cross-env version is needed to generate the Makefiles
 * where as the imake_nat is needed for packaging, because the final
 * package needs a imake binary for the target architecture
 * imake_nat is installed as /usr/X/bin/imake by packaging (ie: pkgadd)
 *
 * remove the imake.o after making the executable, "imake"; this is needed
 * so that imake is not linked with a wrong version of imake.o
 */
all::
	$(RM) imake_nat.c
	$(LN) imake.c imake_nat.c

all:: imake imake_nat

imake:: imake.o
	$(RM) $@
	$(HCC) -o $@ imake.o $(HLDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS)  $(EXTRA_LOAD_FLAGS)

imake.o: imake.c
	$(HCC) -c $(HCFLAGS) -DCPP_PROGRAM=\"$(CPP_PROGRAM)\" imake.c
	
imake_nat: imake_nat.o
	$(RM) $@
	$(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)

imake_nat.o: imake.c
	$(CC) -o imake_nat.o -c $(CFLAGS) -DCPP_PROGRAM=\"/usr/ccs/lib/cpp\" imake.c

install:: all
	$(INSTALL) -c $(INSTPGMFLAGS) imake $(DESTDIR)$(BINDIR)
	$(INSTALL) -c $(INSTPGMFLAGS) imake_nat $(DESTDIR)$(BINDIR)

BuildIncludes($(HEADERS),config,..)

InstallMultipleDestFlags(install,$(CFFILES),$(CONFIGDIR),$(INSTDATFLAGS))

depend::

clean::
	$(RM) ccimake imake imake_nat imake_nat.c
