#
# (C) Copyright 1992, ..., 2007 the "DOSEMU-Development-Team".
#
# for details see file COPYING.DOSEMU in the DOSEMU distribution
#
# Makefile.conf.in for DOSEMU
#
# This file is included by all Makefiles

DOSBIN = dosemu.bin

prefix:=@prefix@
bindir:=@bindir@
sysconfdir:=@sysconfdir@
libdir:=@libdir@
datarootdir:=@datarootdir@
datadir:=@datadir@
mandir:=@mandir@
docdir:=@docdir@
syshdimagedir:=@syshdimagedir@
x11fontdir:=@x11fontdir@
fdtarball:=@fdtarball@
abs_top_srcdir:=@abs_top_srcdir@
ifeq (0,${MAKELEVEL})
    SUBDIR := $(subst $(shell cd $(top_builddir) && pwd)/src/,,$(shell pwd))
    # don't use built-in rules and variables for faster builds
    MAKEFLAGS += -rR
endif

@SET_MAKE@

INCDIR:=@INCDIR@
ifeq ("$(wildcard $(top_builddir)/*.ac)","$(top_builddir)/configure.ac")
  top_srcdir:=$(top_builddir)
  srcdir:=.
else
  top_srcdir:=$(abs_top_srcdir)
  ifeq ("$(top_builddir)",".")
    srcdir:=$(abs_top_srcdir)
  else
    srcdir:=$(abs_top_srcdir)/src/$(SUBDIR)
  endif
  INCDIR += -I${top_srcdir}/src/include 
endif

CFLAGS:=@CFLAGS@
ALL_CFLAGS:=@DOSEMU_CFLAGS@ ${CFLAGS}
ASFLAGS:=@ASFLAGS@
CPPFLAGS:=@CPPFLAGS@
ALL_CPPFLAGS:=@DOSEMU_CPPFLAGS@ ${INCDIR} ${CPPFLAGS}
X_CPPFLAGS:=@X_CFLAGS@
SLANGINC:=@SLANGINC@
LDFLAGS:=@LDFLAGS@
ALL_LDFLAGS:=@DOSEMU_LDFLAGS@ ${LDFLAGS}
DOSBIN_LDFLAGS:=@DOSBIN_LDFLAGS@
LIBS:=@LIBS@
X_LIBS:=@X_LIBS@
SLANGLIB:=@SLANGLIB@
GPMLIB:=@GPMLIB@
CC:=@CC@
CPP:=@CPP@
LD:=@CC@

YACC:=@YACC@
# NOTE: we really need bison, yacc won't work any more
#YACC=bison -y
LEX:=@LEX@

@X_SUPPORT@

# This gets defined even if we chose via ./include/config.h NOT to
# use the debugger
DEBUGGER:=@DEBUGGER@

@USE_MHPDBG@
@USE_SBEMU@
OPTIONALSUBDIRS := @OPTIONALSUBDIRS@
PLUGINSUBDIRS := @PLUGINSUBDIRS@
REQUIRED:=@REQUIRED@

OS=@CONFIG_HOST@
RANLIB:=@RANLIB@

@ASPI_SUPPORT@
@USE_DL_PLUGINS@
@USE_APBUILD@
@USE_SVGALIB@
@USE_GPM@
@USE_ALSA@
ALSALIB:=@ALSALIB@
@USE_SNDFILE@
SNDFLIB:=@SNDFLIB@
@USE_FLUIDSYNTH@
FLUSLIB:=@FLUSLIB@
@USE_PTHREADS@
@X86_EMULATOR@

INSTALL:=@INSTALL@
VPATH:=$(srcdir)
REALTOPDIR:=$(top_srcdir)
SRCPATH:=$(top_srcdir)/src

PACKAGE_VERSION:=$(shell cd $(top_srcdir) && ./getversion)
PACKAGE_VERSION_SPACES:=$(subst ., ,$(PACKAGE_VERSION))
PACKAGE_VERSION_SPACES:=$(subst -, ,$(PACKAGE_VERSION_SPACES))
VERSION:=$(word 1, $(PACKAGE_VERSION_SPACES))
SUBLEVEL:=$(word 2, $(PACKAGE_VERSION_SPACES))
PATCHLEVEL1:=$(word 3, $(PACKAGE_VERSION_SPACES))
PATCHLEVEL2:=$(word 4, $(PACKAGE_VERSION_SPACES))
ifeq (3,$(words $(PACKAGE_VERSION_SPACES)))
  PATCHLEVEL2=0
endif
ifeq (5,$(words $(PACKAGE_VERSION_SPACES)))
  PATCHLEVEL2=0
endif
PATCHLEVEL:=$(PATCHLEVEL1).$(PATCHLEVEL2)
ifeq "$(PATCHLEVEL2)" "0"
  PACKETNAME:=dosemu-$(VERSION).$(SUBLEVEL).$(PATCHLEVEL1)
else
  PACKETNAME:=dosemu-$(VERSION).$(SUBLEVEL).$(PATCHLEVEL)
endif
THISVERSION:=$(VERSION).$(SUBLEVEL).$(PATCHLEVEL)
BINPATH:=$(top_builddir)/$(THISVERSION)
RELEASE_DATE:=$(shell cd $(top_srcdir) && ./getversion -d)

ifdef USE_DL_PLUGINS
DL_CFLAGS:=-fPIC
else
LIBS:=$(LIBS) $(SLANGLIB) $(X_LIBS) $(GPMLIB) $(ALSALIB) $(SNDFLIB)
-include $(top_builddir)/src/plugin/*/Makefile.conf
endif
