-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (43 loc) · 1.37 KB
/
Makefile
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#------------------------------------------------------------------------------
# Project: DKA-2-MKA (Deterministic Finite Automata to Minimal Finite Automata)
# Functional and Logical Programming 2020 / 2021
# Author: Martin Smutny, xsmutn13
# Date: 03.03.2021
#
# Makefile for compilation:
# the binary 'dka-2-mka' is put in the same directory as this Makefile
#-------------------------------------------------------------------------------
# TODO Merlin test
GHC = ghc
FLAGS = -O2
#-------------------------------------------------------------------------------
# Directories
SRC_DIR = src
TEST_DIR = test
#-------------------------------------------------------------------------------
# Files
BIN = dka-2-mka
TEST_SC = $(TEST_DIR)/run_tests.sh
MAIN = $(SRC_DIR)/Main.hs
TYPES = $(SRC_DIR)/Types.hs
PARSE = $(SRC_DIR)/ParseInput.hs
MIN = $(SRC_DIR)/Minimize.hs
FILES = $(MAIN) $(TYPES) $(PARSE) $(MIN)
UNIT = $(SRC_DIR)/UnitTest.hs
BINU = unitTest
#-------------------------------------------------------------------------------
# Labels
.PHONY: all run test clean unit
all: $(BIN)
$(BIN): $(FILES)
$(GHC) $(FLAGS) -o $(BIN) $^
run: $(BIN)
./$(BIN)
test: $(BIN) $(TEST_SC)
./$(TEST_SC)
unit: $(UNIT) $(TYPES) $(MIN)
$(GHC) $(FLAGS) -o $(BINU) $^
time ./$(BINU)
clean:
rm $(BIN) $(SRC_DIR)/*.hi $(SRC_DIR)/*.o $(TEST_DIR)/*.temp
$(TEST_DIR)/*.err $(BINU)