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) liblang.o @mkdir -p obj ghc $(GHCFLAGS) Main.hs -o $@ liblang.o: liblang.asm yasm -w+all -fmacho64 $< -o $@