-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
…-related information in base/build_h.jl, completely available to julia programs Changes the contents of `VERSION` to 0.2.0, from 0.2
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.2 | ||
0.2.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,30 @@ include ../Make.inc | |
|
||
PCRE_CONST = 0x[0-9a-fA-F]+|[-+]?\s*[0-9]+ | ||
|
||
all: pcre_h.jl errno_h.jl build_h.jl file_constants.jl uv_constants.jl | ||
# These are all the values needed for the RawVersionInfo struct | ||
version_string = $(shell cat ../VERSION) | ||
commit = $(shell git rev-parse HEAD 2>/dev/null) | ||
commit_short = $(shell git rev-parse --short HEAD 2>/dev/null) | ||
build_number = $(shell echo $$(git describe --tags --long 2>/dev/null) | awk -F- '{print $$(NF-1);}') | ||
git_tag = $(shell git describe --tags --abbrev=0 2>/dev/null) | ||
prerelease = $(shell [ -z "$(git_tag)" -o "$(git_tag)" = "v$(version_string)" ] && echo false || echo true) | ||
|
||
git_branch = $(shell git branch 2>/dev/null | sed -n '/\* /s///p') | ||
git_time = $(shell git log -1 --pretty=format:%ct 2>/dev/null) | ||
ifneq ($(git_time), ) | ||
ifeq ($(OS), Darwin) | ||
date_string = "$(shell date -jr $(git_time) -u '+%Y-%m-%d %H:%M:%S %Z')" | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
staticfloat
via email
Author
Member
|
||
else | ||
date_string = "$(shell date --date=@$(git_time) -u '+%Y-%m-%d %H:%M:%S %Z')" | ||
endif | ||
else | ||
date_string = "" | ||
endif | ||
dirty = $(shell [ -z "$(shell git status --porcelain 2>/dev/null)" ] && echo "false" || echo "true" ) | ||
|
||
|
||
|
||
all: pcre_h.jl errno_h.jl build_h.jl.phony file_constants.jl uv_constants.jl | ||
|
||
pcre_h.jl: | ||
$(QUIET_PERL) $(CPP) -dM $(shell $(PCRE_CONFIG) --prefix)/include/pcre.h | perl -nle '/^\s*#define\s+PCRE_(\w*)\s*\(?($(PCRE_CONST))\)?\s*$$/ and print "const $$1 = uint32($$2)"' | sort > $@ | ||
|
@@ -17,7 +40,7 @@ file_constants.jl: ../src/file_constants.h | |
uv_constants.jl: ../src/uv_constants.h | ||
$(QUIET_PERL) ${CC} -E -P "-I$(LIBUV_INC)" -DJULIA ../src/uv_constants.h | tail -n 12 > $@ | ||
|
||
build_h.jl: ../Make.inc build.h Makefile | ||
build_h.jl.phony: | ||
This comment has been minimized.
Sorry, something went wrong.
StefanKarpinski
Member
|
||
$(QUIET_PERL) $(CC) -E -P build.h -I../src/support | grep . > $@ | ||
@echo "const ARCH = :$(ARCH)" >> $@ | ||
ifeq ($(OS),$(BUILD_OS)) | ||
|
@@ -34,6 +57,40 @@ else | |
@echo "const USE_BLAS64 = false" >> $@ | ||
endif | ||
|
||
@echo "immutable BuildInfo" >> $@ | ||
@echo " version_string::ASCIIString" >> $@ | ||
@echo " commit::ASCIIString" >> $@ | ||
@echo " commit_short::ASCIIString" >> $@ | ||
@echo " branch::ASCIIString" >> $@ | ||
@echo " build_number::Int" >> $@ | ||
@echo " date_string::ASCIIString" >> $@ | ||
@echo " dirty::Bool" >> $@ | ||
@echo " prerelease::Bool" >> $@ | ||
@echo "end" >> $@ | ||
|
||
|
||
@echo "const BUILD_INFO = BuildInfo( \ | ||
'\"$(version_string)\"', \ | ||
'\"$(commit)\"', \ | ||
'\"$(commit_short)\"', \ | ||
'\"$(git_branch)\"', \ | ||
$(build_number), \ | ||
'\"$(date_string)\"', \ | ||
$(dirty), \ | ||
$(prerelease) \ | ||
)" | xargs >> $@ | ||
|
||
@# This to ensure that we always rebuild this file, but only when it is modified do we touch build_h.jl, | ||
@# ensuring we rebuild the system image as infrequently as possible | ||
@if ! cmp -s build_h.jl $@; then \ | ||
mv $@ build_h.jl; \ | ||
else \ | ||
rm -f $@; \ | ||
fi | ||
|
||
.PHONY: build_h.jl.phony | ||
|
||
|
||
|
||
clean: | ||
rm -f *# *~ | ||
|
I hate to be that guy, but this is problematic because I use GNU date on OS X :-\