RUNFLAGS = GHCFLAGS = -Wall -Widentities -odir obj -hidir obj ifneq ($(PROFILE),) RUNFLAGS += +RTS -xc GHCFLAGS += -prof -fprof-auto else GHCFLAGS += -O3 endif TARGET = main .PHONY: all clean run all: $(TARGET) clean: rm -f $(TARGET) rm -rf obj run: $(TARGET) ./$(TARGET) $(RUNFLAGS) $(TARGET): $(wildcard *.hs) @mkdir -p obj ghc $(GHCFLAGS) Main.hs -o $@