sbsv1/buildsystem/shell/cmd.mk
author Ross Qin <ross.qin@nokia.com>
Thu, 28 Oct 2010 11:39:28 +0800
changeset 669 ac2dc5c059f3
parent 599 fa7a3cc6effd
permissions -rw-r--r--
merge with team repo
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     1
# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     2
# All rights reserved.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     3
# This component and the accompanying materials are made available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     4
# under the terms of "Eclipse Public License v1.0"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     5
# which accompanies this distribution, and is available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     7
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     8
# Initial Contributors:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     9
# Nokia Corporation - initial contribution.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    10
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    11
# Contributors:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    12
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    13
# Description:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    14
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    15
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    16
include $(EPOCROOT)epoc32/tools/shell/generic.mk
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    17
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    18
# Host platform dependant variables
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
/:=$(shell echo \)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
;:=;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
CP=copy
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
RM=del
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
RMDIR=rmdir
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
MKDIR=mkdir
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
ERASE=@erase /q 2>>nul
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
# Some tools do not work with slash but only dollar slash.  
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
# That is actually a defect for them and should be fixed.  
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
# Then this macro should be abandoned.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
define slash2generic
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
$(subst /,$/,$(1))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
# Call perl script to create directory. 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
# Used in base/config.mk and many others
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
define createdir
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
perl $(EPOCROOT)epoc32/tools/emkdir.pl $(1)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
# Check if not exist directory then create it first. 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
# Used in BASE/lubbock_miniboot
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
define ifnotexistd
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
if not exist $(1) md $(subst /,\,$(1))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
# This means there are something to add for SBSv2 here.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
# For abld, there is nothing.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
# Used in base/lubbock_miniboot and should be used in similar situation.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
define sbsadd
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
# Add double quotes for abld target. No quote for SBSv2.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
# Used in base/lubbock_miniboot
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
define abldquote
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
"$(1)"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
# Used in Syslibs/conversiontable.mk
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
define generated
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
$(EPOCROOT)epoc32/build/$(1)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
# Used in syslibs/generate_cpp.mk
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
define formatreleasables
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
@echo $(1)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    69
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    70
# Used in BASE/config.mk
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    71
define generatedcpp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    72
$(EPOCROOT)epoc32/build/generatedcpp/hal
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    73
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    74
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    75
# Set path. Used in BASE/bootstrap.mk
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    76
define epocbldabs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    77
$(1)$(2)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    78
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    79
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    80
# Call perl script ecopyfile.pl to copy.  
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    81
# Used in BASE/bootstrap.mk 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    82
define ecopy
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    83
perl $(EPOCROOT)epoc32/tools/ecopyfile.pl 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    84
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    85
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    86
# Abld does not support pipe symbol | while SBSv2 does.  So for Abld it is nothing.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    87
# Used in Base/bootstrap.mk. 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    88
define pipe
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    89
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    90
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    91
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    92
# Call perl script copyfeaturevariants.pl.  Used in BASE/copy_default.mk.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    93
define cpfeature
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    94
perl $(EPOCROOT)epoc32/tools/copyfeaturevariants.pl $(1) $(2)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    95
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    96
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    97
# Used in Syslibs/generate_cpp.mk at the bottom to deal with different
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    98
# way of includeing TEM in Abld and SBSv2.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    99
define include
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   100
$(EPOCROOT)epoc32/tools/makefile_templates/syslibs/generate_cpp.mk
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   101
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   102
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   103
# Macro to change working directory. Used for TOOLS/stlport.mk
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   104
# The path needs to be fixed before passing to cd command
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   105
define chdir
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   106
-cd $(subst /,\,$(1))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   107
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   108
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   109
# Macro to remove files. All paths need to be corrected before deleting.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   110
# Used in TOOLS/stlport.mk
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   111
define remove
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   112
-$(ERASE) $(subst /,\,$(1))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   113
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   114
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   115
# Macro to copy files. Needed for sbsv2 build 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   116
# Used in PDS components in syslibs/*.mk
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   117
define forcecopy
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   118
$(CP) $(subst /,\,$(1)) $(subst /,\,$(2))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   119
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   120
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   121
# Macro to remove files. Needed for sbsv2 build
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   122
# Used in PDS components in syslibs/*.mk
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   123
define forceremove
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   124
-$(ERASE) $(subst /,\,$(1))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   125
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   126
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   127
define tmpmacro
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   128
$(call chdir,$(BUILD_DIR));configure.bat -c gcc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   129
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   130
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   131
define settPath
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   132
1
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   133
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   134
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   135
# Configuration needs to be returned as upper case for abld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   136
CONFIGURATION:=REL