From 75c8a8c31d743b5f6fd33f89005de57b3ee768c4 Mon Sep 17 00:00:00 2001 From: John Goerzen Date: Wed, 28 Jan 2009 10:42:34 -0600 Subject: [PATCH] Simplifying/optimizing Makefile --- Makefile | 21 ++++++++++++--------- Setup.hs | 6 ++++++ Setup.lhs | 6 ------ 3 files changed, 18 insertions(+), 15 deletions(-) create mode 100644 Setup.hs delete mode 100644 Setup.lhs diff --git a/Makefile b/Makefile index 6ce5cb4..701c678 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,16 @@ -all: +all: setup @echo "Please use Cabal to build this package; not make." - runghc Setup.lhs configure - runghc Setup.lhs build + ./setup configure + ./setup build + +setup: Setup.hs + ghc --make -package cabal -o setup Setup.hs install: - runghc Setup.lhs install + ./setup install clean: - runghc Setup.lhs clean + -runghc Setup.hs clean -rm -rf html `find . -name "*.o"` `find . -name "*.hi" | grep -v debian` \ `find . -name "*~" | grep -v debian` *.a setup dist testsrc/runtests \ local-pkg doctmp @@ -20,14 +23,14 @@ test: test-ghc test-hugs test-hugs: @echo " ****** Running hugs tests" - runghc Setup.lhs configure -f buildtests --hugs --extra-include-dirs=/usr/lib/hugs/include - runghc Setup.lhs build + ./setup configure -f buildtests --hugs --extra-include-dirs=/usr/lib/hugs/include + ./setup build runhugs -98 +o -P$(PWD)/dist/scratch:$(PWD)/dist/scratch/programs/runtests: \ dist/scratch/programs/runtests/Main.hs test-ghc: @echo " ****** Building GHC tests" - runghc Setup.lhs configure -f buildtests - runghc Setup.lhs build + ./setup configure -f buildtests + ./setup build @echo " ****** Running GHC tests" ./dist/build/runtests/runtests diff --git a/Setup.hs b/Setup.hs new file mode 100644 index 0000000..05a511a --- /dev/null +++ b/Setup.hs @@ -0,0 +1,6 @@ +#!/usr/bin/env runhugs + +import Distribution.Simple + +main = defaultMain + diff --git a/Setup.lhs b/Setup.lhs deleted file mode 100644 index 8efae70..0000000 --- a/Setup.lhs +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env runhugs - -> import Distribution.Simple - -> main = defaultMain -