|
12 | 12 | CPP_STDOUT := $(CPP) -E
|
13 | 13 | endif
|
14 | 14 |
|
15 |
| -all: $(addprefix $(BUILDDIR)/,pcre_h.jl errno_h.jl build_h.jl.phony file_constants.jl uv_constants.jl version_git.jl.phony) |
| 15 | +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) |
16 | 16 |
|
17 | 17 | PCRE_CONST := 0x[0-9a-fA-F]+|[0-9]+|\([\-0-9]+\)
|
18 | 18 | ifeq ($(USE_SYSTEM_PCRE), 1)
|
|
21 | 21 | PCRE_INCL_PATH := $(build_includedir)/pcre2.h
|
22 | 22 | endif
|
23 | 23 |
|
| 24 | +define parse_features |
| 25 | +@echo "# $(2) features" >> $@ |
| 26 | +@$(call PRINT_PERL, cat ../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*(?:\/\/.*)?$$/' >> $@) |
| 27 | +@echo >> $@ |
| 28 | +endef |
| 29 | + |
| 30 | +$(BUILDDIR)/features_h.jl: ../src/features_x86.h ../src/features_aarch32.h ../src/features_aarch64.h |
| 31 | + @-rm -f $@ |
| 32 | + @$(call parse_features,x86,X86) |
| 33 | + @$(call parse_features,aarch32,AArch32) |
| 34 | + @$(call parse_features,aarch64,AArch64) |
| 35 | + |
24 | 36 | $(BUILDDIR)/pcre_h.jl: $(PCRE_INCL_PATH)
|
25 | 37 | @$(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 > $@)
|
26 | 38 |
|
@@ -236,6 +248,7 @@ clean:
|
236 | 248 | -rm -f $(BUILDDIR)/errno_h.jl
|
237 | 249 | -rm -f $(BUILDDIR)/build_h.jl
|
238 | 250 | -rm -f $(BUILDDIR)/build_h.jl.phony
|
| 251 | + -rm -f $(BUILDDIR)/features_h.jl |
239 | 252 | -rm -f $(BUILDDIR)/uv_constants.jl
|
240 | 253 | -rm -f $(BUILDDIR)/file_constants.jl
|
241 | 254 | -rm -f $(BUILDDIR)/version_git.jl
|
|
0 commit comments