Commit c247ff1a authored by Roland Levillain's avatar Roland Levillain

Improve the build system.

	* configure.ac (GHCFLAGS): New precious variable.
	(AM_GHCFLAGS): Rename as...
	(PACKAGE_GHCFLAGS): ...this.
	* src/Makefile.am: Adjust.
	(AM_GHCFLAGS): Rename as...
	(GHCFLAGS): ...this.
	(GHCCOMPILE): New variable.  Use it...
	(havm, static, profile): ...in these rules.
parent 0576623d
2012-03-07 Roland Levillain <roland@lrde.epita.fr>
Improve the build system.
* configure.ac (GHCFLAGS): New precious variable.
(AM_GHCFLAGS): Rename as...
(PACKAGE_GHCFLAGS): ...this.
* src/Makefile.am: Adjust.
(AM_GHCFLAGS): Rename as...
(GHCFLAGS): ...this.
(GHCCOMPILE): New variable. Use it...
(havm, static, profile): ...in these rules.
2012-03-07 Roland Levillain <roland@lrde.epita.fr>
s/GHC_FLAGS/GHCFLAGS/.
......
......@@ -26,14 +26,11 @@ HAVM_PROG([ghc], [6.4], [GHC], [Glasgow Haskell Compiler])
# Pick up the right package depending on GHC's version.
dnl $actual_version is set by HAVM_PROG
case "$actual_version" in
6.4*)
AM_GHCFLAGS='-package data'
;;
*) # >6.4
AM_GHCFLAGS='-package base'
;;
(6.4*) PACKAGE_GHCFLAGS='-package data';;
(*) PACKAGE_GHCFLAGS='-package base';;
esac
AC_SUBST([AM_GHCFLAGS])
AC_SUBST([PACKAGE_GHCFLAGS])
AC_ARG_VAR([GHCFLAGS], [Glasgow Haskell Compiler flags])
AM_MISSING_PROG([HAPPY], [happy])
......
......@@ -30,6 +30,8 @@ bin_SCRIPTS = havm
dist_noinst_DATA = $(havm_sources) Parse.hs
GHCCOMPILE = $(GHC) $(AM_GHCFLAGS) $(GHCFLAGS)
# -odir
#
# Non-interface output files are normally put in the same directory
......@@ -53,10 +55,10 @@ dist_noinst_DATA = $(havm_sources) Parse.hs
# Redirects all generated interface files into directory, instead of
# the default which is to place the interface file in the same
# directory as the source file.
GHCFLAGS = -i.:$(srcdir) -odir. -hidir. --make $(AM_GHCFLAGS)
AM_GHCFLAGS = -i.:$(srcdir) -odir. -hidir. --make $(PACKAGE_GHCFLAGS)
havm_dependencies = $(havm_sources) Config.hs Parse.hs
havm: $(havm_dependencies)
$(GHC) $(GHCFLAGS) $(srcdir)/Main.hs -o havm
$(GHCCOMPILE) $(srcdir)/Main.hs -o havm
# Static linking HAVM does not work on Mac OS X. See
# http://developer.apple.com/mac/library/qa/qa2001/qa1118.html for
......@@ -91,10 +93,10 @@ havm: $(havm_dependencies)
# installing a product that relies on statically linked code.
#
static: $(havm_dependencies)
$(GHC) $(GHCFLAGS) -optl-static -optl-pthread $(srcdir)/Main.hs -o havm
$(GHCCOMPILE) -optl-static -optl-pthread $(srcdir)/Main.hs -o havm
profile: $(havm_dependencies)
$(GHC) $(GHCFLAGS) -prof -auto-all $(srcdir)/Main.hs -o havm
$(GHCCOMPILE) -prof -auto-all $(srcdir)/Main.hs -o havm
CLEANFILES = *.hi *.hc *.o havm
MAINTAINERCLEANFILES = Parse.hs
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment