#error The Imakefile is broken, please use the plain Makefiles

#if 0

XCOMM
XCOMM Imakefile for libhttp
XCOMM
XCOMM (C)Copyright 1995-1997 Ripley Software Development
XCOMM All Rights Reserved
XCOMM
XCOMM This file is part of the XmHTML Widget Library.
XCOMM
XCOMM See the file LICENSE for the full copyright statement.
XCOMM

XCOMM Include the XmHTML configuration file
#include "../XmHTML.cf"

XCOMM No need to change anything below this line
XCOMM

XCOMM SGI requires a specification file for shared library that we don't have
XCOMM (Irix below 6.2)
#if defined(SGIArchitecture) && !SystemV4 && HasSharedLibraries && \
	(OSMajorVersion <= 6) && (OSMinorVersion <= 4)
# undef SharedLibXmHTML
# undef NormalLibXmHTML
# define SharedLibXmHTML NO
# define NormalLibXmHTML YES
#endif

XCOMM Linux requires a specification file for a.out shared libraries that we
XCOMM don't have.
XCOMM
#if defined(LinuxArchitecture) && defined(UseElfFormat) && (UseElfFormat == NO)
# undef SharedLibXmHTML
# undef NormalLibXmHTML
# define SharedLibXmHTML NO
# define NormalLibXmHTML YES
#endif 

HTTPLIBDIR = XmHTMLLibDir
HTTPINCDIR = XmHTMLIncDir
    INCDIR = XmHTMLIncDir

XCOMM Get version numbering for shared libraries from the HTTP include file
#define _LIBRARY
#include "HTTP.h"

XCOMM Make translation from make variables to Imake variables
XCOMM (convention is that all uppercase are Make variables, mixed case are
XCOMM Imake variables)
#ifndef HTTPVERSION 
#define HTTPVERSION 0
#endif
#ifndef HTTPREVISION 
#define HTTPREVISION 1
#endif
#ifndef HTTPUPDATE_LEVEL
#define HTTPUPDATE_LEVEL 1
#endif

HTTPVersionNum  = HTTPVERSION
HTTPRevision    = HTTPREVISION
HTTPUpdateLevel = HTTPUPDATE_LEVEL

XCOMM I don't know whether or not X11R5/R4 image has got a Concat3.
XCOMM This works.
#if (ProjectX < 6)
SOHTTPLIBREV = $(HTTPVersionNum)./**/$(HTTPRevision)./**/$(HTTPUpdateLevel)
#else

#ifdef SGIArchitecture
SOHTTPLIBREV = Concat3(.$(HTTPVersionNum).,$(HTTPRevision).,$(HTTPUpdateLevel))
LDREQLIBS = -lc
#else
SOHTTPLIBREV = Concat3($(HTTPVersionNum).,$(HTTPRevision).,$(HTTPUpdateLevel))
#endif /* SGIArchitecture */

#endif

HEADERS = HTTP.h HTTPP.h 

SRCS = HTTP.c  cookie.c

OBJS = HTTP.o cookie.o

INSTALLFLAGS = $(INSTINCFLAGS)

#define DoSharedLib SharedLibXmHTML
#define DoNormalLib NormalLibXmHTML
#define DoDebugLib  DebugLibXmHTML

#if (ProjectX < 5)
STD_DEFINES = LibraryDefines
CDEBUGFLAGS = LibraryCDebugFlags
#else
# define LibName http
# define SoRev SOHTTPLIBREV
XCOMM dumb stuff to prevent generation of bad includes:: rule
# define LibHeaders foo
# include <Library.tmpl>
#endif

XCOMM
XCOMM Ruleset for doing make includes
XCOMM
LinkFileList(link-includes,$(HEADERS), ../include/XmHTML,../../http)

stamp-includes: link-includes
	touch link-includes
	touch $@

includes:: stamp-includes

XCOMM
XCOMM No stuff required when X revision >= 6, Library.tmpl does it for us
XCOMM

#if (ProjectX < 6)
# if (ProjectX < 5)

#  if DoSharedLib
SharedLibraryObjectRule()
NormalSharedLibraryTarget(http,$(SOHTTPLIBREV),$(OBJS))
InstallSharedLibrary(http,$(SOHTTPLIBREV),$(HTTPLIBDIR))
#   else /* No shared libs */
NormalLibraryObjectRule()
#  endif /* DoSharedLib */
NormalLibraryTarget(http,$(OBJS))
InstallLibrary(http,$(XPMLIBDIR))

#  if DoDebugLib
DebuggedLibObjCompile()
DebuggedLibraryTarget(http,$(OBJS))
#  endif /* DoDebugLib */

# else /* ProjectX == 5 */
LibraryObjectRule()

#  if DoSharedLib
SharedLibraryTarget(http,$(SOHTTPLIBREV),$(OBJS),shared,..)
InstallSharedLibrary(http,$(SOHTTPLIBREV),$(HTTPLIBDIR))
#  endif /* DoSharedLib */

#  if DoNormalLib
NormalLibraryTarget(http,$(OBJS))
InstallLibrary(http,$(HTTPLIBDIR))
#  endif /* DoNormalLib */

#  if DoDebugLib
DebuggedLibraryTarget(http,$(OBJS))
InstallLibrary(http_d,$(HTTPLIBDIR))
#  endif /* DoDebugLib */

# endif /* ProjectX < 5 */

#else /* X11R6 */
XCOMM make a compiler friendly target libhttp.so

#if DoSharedLib
install all:: lib$(LIBNAME).so 

#ifdef SGIArchitecture
lib$(LIBNAME).so: lib$(LIBNAME).so$(SOHTTPLIBREV)
	$(RM) $@
	ln -s $@$(SOHTTPLIBREV) $@
#else
lib$(LIBNAME).so: lib$(LIBNAME).so.$(SOHTTPLIBREV)
	$(RM) $@
	ln -s $@$(SOHTTPLIBREV) $@
#endif /* SGIArchitecture */

clean::
	$(RM) lib$(LIBNAME).so 
#endif /* DoSharedLib */

#endif /* ProjectX < 6 */

XCOMM rule to install header files
InstallMultiple($(HEADERS),$(HTTPINCDIR))

DependTarget()

XCOMM Special rule for creating a distribution with the barebone makefiles
XCOMM
distclean:: clean 
	$(RM) libhttp.so.*
	$(RM) -r debugger shared unshared
	$(RM) core *.out make.world *.bak *.last *.auto
	$(RM) stamp-includes link-includes
	$(CP) Makefile.org Makefile

#endif
