@@ -5,22 +5,7 @@ include $(JULIAHOME)/Make.inc
55
66TAGGED_RELEASE_BANNER := ""
77
8- all :
9-
10- BASE_SRCS := $(patsubst ./% ,% ,$(shell cd $(SRCDIR ) && find . -name \* .jl -and -not -name version_git.jl -and -not -name '* .phony') )
11- GENERATED_SRCS := pcre_h.jl errno_h.jl build_h.jl.phony features_h.jl file_constants.jl uv_constants.jl version_git.jl.phony
12-
13- GENERATED_DSTS := $(addprefix $(build_datarootdir ) /julia/src/,$(GENERATED_SRCS ) )
14- BASE_DSTS := $(addprefix $(build_datarootdir ) /julia/src/base/,$(BASE_SRCS ) ) $(GENERATED_DSTS )
15- BASE_DIRS := $(sort $(dir $(BASE_DSTS ) ) )
16- $(foreach dir,$(BASE_DIRS),$(eval $(call dir_target,$(dir))))
17-
18- # we might like to add "| $(BASE_DIRS)" here, but that causes many version of 'make' to get confused and fail to build consistently
19- $(build_datarootdir ) /julia/src/base/% .jl : $(SRCDIR ) /% .jl
20- @mkdir -p $(dir $@ )
21- cp $< $@
22-
23- all : $(BASE_DSTS )
8+ all : $(addprefix $(BUILDDIR ) /,pcre_h.jl errno_h.jl build_h.jl.phony features_h.jl file_constants.jl uv_constants.jl version_git.jl.phony)
249
2510PCRE_CONST := 0x[0-9a-fA-F]+|[0-9]+|\([\-0-9]+\)
2611ifeq ($(USE_SYSTEM_PCRE ) , 1)
@@ -31,37 +16,29 @@ endif
3116
3217define parse_features
3318@echo "# $(2) features" >> $@
34- @$(call PRINT_PERL, cat $(JULIAHOME ) /src/features_$(1 ) .h | \
35- perl -lne 'print "const JL_$(2 ) _$$1 = UInt32($$2) " if /^\s*JL_FEATURE_DEF(?:_NAME)?\(\s*(\w+)\s*,\s*([^,]+)\s*,.*\)\s*(?:\/\/.*)?$$/' >> $@ )
19+ @$(call PRINT_PERL, cat $(SRCDIR ) /../src/features_$(1 ) .h | perl -lne 'print "const JL_$(2 ) _$$1 = UInt32($$2) " if /^\s*JL_FEATURE_DEF(?:_NAME)?\(\s*(\w+)\s*,\s*([^,]+)\s*,.*\)\s*(?:\/\/.*)?$$/' >> $@ )
3620@echo >> $@
3721endef
3822
39- $(build_datarootdir ) /julia/src/features_h.jl : $(JULIAHOME ) /src/features_x86.h $(JULIAHOME ) /src/features_aarch32.h $(JULIAHOME ) /src/features_aarch64.h
40- @mkdir -p $(dir $@ )
23+ $(BUILDDIR ) /features_h.jl : $(SRCDIR ) /../src/features_x86.h $(SRCDIR ) /../src/features_aarch32.h $(SRCDIR ) /../src/features_aarch64.h
4124 @-rm -f $@
4225 @$(call parse_features,x86,X86)
4326 @$(call parse_features,aarch32,AArch32)
4427 @$(call parse_features,aarch64,AArch64)
4528
46- $(build_datarootdir ) /julia/src/pcre_h.jl : $(PCRE_INCL_PATH )
47- @mkdir -p $(dir $@ )
29+ $(BUILDDIR ) /pcre_h.jl : $(PCRE_INCL_PATH )
4830 @$(call PRINT_PERL, $(CPP ) -D PCRE2_CODE_UNIT_WIDTH=8 -dM $< | perl -nle '/^\s* #define\s+PCRE2_(\w* ) \s * \( ? ($( PCRE_CONST) )\) ? u? \s * $$ / and print index($$ 1, " ERROR_" ) == 0 ? " const $$ 1 = Cint($$ 2)" : " const $$ 1 = UInt32($$ 2)" ' | LC_ALL=C sort > $@)
4931
50- $(build_datarootdir ) /julia/src/errno_h.jl :
51- @mkdir -p $(dir $@ )
32+ $(BUILDDIR ) /errno_h.jl :
5233 @$(call PRINT_PERL, echo '#include <errno.h>' | $(CPP ) -dM - | perl -nle 'print "const $$1 = Int32($$2) " if /^#define\s+(E\w+)\s+(\d+)\s*$$ /' | LC_ALL=C sort > $@ )
5334
54- $(build_datarootdir ) /julia/src/file_constants.jl : $(JULIAHOME ) /src/file_constants.h
55- @mkdir -p $(dir $@ )
35+ $(BUILDDIR ) /file_constants.jl : $(SRCDIR ) /../src/file_constants.h
5636 @$(call PRINT_PERL, $(CPP_STDOUT ) -DJULIA $< | perl -nle 'print "$$1 0o$$2" if /^(\s* const\s+[A-z_]+\s+=) \s + (0[0-9]* )\s * $$ /; print " $$ 1" if /^\s * (const\s +[A-z_]+\s +=\s + ([1-9]| 0x)[0-9A-z]* )\s * $$ /' > $@)
5737
58- $(build_datarootdir ) /julia/src/uv_constants.jl : $(JULIAHOME ) /src/uv_constants.h $(LIBUV_INC ) /uv/errno.h
59- @mkdir -p $(dir $@ )
38+ $(BUILDDIR ) /uv_constants.jl : $(SRCDIR ) /../src/uv_constants.h $(LIBUV_INC ) /uv/errno.h
6039 @$(call PRINT_PERL, $(CPP_STDOUT ) "-I$(LIBUV_INC ) " -DJULIA $< | tail -n 16 > $@ )
6140
62- $(build_datarootdir ) /julia/src/build_h.jl.phony : $(BUILDDIR ) /build_h.jl.phony
6341$(BUILDDIR ) /build_h.jl.phony :
64- @mkdir -p $(build_datarootdir ) /julia/src
6542 @echo " # This file is automatically generated in base/Makefile" > $@
6643ifeq ($(XC_HOST ) ,)
6744 @echo "const MACHINE = \"$(BUILD_MACHINE)\"" >> $@
@@ -109,44 +86,35 @@ endif
10986
11087 @# This to ensure that we always rebuild this file, but only when it is modified do we touch build_h.jl,
11188 @# ensuring we rebuild the system image as infrequently as possible
112- @if ! cmp -s $@ $(build_datarootdir)/julia/src/ build_h.jl; then \
89+ @if ! cmp -s $@ build_h.jl; then \
11390 $(call PRINT_PERL,) \
114- mv $@ $(build_datarootdir)/julia/src/ build_h.jl; \
91+ mv $@ build_h.jl; \
11592 else \
11693 rm -f $@; \
11794 fi
11895
119- $(build_datarootdir ) /julia/src/version_git.jl.phony : $(BUILDDIR ) /version_git.jl.phony
12096$(BUILDDIR ) /version_git.jl.phony : $(SRCDIR ) /version_git.sh
121- @mkdir -p $(build_datarootdir ) /julia/src
122- ifneq ($(NO_GIT ) ,1)
123- @sh $< $(SRCDIR) > $@
124- else ifeq ($(shell [ -f $(BUILDDIR)/version_git.jl ] && echo "true"), true)
125- @# Give warning if boilerplate git is found here
126- @if grep -q "Default output if git is not available" $(BUILDDIR)/version_git.jl; then \
127- echo "WARNING: Using boilerplate git version info" >&2; \
128- fi
129- @cp $(BUILDDIR)/version_git.jl $@
130- else ifeq ($(shell [ -f $(SRCDIR)/version_git.jl ] && echo "true"), true)
131- @# Give warning if boilerplate git is found here
132- @if grep -q "Default output if git is not available" $(SRCDIR)/version_git.jl; then \
133- echo "WARNING: Using boilerplate git version info" >&2; \
134- fi
135- @cp $(SRCDIR)/version_git.jl $@
136- else
137- $(warning "WARNING: Generating boilerplate git version info")
138- @sh $< $(SRCDIR) NO_GIT > $@
139- endif
97+ ifneq ($(NO_GIT ) , 1)
98+ sh $< $(SRCDIR) > $@
14099 @# This to avoid touching version_git.jl when it is not modified,
141100 @# so that the system image does not need to be rebuilt.
142- @if ! cmp -s $@ $(build_datarootdir)/julia/src/ version_git.jl; then \
101+ @if ! cmp -s $@ version_git.jl; then \
143102 $(call PRINT_PERL,) \
144- mv $@ $(build_datarootdir)/julia/src/ version_git.jl; \
103+ mv $@ version_git.jl; \
145104 else \
146105 rm -f $@; \
147106 fi
148- $(BUILDDIR ) /version_git.jl : $(SRCDIR ) /version_git.sh
149- sh $< $(SRCDIR ) > $@
107+ else
108+ ifeq ($(shell [ -f $(BUILDDIR ) /version_git.jl ] && echo "true") , true)
109+ @# Give warning if boilerplate git is used
110+ @if grep -q "Default output if git is not available" $(BUILDDIR)/version_git.jl; then \
111+ echo "WARNING: Using boilerplate git version info" >&2; \
112+ fi
113+ else
114+ $(warning "WARNING: Generating boilerplate git version info")
115+ @sh $(SRCDIR)/version_git.sh $(SRCDIR) NO_GIT > $(BUILDDIR)/version_git.jl
116+ endif
117+ endif
150118
151119ifeq (,$(filter $(OS ) , WINNT emscripten) )
152120# For any USE_SYSTEM_* libraries that will be dynamically loaded by libjulia,
@@ -194,7 +162,7 @@ endif
194162define symlink_system_library
195163libname_$2 := $$(notdir $(call versioned_libname,$2,$3) )
196164libpath_$2 := $$(shell $$(call spawn,$$(LIBWHICH ) ) -p $$(libname_$2 ) 2>/dev/null)
197- symlink_$2: $$(build_private_libdir ) /$$(libname_$2 ) .FORCE
165+ symlink_$2: $$(build_private_libdir ) /$$(libname_$2 )
198166$$(build_private_libdir ) /$$(libname_$2 ) :
199167 @if [ -e "$$(libpath_$2 ) " ]; then \
200168 REALPATH=$$(libpath_$2 ) ; \
@@ -300,10 +268,7 @@ endif
300268
301269symlink_system_libraries : $(SYMLINK_SYSTEM_LIBRARIES )
302270
303- .FORCE :
304- .PHONY : $(BUILDDIR ) /version_git.jl $(BUILDDIR ) /version_git.jl.phony $(build_datarootdir ) /julia/src/version_git.jl.phony \
305- $(BUILDDIR ) /build_h.jl.phony $(build_datarootdir ) /julia/src/build_h.jl.phony \
306- clean all .FORCE
271+ .PHONY : $(BUILDDIR ) /build_h.jl.phony $(BUILDDIR ) /version_git.jl.phony clean all symlink_*
307272
308273clean :
309274 -rm -f $(BUILDDIR ) /pcre_h.jl
@@ -315,5 +280,4 @@ clean:
315280 -rm -f $(BUILDDIR ) /file_constants.jl
316281 -rm -f $(BUILDDIR ) /version_git.jl
317282 -rm -f $(BUILDDIR ) /version_git.jl.phony
318- -rm -rf $(build_datarootdir ) /julia/src/*
319283 -rm -f $(build_private_libdir ) /lib* .$(SHLIB_EXT ) *
0 commit comments