sbsv1/buildsystem/shell/sh.mk
changeset 599 fa7a3cc6effd
equal deleted inserted replaced
596:9f25be3da657 599:fa7a3cc6effd
       
     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 "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 #
       
    15 
       
    16 include $(EPOCROOT)epoc32/tools/shell/generic.mk
       
    17 
       
    18 
       
    19 # Some tools do not work with slash but only dollar slash.  
       
    20 # That is actually a defect for them and should be fixed.  
       
    21 # Then this macro should be abandoned.
       
    22 define slash2generic
       
    23 $(1)
       
    24 endef
       
    25 
       
    26 # Use $(MKDIR) to create directory
       
    27 # Use in base/config.mk and many others
       
    28 define createdir
       
    29 $(MKDIR) -p $(1) 
       
    30 endef
       
    31 
       
    32 # Check if not exist directory then create it first. 
       
    33 # Use in BASE/lubbock_miniboot and many others
       
    34 define ifnotexistd
       
    35 if [ ! -d $(1) ]; then $(MKDIR) -p $(1); fi
       
    36 endef
       
    37 
       
    38 # This means there are something to add for SBSv2 here.
       
    39 # Used in base/lubbock_miniboot and should be used in similar situation.
       
    40 define sbsadd
       
    41 $(1)
       
    42 endef
       
    43 
       
    44 # Add double quotes for abld target. No quote for SBSv2.
       
    45 # Used in base/lubbock_miniboot
       
    46 define abldquote
       
    47 $(1)
       
    48 endef
       
    49 
       
    50 # Used in Syslibs/conversiontable.mk
       
    51 define generated
       
    52 $(EPOCROOT)epoc32/build/$(1)
       
    53 endef
       
    54 
       
    55 # Used in syslibs/generate_cpp.mk
       
    56 define formatreleasables
       
    57 $(if $(1),@echo $(word 1,$(1)))
       
    58 $(if $(1),$(call formatreleasables,$(wordlist 2,$(words $(1)),$(1))))
       
    59 endef
       
    60 
       
    61 # Used in BASE/config.mk
       
    62 define generatedcpp
       
    63 $(EPOCROOT)epoc32/build/generatedcpp/hal
       
    64 endef
       
    65 
       
    66 # Set path. Used in BASE/bootstrap.mk
       
    67 define epocbldabs
       
    68 $(EPOCBLD)
       
    69 endef
       
    70 
       
    71 # Copy. Used in BASE/bootstrap.mk 
       
    72 define ecopy
       
    73 cp
       
    74 endef
       
    75 
       
    76 # Abld does not support pipe symbol | while SBSv2 does.  So for Abld it is nothing.
       
    77 # Used in Base/bootstrap.mk. 
       
    78 define pipe
       
    79 | $(1)
       
    80 endef
       
    81 
       
    82 # Used in BASE/copy_default.mk.
       
    83 define cpfeature
       
    84 $(CP) $? $@
       
    85 endef
       
    86 
       
    87 # Used in Syslibs/generate_cpp.mk at the bottom to deal with different
       
    88 # way of includeing TEM in Abld and SBSv2.
       
    89 define include
       
    90 $(TEMPLATE_EXTENSION_MAKEFILE)
       
    91 endef
       
    92 
       
    93 # Macro to change working directory. Used for TOOLS/stlport.mk
       
    94 # The path needs to be fixed before passing to cd command
       
    95 define chdir
       
    96 -cd $(1)
       
    97 endef
       
    98 
       
    99 # Macro to remove files. Used in TOOLS/stlport.mk
       
   100 define remove
       
   101 -rm -f $(1)
       
   102 endef
       
   103 
       
   104 # Macro to copy files. Needed for sbsv2 build
       
   105 # Used in PDS components in syslibs/*.mk
       
   106 define forcecopy
       
   107 $(CP) -f $(1)	$(2) && chmod a+rwx $(2)
       
   108 endef
       
   109 
       
   110 # Macro to remove files. Needed for sbsv2 build
       
   111 # Used in PDS components in syslibs/*.mk
       
   112 define forceremove
       
   113 -$(ERASE) -f $(1)
       
   114 endef
       
   115 
       
   116 # Configuration needs to be returned as upper case for abld
       
   117 CONFIGURATION:=rel