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