aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: ee0c6fb80f342e10189cf0151939ce1c9d89fbda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
RUNFLAGS =
GHCFLAGS = -Wall -Widentities -Wno-unused-imports -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 $@