forked from crystal-lang/crystal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
30 lines (23 loc) · 792 Bytes
/
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
.PHONY: all spec crystal doc clean
-include Makefile.local # for optional local options e.g. threads
O := .build
SOURCES := $(shell find src -name '*.cr')
SPEC_SOURCES := $(shell find spec -name '*.cr')
FLAGS := $(if $(release),--release )$(if $(stats),--stats )$(if $(threads),--threads $(threads) )
EXPORTS := $(if $(release),,CRYSTAL_CONFIG_PATH=`pwd`/src)
all: crystal
spec: all_spec
$(O)/all_spec
doc:
$(BUILD_PATH) ./bin/crystal doc docs/main.cr
crystal: $(O)/crystal
all_spec: $(O)/all_spec
$(O)/all_spec: $(SOURCES) $(SPEC_SOURCES)
@mkdir -p $(O)
$(BUILD_PATH) ./bin/crystal build $(FLAGS) -o $@ spec/all_spec.cr
$(O)/crystal: $(SOURCES)
@mkdir -p $(O)
$(BUILD_PATH) $(EXPORTS) ./bin/crystal build $(FLAGS) -o $@ src/compiler/crystal.cr
clean:
rm -rf $(O)
rm -rf ./doc