sbsv1/buildsystem/shell/cmd.mk
changeset 599 fa7a3cc6effd
equal deleted inserted replaced
596:9f25be3da657 599:fa7a3cc6effd
       
     1 # Copyright (c) 2005-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 # Host platform dependant variables
       
    19 /:=$(shell echo \)
       
    20 ;:=;
       
    21 CP=copy
       
    22 RM=del
       
    23 RMDIR=rmdir
       
    24 MKDIR=mkdir
       
    25 ERASE=@erase /q 2>>nul
       
    26 
       
    27 
       
    28 # Some tools do not work with slash but only dollar slash.  
       
    29 # That is actually a defect for them and should be fixed.  
       
    30 # Then this macro should be abandoned.
       
    31 define slash2generic
       
    32 $(subst /,$/,$(1))
       
    33 endef
       
    34 
       
    35 # Call perl script to create directory. 
       
    36 # Used in base/config.mk and many others
       
    37 define createdir
       
    38 perl $(EPOCROOT)epoc32/tools/emkdir.pl $(1)
       
    39 endef
       
    40 
       
    41 # Check if not exist directory then create it first. 
       
    42 # Used in BASE/lubbock_miniboot
       
    43 define ifnotexistd
       
    44 if not exist $(1) md $(subst /,\,$(1))
       
    45 endef
       
    46 
       
    47 # This means there are something to add for SBSv2 here.
       
    48 # For abld, there is nothing.
       
    49 # Used in base/lubbock_miniboot and should be used in similar situation.
       
    50 define sbsadd
       
    51 
       
    52 endef
       
    53 
       
    54 # Add double quotes for abld target. No quote for SBSv2.
       
    55 # Used in base/lubbock_miniboot
       
    56 define abldquote
       
    57 "$(1)"
       
    58 endef
       
    59 
       
    60 # Used in Syslibs/conversiontable.mk
       
    61 define generated
       
    62 $(EPOCROOT)epoc32/build/$(1)
       
    63 endef
       
    64 
       
    65 # Used in syslibs/generate_cpp.mk
       
    66 define formatreleasables
       
    67 @echo $(1)
       
    68 endef
       
    69 
       
    70 # Used in BASE/config.mk
       
    71 define generatedcpp
       
    72 $(EPOCROOT)epoc32/build/generatedcpp/hal
       
    73 endef
       
    74 
       
    75 # Set path. Used in BASE/bootstrap.mk
       
    76 define epocbldabs
       
    77 $(1)$(2)
       
    78 endef
       
    79 
       
    80 # Call perl script ecopyfile.pl to copy.  
       
    81 # Used in BASE/bootstrap.mk 
       
    82 define ecopy
       
    83 perl $(EPOCROOT)epoc32/tools/ecopyfile.pl 
       
    84 endef
       
    85 
       
    86 # Abld does not support pipe symbol | while SBSv2 does.  So for Abld it is nothing.
       
    87 # Used in Base/bootstrap.mk. 
       
    88 define pipe
       
    89 
       
    90 endef
       
    91 
       
    92 # Call perl script copyfeaturevariants.pl.  Used in BASE/copy_default.mk.
       
    93 define cpfeature
       
    94 perl $(EPOCROOT)epoc32/tools/copyfeaturevariants.pl $(1) $(2)
       
    95 endef
       
    96 
       
    97 # Used in Syslibs/generate_cpp.mk at the bottom to deal with different
       
    98 # way of includeing TEM in Abld and SBSv2.
       
    99 define include
       
   100 $(EPOCROOT)epoc32/tools/makefile_templates/syslibs/generate_cpp.mk
       
   101 endef
       
   102 
       
   103 # Macro to change working directory. Used for TOOLS/stlport.mk
       
   104 # The path needs to be fixed before passing to cd command
       
   105 define chdir
       
   106 -cd $(subst /,\,$(1))
       
   107 endef
       
   108 
       
   109 # Macro to remove files. All paths need to be corrected before deleting.
       
   110 # Used in TOOLS/stlport.mk
       
   111 define remove
       
   112 -$(ERASE) $(subst /,\,$(1))
       
   113 endef
       
   114 
       
   115 # Macro to copy files. Needed for sbsv2 build 
       
   116 # Used in PDS components in syslibs/*.mk
       
   117 define forcecopy
       
   118 $(CP) $(subst /,\,$(1)) $(subst /,\,$(2))
       
   119 endef
       
   120 
       
   121 # Macro to remove files. Needed for sbsv2 build
       
   122 # Used in PDS components in syslibs/*.mk
       
   123 define forceremove
       
   124 -$(ERASE) $(subst /,\,$(1))
       
   125 endef
       
   126 
       
   127 define tmpmacro
       
   128 $(call chdir,$(BUILD_DIR));configure.bat -c gcc;
       
   129 endef
       
   130 
       
   131 define settPath
       
   132 1
       
   133 endef
       
   134 
       
   135 # Configuration needs to be returned as upper case for abld
       
   136 CONFIGURATION:=REL