# -----------------------------------------------------------------------------

TOP = ..
include $(TOP)/mk/boilerplate.mk
-include config.mk

ifneq "$(AL_BUILD_PACKAGE)" "no"

# -----------------------------------------------------------------------------

SUBDIRS = include

ifeq "$(IncludeExampleDirsInBuild)" "YES"
SUBDIRS += examples
endif

ALL_DIRS = \
	Sound \
	Sound/OpenAL \
	Sound/OpenAL/AL \
	Sound/OpenAL/ALC \
	Sound/OpenAL/ALUT

PACKAGE_DEPS = base OpenGL

SRC_HC_OPTS += -Wall -fffi -Iinclude '-\#include "HsOpenAL.h"' -cpp

# WinDoze DLL hell
ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
SRC_HC_OPTS += -DCALLCONV=stdcall
SRC_HC_OPTS := $(subst -mno-cygwin,,$(SRC_HC_OPTS))
else
SRC_HC_OPTS += -DCALLCONV=ccall
endif

PACKAGE_CPP_OPTS += -DMAINTAINER=$(MAINTAINER)

SRC_HADDOCK_OPTS += -t "HOpenAL Libraries (OpenAL package)" -p prologue.txt

# -----------------------------------------------------------------------------

package.conf.inplace \
package.conf.installed \
Sound/OpenAL/AL/BasicTypes.$(way_)o \
Sound/OpenAL/AL/Format.$(way_)o \
Sound/OpenAL/ALC/BasicTypes.$(way_)o \
Sound/OpenAL/ALC/Errors.$(way_)o \
Sound/OpenAL/ALC/Queries.$(way_)o : include/HsOpenALConfig.h

endif

# -----------------------------------------------------------------------------

DIST_CLEAN_FILES += OpenAL.buildinfo config.cache config.status
LATE_DIST_CLEAN_FILES += config.mk

extraclean::
	$(RM) -rf autom4te.cache

# -----------------------------------------------------------------------------

include $(TOP)/mk/target.mk
