summaryrefslogtreecommitdiff
path: root/defs
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-01 19:32:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-01 19:32:15 +0000
commitb1b88695bea30de4935528800ead5aa720bc1cde (patch)
treef977eb4e139b4bc4fe129273e1d203988141734c /defs
parent20e6b3a3b865f3c0ff0bd777e81c725e8ebf2fc4 (diff)
gmake.mk: universal cpp rules
* defs/gmake.mk: define preprocessing rules per architectures for universal binaries. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'defs')
-rw-r--r--defs/gmake.mk13
1 files changed, 13 insertions, 0 deletions
diff --git a/defs/gmake.mk b/defs/gmake.mk
index 5c83d9d..23977da 100644
--- a/defs/gmake.mk
+++ b/defs/gmake.mk
@@ -9,6 +9,19 @@ ifneq ($(filter -O0 -Od,$(optflags)),)
override XCFLAGS := $(filter-out -D_FORTIFY_SOURCE=%,$(XCFLAGS))
endif
+ifneq ($(filter universal-%,$(arch)),)
+define archcmd
+%.$(1).i: %.c
+ @$$(ECHO) preprocessing $$< with $(2)
+ $$(Q) $$(CPP) $$(warnflags) $(2) $$(XCFLAGS) $$(CPPFLAGS) $$(COUTFLAG)$$@ -E $$< > $$@
+
+%.i: %.$(1).i
+endef
+
+$(foreach $(filter -arch=%,$(subst -arch ,-arch=,$(ARCH_FLAG))),\
+ $(eval $(call archcmd,$(patsubst -arch=%,%,$(value arch)),$(patsubst -arch=%,-arch %,$(value arch)))))
+endif
+
ifneq ($(filter check% test,$(MAKECMDGOALS)),)
yes-test-knownbug: $(TEST_DEPENDS) yes-btest-ruby
yes-btest-ruby: $(TEST_DEPENDS) yes-test-sample