From d455d7252a52eacce59bf4ea59217c760e869b0c Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Sat, 7 Apr 2012 09:43:10 +0200 Subject: gbuild: move YaccTarget__command to com_GCC_class --- solenv/gbuild/platform/com_GCC_class.mk | 30 ++++++++++++++++++++++++++++++ solenv/gbuild/platform/com_GCC_defs.mk | 29 ----------------------------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk index b8de73e62df5..989205a5f31b 100644 --- a/solenv/gbuild/platform/com_GCC_class.mk +++ b/solenv/gbuild/platform/com_GCC_class.mk @@ -72,3 +72,33 @@ $(call gb_Helper_abbreviate_dirs,\ -o $(call gb_SrsPartTarget_get_dep_target,$(1))) endef +# YaccTarget class + +ifeq ($(ANCIENT_BISON),YES) +# +# There are ancient versions of bison out there, which do not handle +# well .cxx extensions, nor do they support --defines=. The +# result is that the header is named .cxx.h instead of .hxx +# so we queue a mv to rename the header accordingly. +# One example is XCode versions 2.x, which are used on OSX ppc +# machines. +# +define gb_YaccTarget__command +$(call gb_Output_announce,$(2),$(true),YAC,3) +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(3)) && \ + $(gb_YACC) $(T_YACCFLAGS) -d -o $(5) $(1) && mv $(5).h $(4) && touch $(3) ) + +endef + +else +define gb_YaccTarget__command +$(call gb_Output_announce,$(2),$(true),YAC,3) +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(3)) && \ + $(gb_YACC) $(T_YACCFLAGS) --defines=$(4) -o $(5) $(1) && touch $(3) ) + +endef +endif + +# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk index 36b2cc77d8a0..a1312393d73b 100644 --- a/solenv/gbuild/platform/com_GCC_defs.mk +++ b/solenv/gbuild/platform/com_GCC_defs.mk @@ -25,35 +25,6 @@ gb_YACC := bison gb_CLASSPATHSEP := : -# YaccTarget class - -ifeq ($(ANCIENT_BISON),YES) -# -# There are ancient versions of bison out there, which do not handle -# well .cxx extensions, nor do they support --defines=. The -# result is that the header is named .cxx.h instead of .hxx -# so we queue a mv to rename the header accordingly. -# One example is XCode versions 2.x, which are used on OSX ppc -# machines. -# -define gb_YaccTarget__command -$(call gb_Output_announce,$(2),$(true),YAC,3) -$(call gb_Helper_abbreviate_dirs,\ - mkdir -p $(dir $(3)) && \ - $(gb_YACC) $(T_YACCFLAGS) -d -o $(5) $(1) && mv $(5).h $(4) && touch $(3) ) - -endef - -else -define gb_YaccTarget__command -$(call gb_Output_announce,$(2),$(true),YAC,3) -$(call gb_Helper_abbreviate_dirs,\ - mkdir -p $(dir $(3)) && \ - $(gb_YACC) $(T_YACCFLAGS) --defines=$(4) -o $(5) $(1) && touch $(3) ) - -endef -endif - # use CC/CXX if they are nondefaults ifneq ($(origin CC),default) gb_CC := $(CC) -- cgit