aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 0d7bf090546d56f60dd5902e165fdf5443b80a9b (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 -j2
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 $@