#ifdef BandAidCompiler
#include BandAidCompiler
#endif

#if UnalignedReferencesAllowed
  ALIGN_DEFINES = -DUNALIGNED
#endif
    STD_DEFINES = LibraryDefines $(ALIGN_DEFINES)
    APP_DEFINES = -DXAPPLOADDIR=\"$(XAPPLOADDIR)$(PATHSEP)\"
     DB_DEFINES = -DERRORDB=\"$(LIBDIR)/XtErrorDB\"
    CDEBUGFLAGS = LibraryCDebugFlags
       INCLUDES = -I. -I$(XLIBSRC) -I$(TOP) -I$(TOP)/X11
   INSTALLFLAGS = $(INSTINCFLAGS)
       LINTLIBS = $(LINTXLIB)

HEADERS = \
	Composite.h \
	CompositeP.h \
	Constraint.h \
	ConstrainP.h \
	Core.h \
	CoreP.h \
	Intrinsic.h \
	IntrinsicP.h \
	Quarks.h \
	Selection.h \
	Shell.h \
	ShellP.h \
	StringDefs.h \
	Vendor.h \
	VendorP.h

SRCS = \
	Alloc.c \
	ArgList.c \
	Callback.c \
	CompObj.c \
	Composite.c \
	Constraint.c \
	Convert.c \
	Converters.c \
	Core.c \
	Create.c \
	Destroy.c \
	Display.c \
	Error.c \
	Event.c \
	GCManager.c \
	Geometry.c \
	Initialize.c \
	Intrinsic.c \
	Manage.c \
	NextEvent.c \
	Object.c \
	Popup.c \
	RectObj.c \
	Resources.c \
	Selection.c \
	Shell.c \
	TMparse.c \
	TMstate.c \
	Vendor.c \
	WindowObj.c

OBJS = \
	Alloc.o \
	ArgList.o \
	Callback.o \
	CompObj.o \
	Composite.o \
	Constraint.o \
	Convert.o \
	Converters.o \
	Core.o \
	Create.o \
	Destroy.o \
	Display.o \
	Error.o \
	Event.o \
	GCManager.o \
	Geometry.o \
	Initialize.o \
	Intrinsic.o \
	Manage.o \
	NextEvent.o \
	Object.o \
	Popup.o \
	RectObj.o \
	Resources.o \
	Selection.o \
	Shell.o \
	TMparse.o \
	TMstate.o \
	Vendor.o \
	WindowObj.o

all::

#if DebugLibXt && ProfileLibXt
DebuggedAndProfiledLibraryObjectRule()
SpecialDebuggedAndProfiledObjectRule(Initialize.o,$(ICONFIGFILES),$(APP_DEFINES))
SpecialDebuggedAndProfiledObjectRule(Error.o,$(ICONFIGFILES),$(DB_DEFINES))
#else
# if DebugLibXt
DebuggedLibraryObjectRule()
SpecialDebuggedObjectRule(Initialize.o,$(ICONFIGFILES),$(APP_DEFINES))
SpecialDebuggedObjectRule(Error.o,$(ICONFIGFILES),$(DB_DEFINES))
# else
#  if ProfileLibXt
ProfiledLibraryObjectRule()
SpecialProfiledObjectRule(Initialize.o,$(ICONFIGFILES),$(APP_DEFINES))
SpecialProfiledObjectRule(Error.o,$(ICONFIGFILES),$(DB_DEFINES))
#  else
NormalLibraryObjectRule()
SpecialObjectRule(Initialize.o,$(ICONFIGFILES),$(APP_DEFINES))
SpecialObjectRule(Error.o,$(ICONFIGFILES),$(DB_DEFINES))
#  endif
# endif
#endif

#if defined(SunArchitecture) && SunOSPlatform && OSMajorVersion >= 4
/* the Sun C optimizer is broken on just this file */
TMparse.o:  TMparse.c
	$(MAKE) $(MFLAGS) CDEBUGFLAGS= nooptTMparse.o
	mv nooptTMparse.o TMparse.o
	$(RM) nooptTMparse.c

nooptTMparse.c:
	$(LN) TMparse.c nooptTMparse.c

clean::
	$(RM) nooptRMparse.c
#endif

NormalLibraryTarget(Xt,$(OBJS))
LintLibraryTarget(Xt,$(SRCS))
InstallLibrary(Xt,$(USRLIBDIR))
InstallLintLibrary(Xt,$(LINTLIBDIR))

#if ProfileLibXt
ProfiledLibraryTarget(Xt,$(OBJS))
InstallLibrary(Xt_p,$(USRLIBDIR))
#endif

#if DebugLibXt
DebuggedLibraryTarget(Xt,$(OBJS))
#endif

InstallMultiple($(HEADERS),$(INCDIR))

DependTarget()

NormalLintTarget($(SRCS))
