sbsv2/raptor/lib/flm/gccxml.flm
changeset 13 c327db0664bb
parent 2 39c28ec933dd
equal deleted inserted replaced
12:5e7562f67577 13:c327db0664bb
     1 # Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 # Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 # All rights reserved.
     2 # All rights reserved.
     3 # This component and the accompanying materials are made available
     3 # This component and the accompanying materials are made available
     4 # under the terms of the License "Eclipse Public License v1.0"
     4 # under the terms of the License "Eclipse Public License v1.0"
     5 # which accompanies this distribution, and is available
     5 # which accompanies this distribution, and is available
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
    69 # calls a tool multiple times with grouped arguments
    69 # calls a tool multiple times with grouped arguments
    70 # $(1) tool to call with any non-variable arguments
    70 # $(1) tool to call with any non-variable arguments
    71 # $(2) list of further variable arguments to group in 150 element calls
    71 # $(2) list of further variable arguments to group in 150 element calls
    72 define groupcallin50
    72 define groupcallin50
    73 	$(if $2,$1 $(foreach L,$(wordlist 1,50,$2),$(L)),)
    73 	$(if $2,$1 $(foreach L,$(wordlist 1,50,$2),$(L)),)
    74 	$(if $2,$(call groupcallin50,$1,$(wordlist 51,$(words $2),$2)),true)
    74 	$(if $2,$(call groupcallin50,$1,$(wordlist 51,$(words $2),$2)),@true)
    75 endef
    75 endef
    76 
    76 
    77 # echos content to a file in groups performing optional search/replace based on passed args
    77 # echos content to a file in groups performing optional search/replace based on passed args
    78 # $(1) template line with optional __VERBATIM__, __PATH__, __FILENAME__ replacements
    78 # $(1) template line with optional __VERBATIM__, __PATH__, __FILENAME__ replacements
    79 # $(2) list of pathed filenames to be batch processed and that can be used for template replacements
    79 # $(2) list of pathed filenames to be batch processed and that can be used for template replacements
    90 RFIFILES:=$(call mapresource2output,$(RESOURCEFILES),.rfi)
    90 RFIFILES:=$(call mapresource2output,$(RESOURCEFILES),.rfi)
    91 DEPFILES:=$(call mapsource2output,$(SOURCE),.xml.d)
    91 DEPFILES:=$(call mapsource2output,$(SOURCE),.xml.d)
    92 TEMPGXPARCHIVE:=$(VARIANTBLDPATH)/$(TARGET)$(BASE_TYPE).gxp
    92 TEMPGXPARCHIVE:=$(VARIANTBLDPATH)/$(TARGET)$(BASE_TYPE).gxp
    93 GXPARCHIVE:=$(VARIANTRELEASEPATH)/$(TARGET)$(BASE_TYPE).gxp
    93 GXPARCHIVE:=$(VARIANTRELEASEPATH)/$(TARGET)$(BASE_TYPE).gxp
    94 
    94 
    95 CLEANTARGETS:=$(CLEANTARGETS) $(MMPXMLFILE) $(SRCXMLFILES) $(DEPFILES) $(TEMPGXPARCHIVE) $(GXPARCHIVE)
    95 CLEANTARGETS:=$(CLEANTARGETS) $(MMPXMLFILE) $(SRCXMLFILES) $(DEPFILES) $(TEMPGXPARCHIVE)
    96 RELEASABLES:=$(RELEASABLES) $(GXPARCHIVE)
    96 RELEASABLES:=$(RELEASABLES) $(GXPARCHIVE)
    97 
    97 
    98 # Deduce whether we should be performing a build with standard CPP characteristics
    98 # Deduce whether we should be performing a build with standard CPP characteristics
    99 # This operates differently per-OS release, although OE TARGETTYPEs always build with standard CPP traits
    99 # This operates differently per-OS release, although OE TARGETTYPEs always build with standard CPP traits
   100 ifeq ($(OPEN_ENVIRONMENT),1)
   100 ifeq ($(OPEN_ENVIRONMENT),1)
   198 # note: includeheaders.txt is neither tracked as a formal dependency, nor deleted during a clean.  This mirrors
   198 # note: includeheaders.txt is neither tracked as a formal dependency, nor deleted during a clean.  This mirrors
   199 # the situation with ABLD where the GCCXML build continually updates the file as it finds it.
   199 # the situation with ABLD where the GCCXML build continually updates the file as it finds it.
   200 define gccxmlprocesssource
   200 define gccxmlprocesssource
   201 
   201 
   202   $(eval DEPENDFILENAME:=$(call mapsource2output,$(1),.xml.d))
   202   $(eval DEPENDFILENAME:=$(call mapsource2output,$(1),.xml.d))
   203   $(eval DEPENDFILE:=$(DEPENDFILENAME))
   203   $(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME)))
   204 
   204 
   205   $(call mapsource2output,$(1),.xml): $(1) $(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT)
   205   $(call mapsource2output,$(1),.xml): $(1) $(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT)
   206 	$(call startrule,gccxmlprocesssource) \
   206 	$(call startrule,gccxmlprocesssource) \
   207 	$(CC) $(CFLAGS) $(OPTION_GCCXML) \
   207 	$(CC) $(CFLAGS) $(OPTION_GCCXML) \
   208 	$(if $(filter $(CIAFILEEXTENSIONS),$(1)),$(call makemacrodef,$(OPT.DEFINE),__CIA__),) \
   208 	$(if $(filter $(CIAFILEEXTENSIONS),$(1)),$(call makemacrodef,$(OPT.DEFINE),__CIA__),) \
   212 	-fxml="$$@" -MD "$$@.d" -MT "$$@" $(OPT.OUT) nul "$(1)" && \
   212 	-fxml="$$@" -MD "$$@.d" -MT "$$@" $(OPT.OUT) nul "$(1)" && \
   213 	$(GNUSED) '/^.*\.xml:.*$$$$/d;/^ [a-zA-Z].*$$$$/d;s/^  //;s/ \\\$$$$//;s/\/\//\//g;/^s*$$$$/d' < $$@.d | $(GNUAWK) '{sub(/ /,"\n")};1' >> $(INCLUDESFILE) \
   213 	$(GNUSED) '/^.*\.xml:.*$$$$/d;/^ [a-zA-Z].*$$$$/d;s/^  //;s/ \\\$$$$//;s/\/\//\//g;/^s*$$$$/d' < $$@.d | $(GNUAWK) '{sub(/ /,"\n")};1' >> $(INCLUDESFILE) \
   214 	$(call endrule,gccxmlprocesssource)
   214 	$(call endrule,gccxmlprocesssource)
   215 
   215 
   216     CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME)
   216     CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME)
   217     ifneq "$(DEPENDFILE)" ""
   217     ifneq ($(DEPENDFILE),)
   218     ifeq ($(NO_DEPEND_INCLUDE),)
   218       ifeq ($(NO_DEPEND_INCLUDE),)
   219       ifeq "$(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS)))" ""
   219         ifeq ($(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS))),)
   220         -include $(DEPENDFILE)
   220           -include $(DEPENDFILE)
       
   221         endif
   221       endif
   222       endif
   222     endif
       
   223     endif
   223     endif
   224 
   224 
   225 endef
   225 endef
   226 $(foreach SRCFILE,$(SOURCE),$(eval $(call gccxmlprocesssource,$(SRCFILE))))
   226 $(foreach SRCFILE,$(SOURCE),$(eval $(call gccxmlprocesssource,$(SRCFILE))))
   227 
   227 
   233 # we just publish that last one that is built.  This mirrors what ABLD achieves, and avoids "overriding" warnings in
   233 # we just publish that last one that is built.  This mirrors what ABLD achieves, and avoids "overriding" warnings in
   234 # makefile processing.
   234 # makefile processing.
   235 # note: the main call here needs to reside outside of start/endrule in order to avoid command line length issues.
   235 # note: the main call here needs to reside outside of start/endrule in order to avoid command line length issues.
   236 define gccxmlpackage
   236 define gccxmlpackage
   237   $(TEMPGXPARCHIVE): $(MMPXMLFILE) $(SRCXMLFILES) $(DEFFILE)
   237   $(TEMPGXPARCHIVE): $(MMPXMLFILE) $(SRCXMLFILES) $(DEFFILE)
   238 	  $$(call groupcallin50,$(ZIP) -j $$@,$$^ $(RFIFILES)) ;
   238 	  $$(call groupcallin50,@$(ZIP) -j $$@ > /dev/null 2>&1,$$^ $(RFIFILES)) ;
   239 	  $(call startrule,gccxmlpackage) \
   239 	  $(call startrule,gccxmlpackage) \
   240 	  $(GNURM) -f $(GXPARCHIVE) && \
   240 	  $(GNURM) -f $(GXPARCHIVE) && \
   241 	  $(GNUCP) $$@ $(GXPARCHIVE) \
   241 	  $(GNUCP) $$@ $(GXPARCHIVE) \
   242 	  $(if $(SAVESPACE),; $(GNURM) -rf $(VARIANTBLDPATH); true,) \
   242 	  $(if $(SAVESPACE),; $(GNURM) -rf $(VARIANTBLDPATH); true,) \
   243 	  $(call endrule,gccxmlpackage)
   243 	  $(call endrule,gccxmlpackage)
   250 .PHONY:: $(ALLTARGET)
   250 .PHONY:: $(ALLTARGET)
   251 $(ALLTARGET):: $(RELEASABLES)
   251 $(ALLTARGET):: $(RELEASABLES)
   252 TARGET:: $(RELEASABLES)
   252 TARGET:: $(RELEASABLES)
   253 
   253 
   254 # clean up
   254 # clean up
   255 $(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS),$(CREATABLEPATHS),))
   255 $(call raptor_clean,$(CLEANTARGETS))
   256 $(call makepath, $(CREATABLEPATHS))
   256 $(call makepath, $(CREATABLEPATHS))
   257 
   257