From 8514823f1f522fd0a403848a993882e8a7316b87 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 10 Sep 2007 17:40:50 +0000 Subject: [PATCH] Changed the Makefile to put the output files of GHC (*.o,*.hi) into an obj directory, to stop them cluttering up the source directories --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 07da1f1..bab015b 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ all: $(targets) sources = $(wildcard *.hs frontends/*.hs backends/*.hs transformations/*.hs common/*.hs) $(patsubst %.x,%.hs,$(wildcard frontends/*.x)) -builtfiles = $(patsubst %.hs,%.hi,$(sources)) $(patsubst %.hs,%.o,$(sources)) $(patsubst %.x,%.hs,$(wildcard frontends/*.x)) +builtfiles = $(patsubst %.x,%.hs,$(wildcard frontends/*.x)) %.hs: %.x alex $< @@ -18,10 +18,12 @@ ghc_opts = \ $(profile_opts) tock: $(sources) - ghc $(ghc_opts) -o tock --make Main + mkdir -p obj + ghc $(ghc_opts) -o tock --make Main -odir obj -hidir obj tocktest: $(sources) - ghc $(ghc_opts) -o tocktest -main-is TestMain --make TestMain + mkdir -p obj + ghc $(ghc_opts) -o tocktest -main-is TestMain --make TestMain -odir obj -hidir obj CFLAGS = \ -O2 \ @@ -77,7 +79,7 @@ haddock: @mv doc/index.html-2 doc/index.html clean: - rm -f $(targets) $(builtfiles) + rm -f $(targets) $(builtfiles) obj/*.o obj/*.hi # Don't delete intermediate files. .SECONDARY: