From b1b88695bea30de4935528800ead5aa720bc1cde Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 1 Jun 2014 19:32:15 +0000 Subject: [PATCH] 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 --- defs/gmake.mk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/defs/gmake.mk b/defs/gmake.mk index 5c83d9d5f8..23977da6dc 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