sbsv2/raptor/lib/flm/tools2exe.flm
changeset 2 39c28ec933dd
child 13 c327db0664bb
equal deleted inserted replaced
1:820b22e13ff1 2:39c28ec933dd
       
     1 # Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 # All rights reserved.
       
     3 # This component and the accompanying materials are made available
       
     4 # under the terms of the License "Eclipse Public License v1.0"
       
     5 # which accompanies this distribution, and is available
       
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 #
       
     8 # Initial Contributors:
       
     9 # Nokia Corporation - initial contribution.
       
    10 #
       
    11 # Contributors:
       
    12 #
       
    13 # Description:
       
    14 # Function-Like Makefile to build a TOOLS2 EXE with gcc
       
    15 # 
       
    16 #
       
    17 
       
    18 ## Outputs - externally relevant targets that this FLM generates
       
    19 ifeq ($(OSTYPE),cygwin)
       
    20 SYSTEMLIBS:=$(LIBS.WIN32)
       
    21 else
       
    22 SYSTEMLIBS:=$(LIBS.LINUX)
       
    23 endif
       
    24 
       
    25 EXETARGET:=$(RELEASEPATH)/$(TARGET)$(DOTEXE)
       
    26 
       
    27 ifneq ($(TOOLSPATH),)
       
    28 INSTALLED:=$(TOOLSPATH)/$(TARGET)$(DOTEXE)
       
    29 endif
       
    30 
       
    31 ## Target groups
       
    32 RELEASEABLES:=$(INSTALLED)
       
    33 TARGETS:=$(EXETARGET) $(INSTALLED)
       
    34 
       
    35 ## Common build steps (compiling and cleaning)
       
    36 include $(FLMHOME)/tools2common.flm
       
    37 
       
    38 ## Static libraries
       
    39 ifneq ($(STATICLIBRARY),)
       
    40 STATICLIBS:=$(patsubst %,$(RELEASEPATH)/lib%.a,$(STATICLIBRARY))
       
    41 LLIBS:=$(OPT.L)"$(RELEASEPATH)" $(patsubst %,$(OPT.l)%,$(STATICLIBRARY))
       
    42 #
       
    43 ifneq ($(SYSTEMLIBS),)
       
    44 LLIBS:=$(LLIBS) $(patsubst %,$(OPT.l)%,$(SYSTEMLIBS))
       
    45 endif
       
    46 #
       
    47 endif
       
    48 
       
    49 ## Link executable
       
    50 # get OBJECTFILES from call to tools2common
       
    51 define tools2linkexe
       
    52 $(EXETARGET): $(OBJECTFILES) $(STATICLIBS)
       
    53 	$(call startrule,tools2linkexe) \
       
    54 	$(LINKER) $(CFLAGS) $(LFLAGS) $(OPT.O)"$(EXETARGET)" $(call dblquote,$(OBJECTFILES)) $(LLIBS) \
       
    55 	$(if $(SAVESPACE),; $(GNURM) -rf $(OUTPUTPATH); true,) \
       
    56 	$(call endrule,tools2linkexe)
       
    57 
       
    58 endef
       
    59 
       
    60 $(eval $(call tools2linkexe))
       
    61 
       
    62 	
       
    63 ## Copy executable to the tools directory
       
    64 ifneq ($(TOOLSPATH),)
       
    65 define tools2install
       
    66 $(INSTALLED): $(EXETARGET)
       
    67 	$(call startrule,tools2install) \
       
    68 	$(GNUCP) "$(EXETARGET)" "$(INSTALLED)" && \
       
    69 	$(GNUCHMOD) a+rwx "$(INSTALLED)" \
       
    70 	$(call endrule,tools2install)
       
    71 endef
       
    72 
       
    73 $(eval $(call tools2install))
       
    74 
       
    75 endif
       
    76 
       
    77 ## The End