/**/#	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	"@(#)olmisc:Imakefile	1.36.1.143"

/**/#	Copyright (c) 1990, 1991 UNIX System Laboratories, Inc.
/**/#	Copyright (c) 1988 AT&T
/**/#	  All Rights Reserved

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

#if Release5
#define DoNormalLib     NormalLibXol
#define DoSharedLib     SharedLibXol
#define DoDebugLib	DebugLibXol
#define DoProfileLib	ProfileLibXol
#include <Library.tmpl>
#include <sv4Lib.tmpl>

/**/# the next line can be removed if we decide not to support R4, Some files
/**/# have ifdef R5... so be careful about this one.
EXTRA_DEFINES = -DR5
#endif 

       INCLUDES = -I./bitmaps -I$(LIBSRC)
        LIBNAME = Olit
       LIBONAME = OlitO
       LIBMNAME = OlitM
 COMPAT_LIBNAME = Xol
            LIB = lib$(LIBNAME).a
          SHLIB = Xol
           SPEC = libXol
     IMPORTFILE = libXoli
   INSTALLFLAGS = -m 0644

 DnDLOC = $(LIBSRC)/DnD
DnDSRCS = OlDnDVCX.c OlDnDUtil.c
DnDOBJS = $(DnDSRCS:.c=.o)

HEADERS =\
        AbbrevButP.h \
        AbbrevButt.h \
	Accelerate.h \
	AcceleratP.h \
	AbbrevMenu.h \
	AbbrevMenP.h \
	AbbrevStac.h \
	array.h \
	Arrow.h \
	ArrowP.h \
	BaseWindow.h \
	BaseWindoP.h \
	buffutil.h \
	BulletinBP.h \
	BulletinBo.h \
	Button.h \
	ButtonP.h \
	ButtonStac.h \
	Caption.h \
	CaptionP.h \
	Category.h \
	CategoryP.h \
	ChangeBar.h \
	CheckBox.h \
	CheckBoxP.h \
	ColorChip.h \
	ColorObj.h \
	ColorObjP.h \
	ControlArP.h \
	ControlAre.h \
	Converters.h \
	ConvertersI.h \
	DisplayP.h \
	Dynamic.h \
	DynamicP.h \
	DynamicI.h \
	Error.h \
	EventObj.h \
	EventObjP.h \
	ExclusiveP.h \
	Exclusives.h \
        FButtonsP.h \
        FButtons.h \
	FCheckBox.h \
	FCheckBoxP.h \
	FColors.h \
	FColorsP.h \
	FExclusive.h \
	FExclusivP.h \
	FGraph.h \
	FGraphP.h \
	Flat.h \
	FlatP.h \
	FList.h \
	FListP.h \
	FMcomm.h \
	FNonexclus.h \
	FNonexcluP.h \
	Font.h \
	Footer.h \
	FooterP.h \
	FooterPane.h \
	FooterPanP.h \
	Form.h \
	FormP.h \
	FRowColumn.h \
	FRowColumP.h \
	Gauge.h \
	GaugeP.h \
	Handles.h \
	HandlesP.h \
	HandlesExP.h \
	Help.h	\
	HelpP.h	\
	IntegerFie.h \
	IntegerFiP.h \
	LayoutExtP.h \
	ListPane.h \
	ListPaneP.h \
	Mag.h	\
	MagP.h	\
	Manager.h \
	ManagerP.h \
	MenuButton.h \
	MenuButtoP.h \
	Menu.h \
	MenuP.h \
        MenuShellP.h \
        MenuShell.h \
        ModalP.h \
        Modal.h \
	NonexclusP.h \
	Nonexclusi.h \
	Notice.h \
	NoticeP.h \
	OblongButP.h \
	OblongButt.h \
	OlClients.h \
	OlClientsP.h \
	OlCursors.h \
	Olg.h \
	OlgP.h \
	OlStrings.h \
	OlXlibExt.h \
	OpenLook.h \
	OpenLookI.h \
	OpenLookP.h \
	Panes.h \
	PanesP.h \
	PopupMenu.h \
	PopupMenuP.h \
	PopupWindo.h \
	PopupWindP.h \
	Primitive.h \
	PrimitiveP.h \
	Pushpin.h \
	PushpinP.h \
	RectButtoP.h \
	RectButton.h \
	regexp.h \
	RubberTilP.h \
	RubberTile.h \
	Scrollbar.h \
	ScrollbarP.h \
	ScrolledWi.h \
	ScrolledWP.h \
	ScrollingL.h \
	ScrollingP.h \
	Slider.h \
	SliderP.h \
	SourceP.h \
	StaticText.h \
	StaticTexP.h \
	StepField.h \
	StepFieldP.h \
	StringList \
	strutil.h \
	Stub.h \
	StubP.h \
	Text.h \
	TextP.h \
	textbuff.h \
	TextEdit.h \
	TextEditP.h \
	TextField.h \
	TextFieldP.h \
	TextPane.h \
	TextPaneP.h \
	TextPosP.h \
	Util.h \
	VendorI.h \
	VirtualP.h \
	WSMcomm.h \
	xpm.h \
	_wchar.h

COMPAT_SRCS_1 =\
	Vendor.c /* Vendor.o must appear in both lib{Olit,Xol} */

COMPAT_SRCS_2 = /* avoid Vendor.o appeared twice in libXol.a */ \
	AbbrevMenu.c \
	Arrow.c \
	BaseWindow.c \
	Button.c \
	CheckBox.c \
	Compat.c \
	Display.c \
	Exclusives.c \
	FExclusive.c \
	FCheckBox.c \
	FNonexclus.c \
	Margin.c \
	MenuButton.c \
	Menu.c \
	Nonexclusi.c \
	OblongButt.c \
	OlGetFont.c \
	Packed.c \
	Pushpin.c \
	RectButton.c \
	SourceDsk.c \
	SourceStr.c \
	Text.c \
	TextPane.c \
	TextPos.c \
	Virtual.c

COMPAT_SRCS =\
	$(COMPAT_SRCS_1) \
	$(COMPAT_SRCS_2)

NEW_SRCS =\
        AbbrevButt.c \
	Action.c \
	Applic.c \
	array.c \
	BulletinBo.c \
	Caption.c \
	Category.c \
	ChangeBar.c \
	CheckRes.c \
	Click.c \
	ColorChip.c \
	ColorObj.c \
	ControlAre.c \
	Converters.c \
	Copy.c \
	CvtColor.c \
	Dynamic.c \
	DynResProc.c \
	DragNDrop.c \
	Error.c \
	EventObj.c \
	Extension.c \
        FButtons.c \
	FColors.c \
	FGraph.c \
	Flat.c \
	FlatCvt.c \
	FlatExpand.c \
	FlatPublic.c \
	FlatState.c \
	FList.c \
	FMcomm.c \
	Footer.c \
	FooterPane.c \
	Form.c \
	FRowColumn.c \
	Handles.c \
	HandlesExt.c \
	Help.c \
	IntegerFie.c \
	Accelerate.c \
	LayoutExt.c \
	List.c \
	ListPane.c \
	Mag.c \
	Manager.c \
	MaskArgs.c \
        MenuShell.c \
        Modal.c \
	Notice.c \
	ToolkitDB.c \
	OlCommon.c \
	OlCursors.c \
	OlDraw.c \
	OlEucToCt.c \
	OlGetRes.c \
	OlImStub.c \
	OlSetupIm.c \
	OlStrings.c \
	OlgAbbrev.c \
	OlgArrow.c \
	OlgAttr.c \
	OlgCheck.c \
	OlgInit.c \
	OlgLabel.c \
	OlgLines.c \
	OlgOblong.c \
	OlgPushpin.c \
	OlgRBox.c \
	OlgRect.c \
	OlgScrollb.c \
	OlgSlider.c \
	OlgShadow.c \
	OlGetDFont.c \
	OpenLook.c \
	Panes.c \
	PopupWindo.c \
	Primitive.c \
	References.c \
	Regions.c \
	RubberTile.c \
	Scrollbar.c \
	ScrolledWi.c \
	SetShellPo.c \
	Slider.c \
	StaticText.c \
	StepField.c \
	Stub.c \
	TextDisp.c \
	TextEdit.c \
	TextEPos.c \
	TextField.c \
	TextUtil.c \
	TextWrap.c \
	Traversal.c \
	Vendor.c \
	WSMcomm.c \
	buffutil.c \
	getwidth.c \
	regexp.c \
	strutil.c \
	textbuff.c \
	xpm.c \
	Xt.c

LIBO_SRCS = \
	FButtonsO.c \
	MenuShellO.c \
	ModalO.c \
	OlgAbbrevO.c \
	OlgCheckO.c \
	OlgOblongO.c \
	OlgScrollO.c \
	OlgSliderO.c \
	PopupWindO.c \
	ScrollbarO.c \
	SliderO.c \
	StaticTexO.c \
	TextEditO.c \
	TextFieldO.c

LIBM_SRCS = \
	FButtonsM.c \
	MenuShellM.c \
	ModalM.c \
	OlgAbbrevM.c \
	OlgCheckM.c \
	OlgOblongM.c \
	OlgScrollM.c \
	OlgSliderM.c \
	PopupWindM.c \
	ScrollbarM.c \
	SliderM.c \
	StaticTexM.c \
	TextEditM.c \
	TextFieldM.c

LIBO_OBJS = $(LIBO_SRCS:.c=.o)
LIBM_OBJS = $(LIBM_SRCS:.c=.o)

SRCS = $(COMPAT_SRCS) $(DnDSRCS) $(NEW_SRCS) $(LIBO_SRCS) $(LIBM_SRCS)
OBJS = $(DnDOBJS) $(NEW_SRCS:.c=.o)
COMPAT_OBJS_2 = $(COMPAT_SRCS_2:.c=.o)
COMPAT_OBJS = $(COMPAT_SRCS_1:.c=.o) $(COMPAT_OBJS_2)
DSHAREDOBJS = $(DnDOBJS) $(NEW_SRCS:.c=.o)
COMPAT_DSHAREDOBJS = $(COMPAT_SRCS_1:.c=.o) $(COMPAT_SRCS_2:.c=.o)

#ifdef SystemV4
SHAREDOBJS = $(DSHAREDOBJS)
COMPAT_SHAREDOBJS = $(COMPAT_DSHAREDOBJS)
#else
SHAREDOBJS = $(DSHAREDOBJS) libXoli.o Olinitfix.o
COMPAT_SHAREDOBJS = $(COMPAT_OBJS)
#endif

AROBJS=$(COMPAT_OBJS_2) $(OBJS) $(LIBO_OBJS) $(LIBM_OBJS)

#if Release5
#if DoNormalLib
#undef ObjectCompile
#define	ObjectCompile(options) $(RM) $@					@@\
	$(CC) -c $(CFLAGS) options -DARCHIVE $*.c
#endif

LibraryObjectRule()

#if DoSharedLib
#if DoNormalLib
SharedLibraryTarget($(LIBNAME),$(SOXOLREV),$(SHAREDOBJS),shared,..)
SharedLibraryTarget($(LIBONAME),$(SOOLITOREV),$(LIBO_OBJS),shared,..)
SharedLibraryTarget($(LIBMNAME),$(SOOLITMREV),$(LIBM_OBJS),shared,..)
SharedLibraryDepTarget($(COMPAT_LIBNAME),$(SOXOLREV),$(COMPAT_OBJS),shared,..,../lib$(LIBNAME).so)

FurSharedLibraryTarget($(LIBNAME),$(SOXOLREV),$(SHAREDOBJS),shared,..)
FurSharedLibraryTarget($(LIBMNAME),$(SOOLITMREV),$(LIBM_OBJS),shared,..)

#else
SharedLibraryTarget($(LIBNAME),$(SOXOLREV),$(SHAREDOBJS),.,.)
SharedLibraryTarget($(LIBONAME),$(SOOLITOREV),$(LIBO_OBJS),.,.)
SharedLibraryTarget($(LIBMNAME),$(SOOLITMREV),$(LIBM_OBJS),.,.)
SharedLibraryDepTarget($(COMPAT_LIBNAME),$(SOXOLREV),$(COMPAT_OBJS),.,.,lib$(LIBNAME).so)

FurSharedLibraryTarget($(LIBNAME),$(SOXOLREV),$(SHAREDOBJS),.,.)
FurSharedLibraryTarget($(LIBMNAME),$(SOOLITMREV),$(LIBM_OBJS),.,.)

#endif /* DoNormalLib */

InstallSharedLibrary($(LIBNAME),$(SOXOLREV),$(USRLIBDIR))
InstallSharedLibrary($(LIBONAME),$(SOXOLREV),$(USRLIBDIR))
InstallSharedLibrary($(LIBMNAME),$(SOXOLREV),$(USRLIBDIR))
InstallSharedLibrary($(COMPAT_LIBNAME),$(SOXOLREV),$(USRLIBDIR))

InstallFurLibrary($(LIBNAME),$(SOXOLREV),$(USRLIBDIR))
InstallFurLibrary($(LIBMNAME),$(SOXOLREV),$(USRLIBDIR))
#endif /* DoSharedLib */

#if DoNormalLib
NormalLibraryTarget($(COMPAT_LIBNAME),$(AROBJS))
InstallLibrary($(COMPAT_LIBNAME),$(USRLIBDIR))
#endif
#if DoProfileLib
ProfiledLibraryTarget($(COMPAT_LIBNAME),$(AROBJS))
InstallLibrary($(COMPAT_LIBNAME)_p,$(USRLIBDIR))
#endif

#else /* Release5 */

#undef MixedLibraryObjectRule
#define MixedLibraryObjectRule()					@@\
.c.o:									@@\
	@if [ -d shared ]; then \					@@\
		echo \\t$(CC) -c -KPIC $(CFLAGS) $<; \			@@\
		$(CC) -c -KPIC $(CFLAGS) $<; \ 				@@\
 		$(RM) shared/$*.o; \					@@\
 		echo \\t$(MV) $*.o shared; \				@@\
 		$(MV) $*.o shared; \					@@\
 	fi								@@\
 	$(CC) -c -DARCHIVE $(CFLAGS) $<

all:: XtStrings $(XolLIBS_TO_BUILD) $(OlitLIBS_TO_BUILD)
MixedLibraryObjectRule()

SharedLibraryTarget($(LIBNAME),$(SHAREDOBJS),,)
SharedLibraryTarget($(LIBONAME),$(LIBO_OBJS),,)
SharedLibraryTarget($(LIBMNAME),$(LIBM_OBJS),,)
SharedLibraryTarget($(COMPAT_LIBNAME),$(COMPAT_SHAREDOBJS),lib$(LIBNAME).so,)

FurSharedLibraryTarget($(LIBNAME),$(SHAREDOBJS),,)

ArchiveLibraryTarget($(COMPAT_LIBNAME),$(AROBJS))


#if NOTNEEDED
#ifdef SystemV4
install::
	$(RM) -r $(ROOT)/$(MACH)/usr/include/Xol
	$(LN) $(INCROOT)/Xol $(ROOT)/$(MACH)/usr/include/Xol
#endif  /* SystemV4 */
#endif

InstallLibrary($(LIBONAME),$(USRLIBDIR))
InstallLibrary($(LIBMNAME),$(USRLIBDIR))
InstallLibrary($(LIBNAME),$(USRLIBDIR))
InstallLibrary($(COMPAT_LIBNAME),$(USRLIBDIR))

#endif /* Release5 */

InstallLintLibrary(Xol,$(USRLIBDIR))

InstallMultiple(bitmaps/?*,$(USRLIBDIR)/bitmaps)
InstallMultiple(geometry/?*,$(USRLIBDIR)/Xol)
InstallMultiple(bitmaps/?*,$(INCROOT)/Xol/bitmaps)
InstallMultiple($(HEADERS),$(INCROOT)/Xol)
InstallMultiple(ol_locale_def,$(USRLIBDIR)/locale/C)
InstallMsgCatalog(dtlocaledef)
InstallAppDefaults(moolit)

XtStrings:: ../Xt/StringDefs.h ./strprep.awk ./strprep.sh
	chmod +x ./strprep.sh
	chmod +x ./strprep.awk
	./strprep.sh

LinkSourceFile(OlDnDVCX.c,$(DnDLOC))
LinkSourceFile(OlDnDUtil.c,$(DnDLOC))

includes:: $(DnDSRCS)

depend:: $(DnDSRCS)

clean::
	$(RM) $(DnDSRCS)
	$(RM) -r shared

LintLibraryTarget(Xol,$(SRCS))

/* Include this so source can be linted */
NormalLintTarget($(SRCS))

DependTarget()
