##############################################################################
# Makefile for HGL
# 
# This makefile is for GNU Make ver. 3.76 or later.
##############################################################################

# Basic configuration is handled by the configuration script.
# For further customization options, please look in the makefile specific to
# the Haskell system for which you are building HGL.

# This makefile handles configuration and declares all source files.
# Everything else (command definitions, paths, targets, ...) are done in
# Haskell-system-specific makefiles included from this one.
# It might be possible to break out some common functionality from these
# and place that in a file "defs.mk". Also, it might be desirable to
# move configuration stuff up to a top-level makefile which invokes this
# one recursively.

# This goes first to make it the default target.
.PHONY: all
all:

# ----------------------------------------------------------------------------
# Configuration
# ----------------------------------------------------------------------------

# Name of the package.
package_name = HGL

CONFIG=config.mk
ifneq ($(MAKECMDGOALS),config)
include $(CONFIG)
endif

$(CONFIG):
	./configure $(MAKE)

.PHONY: config
config:
	./configure $(MAKE)

# ----------------------------------------------------------------------------
# Source files
# ----------------------------------------------------------------------------

gc_sources = \
    Graphics_StdDIS.gc \
    X.gc \
    Xlib.gc \

hs_sources = \
    GraphicsCore.hs \
    GraphicsDC.hs \
    GraphicsEvent.hs \
    GraphicsEvents.hs \
    GraphicsFlag.hs \
    GraphicsFont.hs \
    GraphicsKey.hs \
    GraphicsPicture.hs \
    GraphicsRegion.hs \
    GraphicsTimer.hs \
    GraphicsUtils.hs \
    GraphicsWindow.hs \
    GraphicsWindows.hs \
    Graphics_Utilities.hs \
    SOEGraphics.hs \
    Win32Misc.hs

c_sources = auxiliaries.c

# ----------------------------------------------------------------------------
# Selection of system-specific Makefile
# ----------------------------------------------------------------------------

ifdef haskell_system
include Makefile.$(haskell_system)
endif
