summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common.mk18
-rw-r--r--defs/gmake.mk2
2 files changed, 12 insertions, 8 deletions
diff --git a/common.mk b/common.mk
index a3d1e7c..67f3270 100644
--- a/common.mk
+++ b/common.mk
@@ -192,6 +192,15 @@ COMPILE_PRELUDE = $(srcdir)/tool/generic_erb.rb $(srcdir)/template/prelude.c.tmp
SHOWFLAGS = showflags
+MAKE_LINK = $(MINIRUBY) -rfileutils -e "include FileUtils::Verbose" \
+ -e "src, dest = ARGV" \
+ -e "exit if File.identical?(src, dest) or cmp(src, dest) rescue nil" \
+ -e "def noraise; yield; rescue; rescue NotImplementedError; end" \
+ -e "noraise {ln_sf('../'*dest.count('/')+src, dest)} or" \
+ -e "noraise {ln(src, dest)} or" \
+ -e "cp(src, dest)"
+
+
all: $(SHOWFLAGS) main docs
main: $(SHOWFLAGS) exts $(ENCSTATIC:static=lib)encs $(MJIT_MIN_HEADER)
@@ -210,14 +219,7 @@ $(MJIT_MIN_HEADER:.h=)$(MJIT_HEADER_SUFFIX).h: $(MJIT_HEADER:.h=)$(MJIT_HEADER_S
$(ECHO) building $@
$(MINIRUBY) $(srcdir)/tool/transform_mjit_header.rb "$(CC) $(ARCH_FLAG)" $(MJIT_HEADER:.h=)$(MJIT_HEADER_ARCH).h $@
$(Q) $(MAKEDIRS) $(MJIT_HEADER_INSTALL_DIR)
- $(Q) $(MINIRUBY) -rfileutils -e "include FileUtils::Verbose" \
- -e "src, dest = ARGV" \
- -e "exit if File.identical?(src, dest) or cmp(src, dest) rescue nil" \
- -e "def noraise; yield; rescue; rescue NotImplementedError; end" \
- -e "noraise {ln_sf('../'*dest.count('/')+src, dest)} or" \
- -e "noraise {ln(src, dest)} or" \
- -e "cp(src, dest)" \
- $@ $(MJIT_HEADER_INSTALL_DIR)/$(@F)
+ $(Q) $(MAKE_LINK) $@ $(MJIT_HEADER_INSTALL_DIR)/$(@F)
.PHONY: showflags
exts enc trans: $(SHOWFLAGS)
diff --git a/defs/gmake.mk b/defs/gmake.mk
index 4c9eb47..acbdba4 100644
--- a/defs/gmake.mk
+++ b/defs/gmake.mk
@@ -162,5 +162,7 @@ $(MJIT_MIN_HEADER): $(mjit_min_headers)
done
$(RM) $@.tmp
$(IFCHANGE) $@ $@.new
+ $(Q) $(MAKEDIRS) $(MJIT_HEADER_INSTALL_DIR)
+ $(Q) $(MAKE_LINK) $@ $(MJIT_HEADER_INSTALL_DIR)/$(@F)
endif