sbsv1/buildsystem/extension/syslibs/test/ecom3_relocatetarget.mk
author lorewang
Wed, 17 Nov 2010 11:21:28 +0800
changeset 684 2defe8c85348
parent 599 fa7a3cc6effd
permissions -rw-r--r--
elf2e32 treatment of ARM$$INIT_ARRAY$$Base can break GCCE builds
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     1
# Copyright (c) 2008-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
# Different from ecom3_postbuild.mk in that on armv5 the RAMONLYTARGETDIR
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    15
# is not \epoc32\data\z\ramonly. It is \epoc32\release\armv5\<CFG>\z\ramonly.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    16
# This template has to preserve the udeb/urel targets.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    17
# Params:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    18
# SOURCES - list of .exe and .dll files to relocate
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
# TARGET - not used
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
# OPTION TARGETDIR - mandatory, it is "ramonly" for ecom testing.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
# OPTION TARGETBASE - optional, overrides \epoc32\release\<platform>\<cfg>\z 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
# OPTION SOURCEDIR -  optional, overrides \epoc32\release\<platform>\<cfg> 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
# 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
TMPROOT:=$(subst \,/,$(EPOCROOT))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
EPOCROOT:=$(patsubst %/,%,$(TMPROOT))/
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
include $(EPOCROOT)epoc32/tools/shell/$(notdir $(basename $(SHELL))).mk
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
# $(/) is actually back slash in Windows environment. Since bld.inf are written
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
# with forward slashes and $(CP) is "copy", this substitution is important.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
TARGETDIR := $(subst /,$(/),$(TARGETDIR))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
ifdef TARGETBASE
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
TARGETBASE := $(subst PLATFORM,$(PLATFORM_PATH),$(TARGETBASE))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
TARGETBASE := $(subst CFG,$(CFG_PATH),$(TARGETBASE))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
TARGETBASE := $(subst /,$(/),$(TARGETBASE))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
DESTDIR:=$(TARGETBASE)/$(TARGETDIR)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
DESTDIR:=$(EPOCROOT)epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/z/$(TARGETDIR)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
ifdef SOURCEDIR
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
SOURCEDIR := $(subst PLATFORM,$(PLATFORM_PATH),$(SOURCEDIR))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
SOURCEDIR := $(subst CFG,$(CFG_PATH),$(SOURCEDIR))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
SOURCEDIR := $(subst /,$(/),$(SOURCEDIR))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
SOURCEDIR := $(EPOCROOT)epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
TARGET_COPY := $(foreach f,$(SOURCES),$(DESTDIR)/$(f) )
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
$(DESTDIR) :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
	$(call createdir,"$@")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
$(TARGET_COPY) :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
	$(CP) $(call slash2generic, $(SOURCEDIR)/$(notdir $@) $@)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
	-$(ERASE) $(call slash2generic, $(SOURCEDIR)/$(notdir $@))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
# The targets invoked by abld...
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
BLD : $(DESTDIR) $(TARGET_COPY)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
MAKMAKE SAVESPACE FREEZE LIB CLEANLIB RESOURCE FINAL :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
	@echo do nothing
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    69
CLEAN : 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    70
	-$(ERASE) $(TARGET_COPY)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    71
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    72
RELEASABLES : 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    73
	@echo $(TARGET_COPY)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    74