forked from dgvncsz0f/iyql
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (38 loc) · 1.45 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
SRCROOT=$(shell pwd)
MAINSRC=$(wildcard src/main/haskell/Yql/Core/*.hs src/main/haskell/Yql/Core/Functions/*.hs src/main/haskell/Yql/*.hs src/main/haskell/Yql/UI/*.hs)
MAINOBJ=$(addsuffix .o,$(basename $(MAINSRC)))
MAINPRG_SRC=src/main/haskell/iyql.hs
MAINPRG_OBJ=$(wildcard .o,$(basename $(MAINPRG_SRC)))
MAINPRG=$(basename $(MAINPRG_SRC))
TESTSRC=$(wildcard src/test/haskell/Test/*.hs src/test/haskell/Test/Yql/Core/*.hs src/test/haskell/Test/Yql/Core/Functions/*.hs src/test/haskell/Test/Yql/*.hs src/test/haskell/Test/Yql/UI/*.hs)
TESTOBJ=$(addsuffix .o,$(basename $(TESTSRC)))
TESTPRG_SRC=src/test/haskell/all_tests.hs
TESTPRG_OBJ=$(addsuffix .o,$(basename $(TESTPRG_SRC)))
TESTPRG=$(basename $(TESTPRG_SRC))
HC=/usr/bin/ghc
HCFLAGS=
PREFIX=/usr/local
.PHONY: default
default: compile
.PHONY: compile
compile: $(MAINOBJ) $(MAINPRG)
.PHONY: install
install: $(MAINPRG)
install -m 0755 $(MAINPRG) $(PREFIX)/bin
.PHONY: test
test: compile $(TESTPRG)
$(TESTPRG)
.PHONY: clean
clean:
$(RM) $(shell find src/main/haskell -name "*.o")
$(RM) $(shell find src/main/haskell -name "*.hi")
$(RM) $(shell find src/test/haskell -name "*.o")
$(RM) $(shell find src/test/haskell -name "*.hi")
$(RM) $(TESTPRG) $(MAINPRG)
$(TESTPRG): $(TESTPRG_SRC) $(MAINSRC) $(TESTSRC)
$(MAINPRG): $(MAINPRG_SRC) $(MAINSRC)
.SUFFIXES: .o .hs
.hs.o:
$(HC) -isrc/test/haskell -isrc/main/haskell --make $(HCFLAGS) $(<)
%: %.hs
$(HC) -isrc/test/haskell -isrc/main/haskell --make $(HCFLAGS) $(<)