Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 3ce407a8 authored by Ary Borenszweig's avatar Ary Borenszweig
Browse files

Devs: a compiler generated without --release has a path hardcoded to the working copy

parent 1e2ee011
No related merge requests found
...@@ -5,6 +5,11 @@ ...@@ -5,6 +5,11 @@
O := .build O := .build
SOURCES := $(shell find src -name '*.cr') SOURCES := $(shell find src -name '*.cr')
SPEC_SOURCES := $(shell find spec -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=src:libs:`pwd`/src:`pwd`/libs)
ifeq (Darwin,$(shell uname))
BUILD_PATH := PATH=`brew --prefix llvm`/bin:$$PATH
endif
all: crystal all: crystal
spec: all_spec spec: all_spec
...@@ -15,11 +20,11 @@ all_spec: $(O)/all_spec ...@@ -15,11 +20,11 @@ all_spec: $(O)/all_spec
$(O)/all_spec: $(SOURCES) $(SPEC_SOURCES) $(O)/all_spec: $(SOURCES) $(SPEC_SOURCES)
@mkdir -p $(O) @mkdir -p $(O)
./bin/crystal build -o $@ spec/all_spec.cr $(BUILD_PATH) ./bin/crystal build -o $@ spec/all_spec.cr
$(O)/crystal: $(SOURCES) $(O)/crystal: $(SOURCES)
@mkdir -p $(O) @mkdir -p $(O)
./bin/crystal build $(if $(release),--release )$(if $(stats),--stats )$(if $(threads),--threads $(threads) )-o $@ src/compiler/crystal.cr $(BUILD_PATH) $(EXPORTS) ./bin/crystal build $(FLAGS) -o $@ src/compiler/crystal.cr
clean: clean:
rm -rf $(O) rm -rf $(O)
...@@ -4,7 +4,7 @@ CRYSTAL_DIR="$SCRIPT_ROOT/.build" ...@@ -4,7 +4,7 @@ CRYSTAL_DIR="$SCRIPT_ROOT/.build"
if [ -x $CRYSTAL_DIR/crystal ] if [ -x $CRYSTAL_DIR/crystal ]
then then
echo -e "\x1B[33mUsing compiled compiler at .build/crystal\x1B[0m" echo -e "\x1B[33mUsing compiled compiler at .build/crystal\x1B[0m"
CRYSTAL_BIN="$CRYSTAL_DIR/crystal" crystal "$@" $CRYSTAL_DIR/crystal "$@"
else else
crystal "$@" crystal "$@"
fi fi
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment