This repository has been archived by the owner on May 4, 2018. It is now read-only.
forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
155 lines (132 loc) · 5.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
JULIAHOME = $(abspath .)
include $(JULIAHOME)/Make.inc
all: default
default: release
DIRS = $(BUILD)/bin $(BUILD)/lib $(BUILD)/$(JL_PRIVATE_LIBDIR) $(BUILD)/share/julia
$(foreach dir,$(DIRS),$(eval $(call dir_target,$(dir))))
$(foreach link,extras base test doc examples ui,$(eval $(call symlink_target,$(link),$(BUILD)/share/julia)))
QUIET_MAKE =
ifeq ($(USE_QUIET), 1)
QUIET_MAKE = -s
endif
debug release: | $(DIRS) $(BUILD)/share/julia/extras $(BUILD)/share/julia/base $(BUILD)/share/julia/test $(BUILD)/share/julia/doc $(BUILD)/share/julia/examples $(BUILD)/share/julia/ui
@$(MAKE) $(QUIET_MAKE) julia-$@
@export JL_PRIVATE_LIBDIR=$(JL_PRIVATE_LIBDIR) && \
$(MAKE) $(QUIET_MAKE) LD_LIBRARY_PATH=$(BUILD)/lib:$(LD_LIBRARY_PATH) JULIA_EXECUTABLE="$(JULIA_EXECUTABLE_$@)" $(BUILD)/$(JL_PRIVATE_LIBDIR)/sys.ji
julia-debug julia-release:
@-git submodule init --quiet
@-git submodule update
@$(MAKE) $(QUIET_MAKE) -C deps
@$(MAKE) $(QUIET_MAKE) -C src lib$@
@$(MAKE) $(QUIET_MAKE) -C base
@$(MAKE) $(QUIET_MAKE) -C extras
@$(MAKE) $(QUIET_MAKE) -C ui $@
@ln -sf $(BUILD)/bin/$@-$(DEFAULT_REPL) julia
$(BUILD)/share/julia/helpdb.jl: doc/helpdb.jl | $(BUILD)/share/julia
@cp $< $@
# use sys.ji if it exists, otherwise run two stages
$(BUILD)/$(JL_PRIVATE_LIBDIR)/sys.ji: VERSION base/*.jl base/pkg/*.jl $(BUILD)/share/julia/helpdb.jl
$(QUIET_JULIA) cd base && \
(test -f $(BUILD)/$(JL_PRIVATE_LIBDIR)/sys.ji || $(JULIA_EXECUTABLE) -bf sysimg.jl) && $(JULIA_EXECUTABLE) -f sysimg.jl || echo "Note: this error is usually fixed by running 'make cleanall'."
run-julia-debug run-julia-release: run-julia-%:
$(MAKE) $(QUIET_MAKE) run-julia JULIA_EXECUTABLE="$(JULIA_EXECUTABLE_$*)"
run-julia:
$(JULIA_EXECUTABLE)
# public libraries, that are installed in $(PREFIX)/lib
JL_LIBS = julia-release julia-debug
# private libraries, that are installed in $(PREFIX)/lib/julia
JL_PRIVATE_LIBS = amd arpack cholmod colamd fftw3 fftw3f fftw3_threads \
fftw3f_threads glpk glpk_wrapper gmp gmp_wrapper grisu \
history Faddeeva_wrapper openlibm openlibm-extras pcre \
random readline Rmath spqr suitesparse_wrapper \
tk_wrapper umfpack z openblas
PREFIX ?= julia-$(JULIA_COMMIT)
install: release webrepl
@-$(MAKE) $(QUIET_MAKE) tk
@for subdir in "sbin" "bin" "etc" $(JL_LIBDIR) $(JL_PRIVATE_LIBDIR) "share/julia" ; do \
mkdir -p $(PREFIX)/$$subdir ; \
done
cp $(BUILD)/bin/*julia* $(PREFIX)/bin
cd $(PREFIX)/bin && ln -sf julia-release-$(DEFAULT_REPL) julia
-for suffix in $(JL_LIBS) ; do \
cp -a $(BUILD)/$(JL_LIBDIR)/lib$${suffix}*.$(SHLIB_EXT)* $(PREFIX)/$(JL_PRIVATE_LIBDIR) ; \
done
-for suffix in $(JL_PRIVATE_LIBS) ; do \
cp -a $(BUILD)/lib/lib$${suffix}*.$(SHLIB_EXT)* $(PREFIX)/$(JL_PRIVATE_LIBDIR) ; \
done
# Copy system image
ifneq ($(OS), WINNT)
cp $(BUILD)/$(JL_PRIVATE_LIBDIR)/sys.ji $(PREFIX)/$(JL_PRIVATE_LIBDIR)
endif
# Copy in all .jl sources as well
-cp -R -L $(BUILD)/share/julia $(PREFIX)/share/
-cp $(BUILD)/etc/nginx.conf $(PREFIX)/etc/
ifeq ($(OS), WINNT)
-cp $(JULIAHOME)/contrib/windows/* $(PREFIX)
-cp -R $(BUILD)/sbin $(PREFIX)
[ -e dist-extras/7za.exe ] && cp dist-extras/7za.exe $(PREFIX)/bin/7z.exe
[ -e dist-extras/PortableGit-1.8.0-preview20121022.7z ] && \
mkdir $(PREFIX)/Git && \
7z x dist-extras/PortableGit-1.8.0-preview20121022.7z -o"$(PREFIX)/Git"
ifeq ($(shell uname),MINGW32_NT-6.1)
-for dllname in "libgfortran-3" "libquadmath-0" "libgcc_s_dw2-1" "libstdc++-6,pthreadgc2" ; do \
cp /mingw/bin/$${dllname}.dll $(PREFIX)/$(JL_LIBDIR) ; \
done
else
-for dllname in "libgfortran-3" "libquadmath-0" "libgcc_s_sjlj-1" "libstdc++-6" ; do \
cp /usr/lib/gcc/i686-w64-mingw32/4.6/$${dllname}.dll $(PREFIX)/$(JL_LIBDIR) ; \
done
endif
endif
cp $(JULIAHOME)/VERSION $(PREFIX)/share/julia/VERSION
echo `git rev-parse --short HEAD`-$(OS)-$(ARCH) \(`date +"%Y-%m-%d %H:%M:%S"`\) > $(PREFIX)/share/julia/COMMIT
dist:
rm -fr julia-*.tar.gz julia-$(JULIA_COMMIT)
# -$(MAKE) -C deps clean-openblas
$(MAKE) install OPENBLAS_DYNAMIC_ARCH=1
ifeq ($(OS), Darwin)
-./contrib/fixup-libgfortran.sh $(PREFIX)/$(JL_PRIVATE_LIBDIR)
endif
ifeq ($(OS), WINNT)
zip -r -9 julia-$(JULIA_COMMIT)-$(OS)-$(ARCH).zip julia-$(JULIA_COMMIT)
else
tar zcvf julia-$(JULIA_COMMIT)-$(OS)-$(ARCH).tar.gz julia-$(JULIA_COMMIT)
endif
rm -fr julia-$(JULIA_COMMIT)
clean: | $(CLEAN_TARGETS)
@$(MAKE) -C base clean
@$(MAKE) -C extras clean
@$(MAKE) -C src clean
@$(MAKE) -C ui clean
@for buildtype in "release" "debug" ; do \
for repltype in "basic" "readline"; do \
rm -f julia-$${buildtype}-$${repltype}; \
done \
done
@rm -f julia
@rm -f *~ *# *.tar.gz
@rm -fr $(BUILD)/$(JL_PRIVATE_LIBDIR)
cleanall: clean
@$(MAKE) -C src clean-flisp clean-support
@rm -fr $(BUILD)/$(JL_LIBDIR)
# @$(MAKE) -C deps clean-uv
.PHONY: default debug release julia-debug julia-release \
test testall test-* clean cleanall webrepl \
run-julia run-julia-debug run-julia-release
test: release
@$(MAKE) $(QUIET_MAKE) -C test default
testall: release
@$(MAKE) $(QUIET_MAKE) -C test all
test-%: release
@$(MAKE) $(QUIET_MAKE) -C test $*
webrepl: all
@$(MAKE) $(QUIET_MAKE) -C deps install-nginx
@$(MAKE) -C ui/webserver julia-release
tk:
@$(MAKE) -C deps install-tk-wrapper
# download target for some hardcoded windows dependencies
.PHONY: win-extras
win-extras:
cd dist-extras && \
wget http://downloads.sourceforge.net/sevenzip/7za920.zip && \
wget https://msysgit.googlecode.com/files/PortableGit-1.8.0-preview20121022.7z