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