deprecated/buildtools/buildsystem/extension/tools/x86tool.mk
author Ross Qin <ross.qin@nokia.com>
Fri, 29 Oct 2010 10:03:48 +0800
changeset 670 46ea84d14897
parent 655 3f65fd25dfd4
permissions -rw-r--r--
remove migrated template meta data files (in DFS_MCL wk42)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
655
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     1
# Copyright (c) 2008-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
# /epoc32/tools/makefile_templates/tools/x86tool.mk
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    15
# SBSv2 issues and differences from SBSv1
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    16
# 1/ The shell is different
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    17
# 2/ The msys shell can't handle absolute paths from root without the drive letter e.g. it can't find /epoc32 but it can find x:/epoc32
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    18
# workaround is to go back to TO_ROOT
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    19
# 3/ The current directory is at the bld.inf rather than /epoc32/build
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    20
# 4/ Backslash is problematic
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    21
# 5/ Path variables include the drive letter x: which causes problems for make when used in targets due to :
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    22
# 6/ TO_ROOT is not defined
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    23
# 7/ Some tool compatibility is problematic e.g. createdir doesn't work with paths containing forward slash
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    24
# 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    25
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    26
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    27
# If this environment variable is defined we're definitely building for win32
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    28
ifdef ComSpec
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    29
WIN32:=1
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    30
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    31
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    32
space:=
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    33
space+=
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    34
LETTERS:=a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    35
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    36
# If win32 isn't defined yet - then we're probably building on sbsv2
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    37
# So see if EPOCROOT starts with a drive letter to work out if we're building for win32
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    38
ifndef WIN32
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    39
  ifneq ($(subst $(space),,$(foreach let,$(LETTERS),$(if $(findstring $(let):,$(EPOCROOT)),1,))),)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    40
    WIN32:=1
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    41
  endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    42
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    43
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    44
# To guarantee there is a slash at the end of EPOCROOT in case there is not.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    45
# This is needed to ensure compatibility with SBSv1.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    46
TMPROOT:=$(subst \,/,$(EPOCROOT))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    47
EPOCROOT:=$(patsubst %/,%,$(TMPROOT))/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    48
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    49
# Get standard shell definitions
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    50
include $(EPOCROOT)epoc32/tools/shell/$(notdir $(basename $(SHELL))).mk
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    51
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    52
# Raptor includes the drive letter on paths - this makefile can't handle the drive letter
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    53
# If we don't do this we get "multiple target patterns" errors in sbsv2
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    54
TMPROOT:=$(strip $(foreach let,$(LETTERS),$(if $(findstring $(let):,$(EPOCROOT)),$(subst $(let):,,$(EPOCROOT)))))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    55
ifneq ($(TMPROOT),)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    56
  EPOCROOT:=$(TMPROOT)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    57
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    58
TMPROOT:=$(strip $(foreach let,$(LETTERS),$(if $(findstring $(let):,$(EXTENSION_ROOT)),$(subst $(let):,,$(EXTENSION_ROOT)))))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    59
ifneq ($(TMPROOT),)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    60
  EXTENSION_ROOT:=$(TMPROOT)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    61
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    62
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    63
# Make up for raptor not defining TO_ROOT properly
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    64
# This might get broken if they change the current directory (which should really be in /epoc32/build)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    65
# We're using TO_ROOT to handle the fact that the msys shell doesn't seem to handle absolute paths
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    66
ifdef WIN32
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    67
  ifeq ($(TO_ROOT),)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    68
    TMPROOT:=$(strip $(foreach let,$(LETTERS),$(if $(findstring $(let):,$(TO_BLDINF)),$(subst $(let):,,$(TO_BLDINF)))))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    69
    TO_ROOT:=.$(subst $(space),,$(foreach word,$(subst /,$(space),$(TMPROOT)),/..))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    70
  endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    71
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    72
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    73
# Handle inconsistent case for build variant
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    74
CFG_PATH:=$(CFG)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    75
ifeq ($(CFG_PATH),DEB)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    76
  CFG_PATH:=deb
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    77
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    78
ifeq ($(CFG_PATH),REL)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    79
  CFG_PATH:=rel
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    80
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    81
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    82
# Set the following to enable code coverage stats
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    83
CODE_COVERAGE:=
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    84
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    85
# Build
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    86
ifdef WIN32
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    87
  TARGET_DIR_REL:=$(EPOCROOT)epoc32/release/tools2/rel/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    88
  TARGET_DIR_DEB:=$(EPOCROOT)epoc32/release/tools2/deb/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    89
  GCOVDIR:=$(if $(CODE_COVERAGE),$(EPOCROOT)epoc32/gcc_mingw/libgcc/mingw32/3.4.5/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    90
else
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    91
  TARGET_DIR_REL:=$(EPOCROOT)epoc32/release/tools2/linux-i386/rel/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    92
  TARGET_DIR_DEB:=$(EPOCROOT)epoc32/release/tools2/linux-i386/deb/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    93
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    94
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    95
# The root to the source code - paths are relative to bld.inf if NOT specified
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    96
# If SOURCE_ROOT specified then it's relative to EPOCROOT
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    97
ifndef SOURCE_ROOT
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    98
  ROOT:=$(subst \,/,$(EXTENSION_ROOT))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    99
  OBJSUBST:=/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   100
else
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   101
  ROOT:=$(EPOCROOT)$(subst $(space)/,/,$(SOURCE_ROOT))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   102
  OBJSUBST:=$(EPOCROOT)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   103
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   104
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   105
# ***
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   106
# STATIC LIBRARY
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   107
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   108
ifeq ($(TARGET_TYPE),lib)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   109
  TARGET_FULLNAME_REL:=$(TARGET_DIR_REL)lib$(TARGET_NAME)$(if $(findstring .,$(TARGET_NAME)),,.a)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   110
  TARGET_FULLNAME_DEB:=$(TARGET_DIR_DEB)lib$(TARGET_NAME)$(if $(findstring .,$(TARGET_NAME)),,.a)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   111
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   112
  ifeq ($(CFG_PATH),deb)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   113
    TARGET_LIB:=$(TARGET_FULLNAME_DEB)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   114
  endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   115
  ifeq ($(CFG_PATH),rel)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   116
    TARGET_LIB:=$(TARGET_FULLNAME_REL)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   117
  endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   118
  TARGET_LIB?=$(TARGET_FULLNAME_REL) $(TARGET_FULLNAME_DEB)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   119
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   120
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   121
# ***
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   122
# EXE
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   123
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   124
ifeq ($(TARGET_TYPE),exe)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   125
  TARGET_FULLNAME_REL:=$(TARGET_DIR_REL)$(TARGET_SUB_DIR)$(TARGET_NAME)$(if $(findstring .,$(TARGET_NAME)),,$(if $(WIN32),.exe))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   126
  TARGET_FULLNAME_DEB:=$(TARGET_DIR_DEB)$(TARGET_SUB_DIR)$(TARGET_NAME)$(if $(findstring .,$(TARGET_NAME)),,$(if $(WIN32),.exe))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   127
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   128
  ifeq ($(CFG_PATH),deb)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   129
    TARGET_BLD:=$(TARGET_FULLNAME_DEB)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   130
  endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   131
  ifeq ($(CFG_PATH),rel)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   132
    TARGET_BLD:=$(TARGET_FULLNAME_REL)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   133
  endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   134
  TARGET_BLD?=$(TARGET_FULLNAME_REL) $(TARGET_FULLNAME_DEB)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   135
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   136
  LIBS+=symexestub
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   137
  ifdef STLPORT
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   138
    LIBS+=-lstlport.5.1
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   139
  endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   140
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   141
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   142
# ***
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   143
# DLL/SO
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   144
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   145
ifeq ($(TARGET_TYPE),dll)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   146
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   147
  TARGET_FULLNAME_REL:=$(TARGET_DIR_REL)$(TARGET_SUB_DIR)lib$(TARGET_NAME)$(if $(findstring .,$(TARGET_NAME)),,$(if $(WIN32),.dll,.so))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   148
  TARGET_FULLNAME_DEB:=$(TARGET_DIR_DEB)$(TARGET_SUB_DIR)lib$(TARGET_NAME)$(if $(findstring .,$(TARGET_NAME)),,$(if $(WIN32),.dll,.so))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   149
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   150
  ifeq ($(CFG_PATH),deb)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   151
    TARGET_BLD:=$(TARGET_FULLNAME_DEB)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   152
  endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   153
  ifeq ($(CFG_PATH),rel)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   154
    TARGET_BLD:=$(TARGET_FULLNAME_REL)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   155
  endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   156
  TARGET_BLD?=$(TARGET_FULLNAME_REL) $(TARGET_FULLNAME_DEB)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   157
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   158
  ifdef STLPORT
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   159
    LIBS+=-lstlport.5.1
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   160
  endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   161
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   162
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   163
# Pick up MINGW compiler from epoc32 on Windows
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   164
ifdef WIN32
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   165
  AR:=$(EPOCROOT)epoc32/gcc_mingw/bin/ar
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   166
  CXX:=$(EPOCROOT)epoc32/gcc_mingw/bin/g++
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   167
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   168
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   169
# Product include files are different for S60
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   170
ifdef S60_BUILD
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   171
  PRODUCT_INCLUDE:=$(EPOCROOT)epoc32/include/oem/bldvariant.hrh
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   172
else
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   173
  PRODUCT_INCLUDE:=$(EPOCROOT)epoc32/include/variant/Symbian_OS.hrh
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   174
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   175
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   176
# Define macros we need
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   177
CXXDEFS_COMMON:=$(foreach def,$(MACROS),-D$(def)) -D__SYMBIAN32__ -D__GCC32__ -D__EPOC32__ -D__X86__ -D_UNICODE -D__SUPPORT_CPP_EXCEPTIONS__ -D__TOOLS2__ -D'__PRODUCT_INCLUDE__="$(PRODUCT_INCLUDE)"'
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   178
CXXDEFS_DEB:=$(CXXDEFS_COMMON) -D_DEBUG
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   179
CXXDEFS_REL:=$(CXXDEFS_COMMON)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   180
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   181
# Setup the command line options for the compiler
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   182
PREINC=$(EPOCROOT)epoc32/include/x86tool/x86tool.h
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   183
CXXOPT_DEB:=-fshort-wchar -x c++ -O0 -g3 -Wall -c -fmessage-length=0 -include $(PREINC) -masm=intel
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   184
OPTIMISE:=-fdefer-pop -fmerge-constants -fthread-jumps -floop-optimize -fif-conversion -fif-conversion2 -fguess-branch-probability -fcprop-registers -fforce-mem -foptimize-sibling-calls -fstrength-reduce -fcse-follow-jumps -fcse-skip-blocks -frerun-cse-after-loop -frerun-loop-opt -fgcse -fgcse-lm -fgcse-sm -fgcse-las -fdelete-null-pointer-checks -fexpensive-optimizations -fregmove -fschedule-insns -fschedule-insns2 -fsched-interblock -fsched-spec -fcaller-saves -fpeephole2 -freorder-blocks -freorder-functions -fstrict-aliasing -funit-at-a-time -falign-functions -falign-jumps -falign-loops -falign-labels -fcrossjumping
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   185
CXXOPT_REL:=-fshort-wchar -x c++ -Wall -c -fmessage-length=0 -include $(PREINC) $(if $(CODE_COVERAGE),-O0,$(OPTIMISE)) -masm=intel
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   186
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   187
# Allow specification of additional build include file
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   188
ifdef BUILDINC
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   189
  CXXOPT_DEB+= -include $(BUILDINC)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   190
  CXXOPT_REL+= -include $(BUILDINC)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   191
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   192
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   193
# Extra options needed for cia files
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   194
ASMOPT:=-fomit-frame-pointer
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   195
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   196
# Linker options for DLL
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   197
ifndef DLL_WIN_LINKER_OPTS
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   198
  DLL_WIN_LINKER_OPTS:= $(if $(CODE_COVERAGE),-lgcov) -Wl,-export-all-symbols
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   199
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   200
ifndef DLL_LIN_LINKER_OPTS
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   201
  DLL_LIN_LINKER_OPTS:= -Wl,-export-all-symbols $(if $(CODE_COVERAGE),-lgcov) -ldl
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   202
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   203
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   204
# Source files to scan for in a directory
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   205
# Note that CPP and cpp will match on the same files - so a sort is necessary on wildcard results
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   206
SOURCE_EXT:=CPP cpp c cia
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   207
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   208
# Source code assumed to be all cpp/cia files in supplied directories
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   209
SOURCE_FILES:=$(foreach dir,$(SOURCE_DIRS),$(sort $(foreach ext,$(SOURCE_EXT),$(wildcard $(ROOT)/$(dir)/*.$(ext))))) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   210
  $(foreach src,$(SOURCE),$(ROOT)/$(if $(SOURCE_FOLDER),$(SOURCE_FOLDER)/)$(src)) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   211
  $(foreach src,$(SOURCE_MOD),$(subst \,/,$(EXTENSION_ROOT))/$(src)) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   212
  $(foreach id,$(SOURCE_IDS),$(foreach src,$($(id)_SOURCE),$(subst $(space)/,/,$(if $($(id)_SOURCE_ROOT),$(EPOCROOT)$($(id)_SOURCE_ROOT),$(ROOT))/$(src))))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   213
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   214
# Include folders
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   215
CXXINC:=$(foreach inc,$(INCLUDES) $(SOURCE_DIRS),-I$(ROOT)/$(inc)) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   216
  $(foreach inc,$(SYS_INCLUDES),-I$(EPOCROOT)$(inc)) -I$(ROOT) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   217
  $(foreach id,$(SOURCE_IDS),$(foreach inc,$($(id)_SOURCE_INC),-I$(subst $(space)/,/,$(if $($(id)_SOURCE_ROOT),$(EPOCROOT)$($(id)_SOURCE_ROOT),$(ROOT)))/$(inc)))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   218
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   219
# Add standard include paths?
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   220
ifndef NO_STD_INCLUDE
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   221
  CXXINC+= -I$(EPOCROOT)epoc32/include/x86tool -I$(EPOCROOT)epoc32/include
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   222
  ifdef S60_BUILD
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   223
    CXXINC+= -I$(EPOCROOT)epoc32/include/oem
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   224
  endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   225
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   226
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   227
# Support for building JNI
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   228
ifdef JAVA_JNI
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   229
  CXXINC+= -I"$(JAVA_HOME)/include"
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   230
  ifdef WIN32
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   231
    CXXINC+= -I"$(JAVA_HOME)/include/win32"
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   232
  else
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   233
    CXXINC+= -I"$(JAVA_HOME)/include/linux"
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   234
  endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   235
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   236
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   237
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   238
# STL Port support needed? Note STL and Symbian won't mix!
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   239
ifdef STLPORT
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   240
  CXXINC+= -I$(EPOCROOT)epoc32/include/tools/stlport 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   241
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   242
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   243
# ***
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   244
# DEBUG
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   245
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   246
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   247
# Object files are the same name as the source files with a .o extension
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   248
OBJECTFILES_DEB:=$(foreach src,$(SOURCE_FILES),deb$(src).o)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   249
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   250
# Compile
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   251
$(OBJECTFILES_DEB) : $(PREINC) $(SOURCE_FILES)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   252
	@echo ***
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   253
	@echo Making: $@
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   254
	$(call createdir,$(dir $@))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   255
	$(CXX) $(CXXDEFS_DEB) $(CXXINC) -I$(subst deb$(OBJSUBST),$(OBJSUBST),$(dir $@)) $(CXXOPT_DEB) $(if $(findstring .cia,$@),$(ASMOPT),$(if $(CODE_COVERAGE),-fprofile-arcs -ftest-coverage)) -o$@ $(subst deb$(OBJSUBST),$(OBJSUBST),$(basename $@))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   256
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   257
# Link
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   258
$(TARGET_FULLNAME_DEB) : $(OBJECTFILES_DEB) $(foreach lib,$(LIBS),$(TARGET_DIR_DEB)lib$(lib).a) $(foreach lib,$(SHARED_LIBS),$(TARGET_DIR_DEB)lib$(lib)$(if $(WIN32),.a,.so))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   259
ifeq ($(TARGET_TYPE),lib)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   260
	@echo ***
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   261
	@echo Creating lib: $@
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   262
	$(AR) -r $(TARGET_FULLNAME_DEB) $(OBJECTFILES_DEB)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   263
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   264
ifeq ($(TARGET_TYPE),exe)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   265
	@echo ***
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   266
	@echo Creating exe: $@
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   267
	$(CXX) -L$(TARGET_DIR_DEB) $(if $(GCOVDIR),-L$(GCOVDIR)) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   268
		-o$(TARGET_FULLNAME_DEB) $(OBJECTFILES_DEB) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   269
		$(foreach lib,$(LIBS) $(SHARED_LIBS), -l$(lib)) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   270
		$(if $(CODE_COVERAGE),-lgcov) $(if $(WIN32),,-ldl)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   271
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   272
ifeq ($(TARGET_TYPE),dll)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   273
  ifdef WIN32
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   274
	@echo ***
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   275
	@echo Creating Windows dll: $@
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   276
	$(CXX) -L$(TARGET_DIR_DEB) $(if $(GCOVDIR),-L$(GCOVDIR)) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   277
		-shared -o$(TARGET_FULLNAME_DEB) $(OBJECTFILES_DEB) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   278
		$(foreach lib,$(LIBS) $(SHARED_LIBS), -l$(lib)) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   279
		-Wl,-out-implib,$(@D)/$(basename $(@F)).a \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   280
		$(DLL_WIN_LINKER_OPTS)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   281
  else
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   282
	@echo ***
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   283
	@echo Creating Linux shared object: $@
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   284
	$(CXX) -L$(TARGET_DIR_DEB) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   285
		-shared -o$(TARGET_FULLNAME_DEB) $(OBJECTFILES_DEB) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   286
		$(foreach lib,$(LIBS) $(SHARED_LIBS), -l$(lib)) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   287
		$(DLL_LIN_LINKER_OPTS)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   288
  endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   289
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   290
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   291
# ***
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   292
# RELEASE
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   293
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   294
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   295
# Object files are the same name as the source files with a .o extension
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   296
OBJECTFILES_REL:=$(foreach src,$(SOURCE_FILES),rel$(src).o)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   297
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   298
# Compile
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   299
$(OBJECTFILES_REL) : $(PREINC) $(SOURCE_FILES)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   300
	@echo ***
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   301
	@echo Making: $@
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   302
	$(call createdir,$(dir $@))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   303
	$(CXX) $(CXXDEFS_REL) $(CXXINC) -I$(subst rel$(OBJSUBST),$(OBJSUBST),$(dir $@)) $(CXXOPT_REL) $(if $(findstring .cia,$@),$(ASMOPT),$(if $(CODE_COVERAGE),-fprofile-arcs -ftest-coverage)) -o$@ $(subst rel$(OBJSUBST),$(OBJSUBST),$(basename $@))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   304
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   305
# Link
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   306
$(TARGET_FULLNAME_REL) : $(OBJECTFILES_REL) $(foreach lib,$(LIBS),$(TARGET_DIR_REL)lib$(lib).a) $(foreach lib,$(SHARED_LIBS),$(TARGET_DIR_REL)lib$(lib)$(if $(WIN32),.a,.so))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   307
ifeq ($(TARGET_TYPE),lib)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   308
	@echo ***
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   309
	@echo Creating lib: $@
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   310
	$(AR) -r $(TARGET_FULLNAME_REL) $(OBJECTFILES_REL)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   311
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   312
ifeq ($(TARGET_TYPE),exe)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   313
	@echo ***
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   314
	@echo Creating exe: $@
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   315
	$(CXX) -L$(TARGET_DIR_REL) $(if $(GCOVDIR),-L$(GCOVDIR)) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   316
		-o$(TARGET_FULLNAME_REL) $(OBJECTFILES_REL) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   317
		$(foreach lib,$(LIBS) $(SHARED_LIBS), -l$(lib)) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   318
		$(if $(CODE_COVERAGE),-lgcov) $(if $(WIN32),,-ldl)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   319
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   320
ifeq ($(TARGET_TYPE),dll)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   321
  ifdef WIN32
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   322
	@echo ***
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   323
	@echo Creating Windows dll: $@	
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   324
	$(CXX) -L$(TARGET_DIR_REL) $(if $(GCOVDIR),-L$(GCOVDIR)) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   325
		-shared -o$(TARGET_FULLNAME_REL) $(OBJECTFILES_REL) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   326
		$(foreach lib,$(LIBS) $(SHARED_LIBS), -l$(lib)) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   327
		-Wl,-out-implib,$(@D)/$(basename $(@F)).a \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   328
		$(DLL_WIN_LINKER_OPTS)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   329
  else
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   330
	@echo ***
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   331
	@echo Creating Linux shared object: $@
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   332
	$(CXX) -L$(TARGET_DIR_REL) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   333
		-shared -o$(TARGET_FULLNAME_REL) $(OBJECTFILES_REL) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   334
		$(foreach lib,$(LIBS) $(SHARED_LIBS), -l$(lib)) \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   335
		$(DLL_LIN_LINKER_OPTS)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   336
  endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   337
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   338
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   339
do_nothing:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   340
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   341
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   342
# The targets invoked by abld...
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   343
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   344
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   345
MAKMAKE : do_nothing
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   346
FREEZE : do_nothing
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   347
RESOURCE : do_nothing
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   348
CLEANLIB : do_nothing
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   349
FINAL : do_nothing
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   350
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   351
SAVESPACE :
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   352
ifeq ($(CFG_PATH),deb)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   353
	$(call remove,$(OBJECTFILES_DEB))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   354
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   355
ifeq ($(CFG_PATH),rel)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   356
	$(call remove,$(OBJECTFILES_REL))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   357
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   358
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   359
LIB : $(TARGET_LIB)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   360
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   361
BLD : $(TARGET_BLD)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   362
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   363
CLEAN :
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   364
	$(call remove,$(foreach file,$(TARGET_LIB) $(TARGET_BLD),$(TO_ROOT)$(file)))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   365
ifeq ($(CFG_PATH),deb)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   366
	$(call remove,$(OBJECTFILES_DEB))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   367
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   368
ifeq ($(CFG_PATH),rel)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   369
	$(call remove,$(OBJECTFILES_REL))
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   370
endif
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   371
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   372
RELEASABLES :
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   373
	@echo $(TARGET_LIB) $(TARGET_BLD)