aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 56021200a4b2f10eb8040bc69e2ed018eeb8d8b2 (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 -j4
ifneq ($(PROFILE),)
	RUNFLAGS += +RTS -xc
	GHCFLAGS += -prof -fprof-auto
else
	GHCFLAGS += -O3
endif

TARGET = main

.PHONY: all clean run

all: $(TARGET) liblang.o

clean:
	rm -f $(TARGET)
	rm -rf obj

run: $(TARGET)
	./$(TARGET) $(RUNFLAGS)


$(TARGET): $(wildcard *.hs)
	@mkdir -p obj
	ghc $(GHCFLAGS) Main.hs -o $@

liblang.o: liblang.asm
	yasm -w+all -fmacho64 $< -o $@