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