2019-04-27 22:35:14 -04:00
|
|
|
# -*- mode: makefile-gmake; indent-tabs-mode: t -*-
|
|
|
|
|
2014-07-02 23:38:13 -04:00
|
|
|
gnumake = yes
|
2017-02-12 18:37:28 -05:00
|
|
|
override gnumake_recursive := $(if $(findstring n,$(firstword $(MFLAGS))),,+)
|
2017-02-15 05:51:58 -05:00
|
|
|
override mflags := $(filter-out -j%,$(MFLAGS))
|
2017-03-25 21:21:57 -04:00
|
|
|
MSPECOPT += $(if $(filter -j%,$(MFLAGS)),-j)
|
2014-07-02 23:38:13 -04:00
|
|
|
|
2018-10-06 11:14:19 -04:00
|
|
|
CHECK_TARGETS := great exam love check test check% test% btest%
|
|
|
|
# expand test targets, and those dependents
|
|
|
|
TEST_TARGETS := $(filter $(CHECK_TARGETS),$(MAKECMDGOALS))
|
|
|
|
TEST_DEPENDS := $(filter-out commit $(TEST_TARGETS),$(MAKECMDGOALS))
|
|
|
|
TEST_TARGETS := $(patsubst great,exam,$(TEST_TARGETS))
|
|
|
|
TEST_DEPENDS := $(filter-out great $(TEST_TARGETS),$(TEST_DEPENDS))
|
|
|
|
TEST_TARGETS := $(patsubst exam,check,$(TEST_TARGETS))
|
2019-07-21 21:10:28 -04:00
|
|
|
TEST_TARGETS := $(patsubst check,test-spec test-all test-tool test-short,$(TEST_TARGETS))
|
2018-10-06 11:14:19 -04:00
|
|
|
TEST_TARGETS := $(patsubst test-rubyspec,test-spec,$(TEST_TARGETS))
|
|
|
|
TEST_DEPENDS := $(filter-out exam check test-spec $(TEST_TARGETS),$(TEST_DEPENDS))
|
|
|
|
TEST_TARGETS := $(patsubst love,check,$(TEST_TARGETS))
|
|
|
|
TEST_DEPENDS := $(filter-out love $(TEST_TARGETS),$(TEST_DEPENDS))
|
2019-07-02 02:22:22 -04:00
|
|
|
TEST_TARGETS := $(patsubst test-almost,test-all,$(patsubst check-%,test test-%,$(TEST_TARGETS)))
|
2018-10-06 11:14:19 -04:00
|
|
|
TEST_DEPENDS := $(filter-out test-all $(TEST_TARGETS),$(TEST_DEPENDS))
|
|
|
|
TEST_TARGETS := $(patsubst test,test-short,$(TEST_TARGETS))
|
|
|
|
TEST_DEPENDS := $(filter-out test $(TEST_TARGETS),$(TEST_DEPENDS))
|
|
|
|
TEST_TARGETS := $(patsubst test-short,btest-ruby test-knownbug test-basic,$(TEST_TARGETS))
|
|
|
|
TEST_DEPENDS := $(filter-out test-short $(TEST_TARGETS),$(TEST_DEPENDS))
|
|
|
|
TEST_DEPENDS += $(if $(filter great exam love check,$(MAKECMDGOALS)),all exts)
|
2013-03-06 06:59:23 -05:00
|
|
|
|
2014-03-24 21:30:07 -04:00
|
|
|
ifneq ($(filter -O0 -Od,$(optflags)),)
|
|
|
|
override XCFLAGS := $(filter-out -D_FORTIFY_SOURCE=%,$(XCFLAGS))
|
|
|
|
endif
|
|
|
|
|
2015-03-13 04:29:26 -04:00
|
|
|
ifeq ($(if $(filter all main exts enc trans libencs libenc libtrans \
|
2015-03-18 04:08:31 -04:00
|
|
|
prog program ruby ruby$(EXEEXT) \
|
|
|
|
wprogram rubyw rubyw$(EXEEXT) \
|
|
|
|
miniruby$(EXEEXT) mini,\
|
2015-03-12 12:15:07 -04:00
|
|
|
$(MAKECMDGOALS)),,$(MAKECMDGOALS)),)
|
2015-10-22 10:56:37 -04:00
|
|
|
-include $(SHOWFLAGS)
|
2015-03-12 12:15:07 -04:00
|
|
|
endif
|
|
|
|
|
2014-06-01 15:32:15 -04:00
|
|
|
ifneq ($(filter universal-%,$(arch)),)
|
|
|
|
define archcmd
|
2014-06-01 15:32:17 -04:00
|
|
|
%.$(1).S: %.c
|
|
|
|
@$$(ECHO) translating $$< with $(2)
|
|
|
|
$$(Q) $$(CC) $$(CFLAGS_NO_ARCH) $(2) $$(XCFLAGS) $$(CPPFLAGS) $$(COUTFLAG)$$@ -S $$<
|
|
|
|
|
|
|
|
%.S: %.$(1).S
|
|
|
|
|
2014-06-01 15:32:15 -04:00
|
|
|
%.$(1).i: %.c
|
|
|
|
@$$(ECHO) preprocessing $$< with $(2)
|
|
|
|
$$(Q) $$(CPP) $$(warnflags) $(2) $$(XCFLAGS) $$(CPPFLAGS) $$(COUTFLAG)$$@ -E $$< > $$@
|
|
|
|
|
|
|
|
%.i: %.$(1).i
|
|
|
|
endef
|
|
|
|
|
2018-02-05 22:19:42 -05:00
|
|
|
$(foreach arch,$(arch_flags),\
|
2014-06-01 15:32:15 -04:00
|
|
|
$(eval $(call archcmd,$(patsubst -arch=%,%,$(value arch)),$(patsubst -arch=%,-arch %,$(value arch)))))
|
|
|
|
endif
|
|
|
|
|
2017-02-13 00:11:14 -05:00
|
|
|
.PHONY: $(addprefix yes-,$(TEST_TARGETS))
|
|
|
|
|
|
|
|
ifneq ($(filter-out btest%,$(TEST_TARGETS)),)
|
|
|
|
$(addprefix yes-,$(TEST_TARGETS)): $(TEST_DEPENDS)
|
2013-03-26 23:42:19 -04:00
|
|
|
endif
|
2013-03-06 06:59:23 -05:00
|
|
|
|
2017-02-13 00:11:14 -05:00
|
|
|
ORDERED_TEST_TARGETS := $(filter $(TEST_TARGETS), \
|
|
|
|
btest-ruby test-knownbug test-basic \
|
2019-07-21 21:10:28 -04:00
|
|
|
test-testframework test-tool test-ruby test-all \
|
2018-11-02 19:07:56 -04:00
|
|
|
test-spec test-bundler-prepare test-bundler \
|
2017-02-13 00:11:14 -05:00
|
|
|
)
|
2017-05-16 09:15:12 -04:00
|
|
|
prev_test := $(if $(filter test-spec,$(ORDERED_TEST_TARGETS)),test-spec-precheck)
|
2017-03-01 23:54:18 -05:00
|
|
|
$(foreach test,$(ORDERED_TEST_TARGETS), \
|
|
|
|
$(eval yes-$(value test) no-$(value test): $(value prev_test)); \
|
2017-02-13 00:11:14 -05:00
|
|
|
$(eval prev_test := $(value test)))
|
2013-03-06 20:39:10 -05:00
|
|
|
|
|
|
|
ifneq ($(if $(filter install,$(MAKECMDGOALS)),$(filter uninstall,$(MAKECMDGOALS))),)
|
|
|
|
install-targets := $(filter install uninstall,$(MAKECMDGOALS))
|
|
|
|
$(word 1,$(install-targets)): $(word 0,$(install-targets))
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(filter reinstall,$(MAKECMDGOALS)),)
|
2014-06-19 10:11:52 -04:00
|
|
|
install-prereq: uninstall
|
|
|
|
uninstall sudo-precheck: all $(if $(filter all,$(INSTALLDOC)),docs)
|
2013-03-06 20:39:10 -05:00
|
|
|
endif
|
2014-06-20 00:20:26 -04:00
|
|
|
|
|
|
|
ifneq ($(filter love,$(MAKECMDGOALS)),)
|
|
|
|
showflags: up
|
2016-07-26 12:03:51 -04:00
|
|
|
sudo-precheck: test yes-test-testframework no-test-testframework
|
2014-06-20 00:20:26 -04:00
|
|
|
install-prereq: sudo-precheck
|
|
|
|
yes-test-all no-test-all: install
|
|
|
|
endif
|
2019-05-25 03:53:20 -04:00
|
|
|
ifneq ($(filter love install reinstall,$(MAKECMDGOALS)),)
|
|
|
|
# Cross referece needs to parse all files at once
|
|
|
|
RDOCFLAGS = --force-update
|
|
|
|
endif
|
2017-03-08 08:52:32 -05:00
|
|
|
ifneq ($(filter great,$(MAKECMDGOALS)),)
|
|
|
|
love: test-rubyspec
|
|
|
|
endif
|
2016-06-03 22:40:04 -04:00
|
|
|
|
|
|
|
$(srcdir)/missing/des_tables.c: $(srcdir)/missing/crypt.c
|
2016-06-03 23:46:06 -04:00
|
|
|
ifeq ($(if $(filter yes,$(CROSS_COMPILING)),,$(CC)),)
|
2016-06-03 22:40:04 -04:00
|
|
|
touch $@
|
|
|
|
else
|
|
|
|
@$(ECHO) building make_des_table
|
2016-06-03 23:46:06 -04:00
|
|
|
$(CC) $(CPPFLAGS) -DDUMP $(LDFLAGS) $(XLDFLAGS) $(LIBS) -omake_des_table $(srcdir)/missing/crypt.c
|
|
|
|
@[ -x ./make_des_table ]
|
2016-06-03 22:40:04 -04:00
|
|
|
@$(ECHO) generating $@
|
|
|
|
$(Q) $(MAKEDIRS) $(@D)
|
2016-06-04 06:58:14 -04:00
|
|
|
$(Q) ./make_des_table > $@.new
|
|
|
|
$(Q) mv $@.new $@
|
2016-06-03 22:40:04 -04:00
|
|
|
$(Q) $(RMALL) make_des_table*
|
|
|
|
endif
|
2016-08-19 22:20:34 -04:00
|
|
|
|
|
|
|
STUBPROGRAM = rubystub$(EXEEXT)
|
|
|
|
IGNOREDPATTERNS = %~ .% %.orig %.rej \#%\#
|
|
|
|
SCRIPTBINDIR := $(if $(EXEEXT),,exec/)
|
2018-11-28 09:56:19 -05:00
|
|
|
SCRIPTPROGRAMS = $(addprefix $(SCRIPTBINDIR),$(addsuffix $(EXEEXT),$(filter-out $(IGNOREDPATTERNS),$(notdir $(wildcard $(srcdir)/libexec/*)))))
|
2016-08-19 22:20:34 -04:00
|
|
|
|
|
|
|
stub: $(STUBPROGRAM)
|
|
|
|
scriptbin: $(SCRIPTPROGRAMS)
|
|
|
|
ifneq ($(STUBPROGRAM),rubystub)
|
|
|
|
rubystub: $(STUBPROGRAM)
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(SCRIPTPROGRAMS): $(STUBPROGRAM)
|
|
|
|
|
|
|
|
$(STUBPROGRAM): rubystub.$(OBJEXT) $(LIBRUBY) $(MAINOBJ) $(OBJS) $(EXTOBJS) $(SETUP) $(PREP)
|
|
|
|
|
|
|
|
rubystub$(EXEEXT):
|
|
|
|
@rm -f $@
|
|
|
|
$(ECHO) linking $@
|
|
|
|
$(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) rubystub.$(OBJEXT) $(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
|
|
|
|
$(Q) $(POSTLINK)
|
|
|
|
$(if $(STRIP),$(Q) $(STRIP) $@)
|
|
|
|
|
|
|
|
$(SCRIPTBINDIR)%$(EXEEXT): bin/% $(STUBPROGRAM) \
|
|
|
|
$(if $(SCRIPTBINDIR),$(TIMESTAMPDIR)/.exec.time)
|
|
|
|
$(ECHO) generating $@
|
|
|
|
$(Q) { cat $(STUBPROGRAM); echo; sed -e '1{' -e '/^#!.*ruby/!i\' -e '#!/bin/ruby' -e '}' $<; } > $@
|
|
|
|
$(Q) chmod +x $@
|
|
|
|
$(Q) $(POSTLINK)
|
|
|
|
|
|
|
|
$(TIMESTAMPDIR)/.exec.time:
|
|
|
|
$(Q) mkdir exec
|
|
|
|
$(Q) exit > $@
|
2017-03-08 20:06:09 -05:00
|
|
|
|
|
|
|
.PHONY: commit
|
2019-07-18 18:51:48 -04:00
|
|
|
commit: $(if $(filter commit,$(MAKECMDGOALS)),$(filter-out commit,$(MAKECMDGOALS))) up
|
2019-07-15 19:25:39 -04:00
|
|
|
@$(BASERUBY) -C "$(srcdir)" -I./tool/lib -rvcs -e 'VCS.detect(".").commit'
|
2018-06-02 08:17:16 -04:00
|
|
|
+$(Q) \
|
|
|
|
{ \
|
2018-12-18 11:01:58 -05:00
|
|
|
$(CHDIR) "$(srcdir)"; \
|
2019-07-01 20:44:37 -04:00
|
|
|
sed -f tool/prereq.status defs/gmake.mk template/Makefile.in; \
|
2018-06-02 08:17:16 -04:00
|
|
|
sed 's/{[.;]*$$([a-zA-Z0-9_]*)}//g' common.mk; \
|
|
|
|
} | \
|
2019-02-14 09:21:14 -05:00
|
|
|
$(MAKE) $(mflags) Q=$(Q) ECHO=$(ECHO) srcdir="$(srcdir)" srcs_vpath="" CHDIR="$(CHDIR)" \
|
2018-06-02 08:17:16 -04:00
|
|
|
BOOTSTRAPRUBY="$(BOOTSTRAPRUBY)" MINIRUBY="$(BASERUBY)" BASERUBY="$(BASERUBY)" \
|
2018-11-12 22:24:18 -05:00
|
|
|
VCSUP="" ENC_MK=.top-enc.mk REVISION_FORCE=PHONY CONFIGURE="$(CONFIGURE)" -f - \
|
2018-06-02 08:17:16 -04:00
|
|
|
update-src srcs all-incs
|
2017-07-16 21:16:07 -04:00
|
|
|
|
2019-04-24 09:40:54 -04:00
|
|
|
GITHUB_RUBY_URL = https://github.com/ruby/ruby
|
2019-04-24 10:26:56 -04:00
|
|
|
PR =
|
2019-04-24 09:40:54 -04:00
|
|
|
|
2019-04-25 05:27:16 -04:00
|
|
|
COMMIT_GPG_SIGN = $(shell git -C "$(srcdir)" config commit.gpgsign)
|
2019-05-08 03:59:37 -04:00
|
|
|
REMOTE_GITHUB_URL = $(shell git -C "$(srcdir)" config remote.github.url)
|
2019-04-25 05:27:16 -04:00
|
|
|
|
2019-04-24 09:40:54 -04:00
|
|
|
.PHONY: fetch-github
|
|
|
|
fetch-github:
|
2019-04-25 05:54:43 -04:00
|
|
|
$(call fetch-github,$(PR))
|
2019-04-25 05:29:58 -04:00
|
|
|
|
|
|
|
define fetch-github
|
|
|
|
$(if $(1),,\
|
2019-04-24 09:40:54 -04:00
|
|
|
echo "usage:"; echo " make $@ PR=1234"; \
|
|
|
|
exit 1; \
|
2019-04-25 05:27:16 -04:00
|
|
|
)
|
2019-05-08 03:59:37 -04:00
|
|
|
$(eval REMOTE_GITHUB_URL := $(REMOTE_GITHUB_URL))
|
|
|
|
$(if $(REMOTE_GITHUB_URL),, \
|
2019-04-24 09:40:54 -04:00
|
|
|
echo adding $(GITHUB_RUBY_URL) as remote github; \
|
|
|
|
git -C "$(srcdir)" remote add github $(GITHUB_RUBY_URL); \
|
2019-05-08 03:59:37 -04:00
|
|
|
$(eval REMOTE_GITHUB_URL := $(GITHUB_RUBY_URL)) \
|
2019-04-25 05:27:16 -04:00
|
|
|
)
|
2019-04-25 05:29:58 -04:00
|
|
|
git -C "$(srcdir)" fetch -f github "pull/$(1)/head:gh-$(1)"
|
|
|
|
endef
|
2019-04-24 09:40:54 -04:00
|
|
|
|
2019-04-25 05:05:51 -04:00
|
|
|
.PHONY: checkout-github
|
|
|
|
checkout-github: fetch-github
|
|
|
|
git -C "$(srcdir)" checkout "gh-$(PR)"
|
|
|
|
|
2019-07-16 22:56:40 -04:00
|
|
|
.PHONY: pull-github
|
|
|
|
pull-github: fetch-github
|
|
|
|
$(call pull-github,$(PR))
|
|
|
|
|
2019-04-24 09:40:54 -04:00
|
|
|
.PHONY: merge-github
|
2019-07-16 22:56:40 -04:00
|
|
|
merge-github: pull-github
|
2019-04-25 05:54:43 -04:00
|
|
|
$(call merge-github,$(PR))
|
2019-04-25 05:29:58 -04:00
|
|
|
|
2019-07-16 22:56:40 -04:00
|
|
|
define pull-github
|
2019-04-25 02:03:54 -04:00
|
|
|
$(eval GITHUB_MERGE_BASE := $(shell git -C "$(srcdir)" log -1 --format=format:%H))
|
|
|
|
$(eval GITHUB_MERGE_BRANCH := $(shell git -C "$(srcdir)" symbolic-ref --short HEAD))
|
2019-04-25 06:37:10 -04:00
|
|
|
$(eval GITHUB_MERGE_WORKTREE := $(shell mktemp -d "$(srcdir)/gh-$(1)-XXXXXX"))
|
2019-04-25 05:29:58 -04:00
|
|
|
git -C "$(srcdir)" worktree add $(notdir $(GITHUB_MERGE_WORKTREE)) "gh-$(1)"
|
2019-04-25 02:03:54 -04:00
|
|
|
git -C "$(GITHUB_MERGE_WORKTREE)" rebase $(GITHUB_MERGE_BRANCH)
|
2019-07-16 22:56:40 -04:00
|
|
|
git -C "$(GITHUB_MERGE_WORKTREE)" filter-branch -f \
|
2019-04-25 05:29:58 -04:00
|
|
|
--msg-filter 'cat && echo && echo "Closes: $(GITHUB_RUBY_URL)/pull/$(1)"' \
|
2019-04-24 09:40:54 -04:00
|
|
|
-- "$(GITHUB_MERGE_BASE)..@"
|
2019-04-25 05:27:16 -04:00
|
|
|
$(eval COMMIT_GPG_SIGN := $(COMMIT_GPG_SIGN))
|
|
|
|
$(if $(filter true,$(COMMIT_GPG_SIGN)), \
|
2019-07-16 22:56:40 -04:00
|
|
|
git -C "$(GITHUB_MERGE_WORKTREE)" rebase --exec "git commit --amend --no-edit -S" "$(GITHUB_MERGE_BASE)"; \
|
2019-04-25 05:27:16 -04:00
|
|
|
)
|
2019-04-25 05:29:58 -04:00
|
|
|
endef
|
|
|
|
|
2019-07-16 22:56:40 -04:00
|
|
|
define merge-github
|
|
|
|
git -C "$(srcdir)" worktree remove $(notdir $(GITHUB_MERGE_WORKTREE))
|
|
|
|
git -C "$(srcdir)" merge --ff-only "gh-$(1)"
|
|
|
|
git -C "$(srcdir)" branch -D "gh-$(1)"
|
|
|
|
endef
|
|
|
|
|
|
|
|
.PHONY: fetch-github-%
|
2019-04-25 05:29:58 -04:00
|
|
|
fetch-github-%:
|
|
|
|
$(call fetch-github,$*)
|
|
|
|
|
2019-07-16 22:56:40 -04:00
|
|
|
.PHONY: checkout-github-%
|
|
|
|
checkout-github-%: fetch-github-%
|
|
|
|
git -C "$(srcdir)" checkout "gh-$(1)"
|
|
|
|
|
|
|
|
.PHONY: pr-% pull-github-%
|
|
|
|
pr-% pull-github-%: fetch-github-%
|
|
|
|
$(call pull-github,$*)
|
|
|
|
|
|
|
|
.PHONY: merge-github-%
|
|
|
|
merge-github-%: pull-github-%
|
2019-04-25 05:29:58 -04:00
|
|
|
$(call merge-github,$*)
|
2019-04-24 09:40:54 -04:00
|
|
|
|
2019-04-25 06:24:56 -04:00
|
|
|
HELP_EXTRA_TASKS = \
|
|
|
|
" checkout-github: checkout GitHub Pull Request [PR=1234]" \
|
2019-07-16 22:56:40 -04:00
|
|
|
" pull-github: rebase GitHub Pull Request to new worktree [PR=1234]" \
|
2019-04-25 06:24:56 -04:00
|
|
|
" merge-github: merge GitHub Pull Request to current HEAD [PR=1234]" \
|
|
|
|
""
|
|
|
|
|
2017-07-16 21:16:07 -04:00
|
|
|
ifeq ($(words $(filter update-gems extract-gems,$(MAKECMDGOALS))),2)
|
|
|
|
extract-gems: update-gems
|
|
|
|
endif
|
2018-02-05 22:19:42 -05:00
|
|
|
|
|
|
|
ifeq ($(filter 0 1,$(words $(arch_flags))),)
|
|
|
|
$(foreach x,$(patsubst -arch=%,%,$(arch_flags)), \
|
|
|
|
$(eval $$(MJIT_HEADER:.h=)-$(value x).h \
|
|
|
|
$$(MJIT_MIN_HEADER:.h=)-$(value x).h \
|
2018-03-15 22:07:43 -04:00
|
|
|
$$(TIMESTAMPDIR)/$$(MJIT_HEADER:.h=)-$(value x).time \
|
2018-02-05 22:19:42 -05:00
|
|
|
: ARCH_FLAG := -arch $(value x)))
|
|
|
|
|
2018-03-15 22:07:43 -04:00
|
|
|
$(foreach x,$(patsubst -arch=%,%,$(arch_flags)), \
|
|
|
|
$(eval $$(MJIT_HEADER:.h=)-$(value x).h: \
|
|
|
|
$$(TIMESTAMPDIR)/$$(MJIT_HEADER:.h=)-$(value x).time))
|
|
|
|
|
2018-02-05 22:19:42 -05:00
|
|
|
mjit_min_headers := $(patsubst -arch=%,$(MJIT_MIN_HEADER:.h=-%.h),$(arch_flags))
|
2018-02-08 09:59:31 -05:00
|
|
|
$(MJIT_MIN_HEADER): $(mjit_min_headers) $(PREP)
|
2018-02-05 22:19:42 -05:00
|
|
|
@ set -e; set $(patsubst -arch=%,%,$(arch_flags)); \
|
2018-02-10 01:38:18 -05:00
|
|
|
cd $(@D); h=$(@F:.h=); \
|
|
|
|
exec > $(@F).new; \
|
|
|
|
echo '#if 0'; \
|
|
|
|
for arch; do\
|
|
|
|
echo "#elif defined __$${arch}__"; \
|
|
|
|
echo "# include \"$$h-$$arch.h\""; \
|
|
|
|
done; \
|
|
|
|
echo "#else"; echo "# error unsupported platform"; echo "#endif"
|
2018-02-05 22:19:42 -05:00
|
|
|
$(IFCHANGE) $@ $@.new
|
2018-02-07 08:45:14 -05:00
|
|
|
$(Q) $(MAKEDIRS) $(MJIT_HEADER_INSTALL_DIR)
|
|
|
|
$(Q) $(MAKE_LINK) $@ $(MJIT_HEADER_INSTALL_DIR)/$(@F)
|
2018-02-05 22:19:42 -05:00
|
|
|
|
|
|
|
endif
|
2018-11-19 22:07:46 -05:00
|
|
|
|
2019-07-09 00:10:08 -04:00
|
|
|
ifeq ($(if $(wildcard $(filter-out .,$(UNICODE_FILES) $(UNICODE_PROPERTY_FILES))),,\
|
2019-04-04 08:11:53 -04:00
|
|
|
$(wildcard $(srcdir)/lib/unicode_normalize/tables.rb)),)
|
|
|
|
# Needs the dependency when any Unicode data file exists, or
|
|
|
|
# normalization tables script doesn't. Otherwise, when the target
|
|
|
|
# only exists, use it as-is.
|
2019-04-04 01:10:26 -04:00
|
|
|
.PHONY: $(UNICODE_SRC_DATA_DIR)/.unicode-tables.time
|
2019-04-04 08:11:53 -04:00
|
|
|
UNICODE_TABLES_TIMESTAMP =
|
2019-04-04 01:10:26 -04:00
|
|
|
$(UNICODE_SRC_DATA_DIR)/.unicode-tables.time: \
|
|
|
|
$(UNICODE_FILES) $(UNICODE_PROPERTY_FILES)
|
|
|
|
endif
|
|
|
|
|
2018-11-29 02:07:40 -05:00
|
|
|
# GNU make treat the target as unmodified when its dependents get
|
|
|
|
# updated but it is not updated, while others may not.
|
|
|
|
$(srcdir)/revision.h: $(REVISION_H)
|
|
|
|
|
2018-11-19 22:07:46 -05:00
|
|
|
# Query on the generated rdoc
|
|
|
|
#
|
|
|
|
# $ make rdoc:Integer#+
|
|
|
|
rdoc\:%: PHONY
|
2018-11-28 09:56:19 -05:00
|
|
|
$(Q)$(RUNRUBY) $(srcdir)/libexec/ri --no-standard-docs --doc-dir=$(RDOCOUT) $(patsubst rdoc:%,%,$@)
|
2018-11-20 01:13:42 -05:00
|
|
|
|
|
|
|
test_%.rb test/%: programs PHONY
|
2019-07-23 22:07:15 -04:00
|
|
|
+$(Q)$(exec) $(RUNRUBY) "$(TESTSDIR)/runner.rb" --ruby="$(RUNRUBY)" $(TEST_EXCLUDES) $(TESTOPTS) -- $(patsubst test/%,%,$@)
|
2018-11-23 23:34:00 -05:00
|
|
|
|
2019-07-31 07:46:01 -04:00
|
|
|
spec/%: programs exts PHONY
|
|
|
|
+$(RUNRUBY) -r./$(arch)-fake $(srcdir)/spec/mspec/bin/mspec-run -B $(srcdir)/spec/default.mspec $(SPECOPTS) $(patsubst %,$(srcdir)/%,$@)
|
|
|
|
|
2018-11-23 23:34:00 -05:00
|
|
|
clean-srcs-ext::
|
|
|
|
$(Q)$(RM) $(patsubst $(srcdir)/%,%,$(EXT_SRCS))
|
|
|
|
|
|
|
|
clean-srcs-extra::
|
|
|
|
$(Q)$(RM) $(patsubst $(srcdir)/%,%,$(EXTRA_SRCS))
|
2019-04-20 23:30:38 -04:00
|
|
|
|
|
|
|
ifneq ($(filter $(VCS),git),)
|
|
|
|
update-src::
|
2019-07-14 21:11:07 -04:00
|
|
|
@$(BASERUBY) $(srcdir)/tool/lib/colorize.rb pass "Latest commit hash = $(shell $(filter-out svn,$(VCS)) -C $(srcdir) rev-parse --short=10 HEAD)"
|
2019-04-20 23:30:38 -04:00
|
|
|
endif
|
2019-07-15 04:06:35 -04:00
|
|
|
|
|
|
|
# Update dependencies and commit the updates to the current branch.
|
|
|
|
update-deps:
|
|
|
|
$(eval update_deps := $(shell date +update-deps-%Y%m%d))
|
|
|
|
$(eval deps_dir := $(shell mktemp -d)/$(update_deps))
|
|
|
|
$(eval GIT_DIR := $(shell git -C $(srcdir) rev-parse --absolute-git-dir))
|
|
|
|
git --git-dir=$(GIT_DIR) worktree add $(deps_dir)
|
|
|
|
cp $(srcdir)/tool/config.guess $(srcdir)/tool/config.sub $(deps_dir)/tool
|
|
|
|
[ -f config.status ] && cp config.status $(deps_dir)
|
|
|
|
cd $(deps_dir) && autoconf && \
|
|
|
|
exec ./configure -q -C --enable-load-relative --disable-install-doc --disable-rubygems 'optflags=-O0' 'debugflags=-save-temps=obj -g'
|
|
|
|
$(RUNRUBY) -C $(deps_dir) tool/update-deps --fix
|
|
|
|
git -C $(deps_dir) diff --no-ext-diff --ignore-submodules --exit-code || \
|
|
|
|
git -C $(deps_dir) commit --all --message='Update dependencies'
|
|
|
|
git --git-dir=$(GIT_DIR) worktree remove $(deps_dir)
|
|
|
|
git --git-dir=$(GIT_DIR) merge --no-edit --ff-only $(update_deps)
|
|
|
|
git --git-dir=$(GIT_DIR) branch --delete $(update_deps)
|