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