-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
54 lines (35 loc) · 1.3 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
GIBBONDIR ?= ../
SANDBOXDIR= $(GIBBONDIR)/.racket_sandbox/
RUNRACKET= racket -A $(SANDBOXDIR)
RUNGHC= ghc
#----------------------------------------
# Generate answers using Racket
#----------------------------------------
GIB_EXAMPLES_DIR=./examples
# Temporary output dir:
GIB_BLD=$(GIB_EXAMPLES_DIR)/build_tmp
GIB_TESTS= $(shell ls $(GIB_EXAMPLES_DIR)/*.gib)
GIB_ANSWERS= $(addprefix $(GIB_BLD)/,$(notdir $(addsuffix .ans,$(GIB_TESTS))))
examples/build_tmp/%.gib.ans : $(GIB_EXAMPLES_DIR)/%.gib
$(RUNRACKET) $< > $@ || rm -f $@
#----------------------------------------
# Generate answers using GHC
#----------------------------------------
# HS_EXAMPLES_DIR=./examples
# HS_TESTS= $(shell ls $(HS_EXAMPLES_DIR)/*.hs)
# HS_ANSWERS= $(addprefix $(GIB_BLD)/,$(notdir $(addsuffix .ans,$(HS_TESTS))))
# examples/build_tmp/%.hs.ans : $(HS_EXAMPLES_DIR)/%.hs
# cp $< $(GIB_BLD)
# name=$(basename $(notdir $<))
# $(RUNGHC) $< -main-is $(basename $(notdir $<))
# $(HS_EXAMPLES_DIR)/$(basename $(notdir $<)) > $@ || rm -f $@
#----------------------------------------
run_answers:
@echo "\nGenerating canonical answers from Racket:"
@echo "-----------------------------------------"
$(MAKE) answers
build:
cd .. && make racket
mkdir -p $(GIB_BLD)
answers: build $(GIB_ANSWERS) $(HS_ANSWERS)
.PHONY: answers debug