-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
46 lines (39 loc) · 1.4 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
SHELL := /bin/bash
# Binary Names
COMPILER_NAME = glados
RUNNER_NAME = runner
INTERACTIVE=sun-tzu
all: clean
@cabal run glados -- $(ARGS)
build:
ifeq ($(filter $(COMPILER_NAME),$(MAKECMDGOALS)),$(COMPILER_NAME))
@cabal build $(COMPILER_NAME)
@find . -wholename "*$(COMPILER_NAME)/$(COMPILER_NAME)" -exec ln -fs {} ./$(COMPILER_NAME)_lnk \;
else ifeq ($(filter $(RUNNER_NAME),$(MAKECMDGOALS)),$(RUNNER_NAME))
@cabal build $(RUNNER_NAME)
@find . -wholename "*$(RUNNER_NAME)/$(RUNNER_NAME)" -exec ln -fs {} ./$(RUNNER_NAME)_lnk \;
else
@cabal build $(COMPILER_NAME)
@cabal build $(RUNNER_NAME)
@cabal build $(INTERACTIVE)
@find . -wholename "*$(COMPILER_NAME)/$(COMPILER_NAME)" -exec ln -fs {} ./$(COMPILER_NAME)_lnk \;
@find . -wholename "*$(RUNNER_NAME)/$(RUNNER_NAME)" -exec ln -fs {} ./$(RUNNER_NAME)_lnk \;
@find . -wholename "*$(INTERACTIVE)/$(INTERACTIVE)" -exec ln -fs {} ./$(INTERACTIVE)_lnk \;
endif
clean:
@rm -rf ./dist-newstyle
@rm -f $(RUNNER_NAME)_lnk
@rm -f $(COMPILER_NAME)_lnk
re: clean build
test: clean
ifeq ($(filter unit,$(MAKECMDGOALS)),unit)
@cabal run unit-tests --test-show-details=direct
else ifeq ($(filter integration,$(MAKECMDGOALS)),integration)
make build
@cabal run integration-tests --test-show-details=direct
else
make build
@cabal run unit-tests --test-show-details=direct
@cabal run integration-tests --test-show-details=direct
endif
.PHONY: all build test clean glados