hostsupport/hostbuild/flm/hostbuild.flm
author Matt Plumtree <matt.plumtree@nokia.com>
Tue, 26 Oct 2010 14:14:43 +0100
branchbug235_bringup_0
changeset 68 8d4efe9fa1cf
child 69 3f914c77c2e9
permissions -rw-r--r--
Add a new FLM for building the host side DLLs (based on the x86build FLM). Fixup the OpenGL ES 1.1 code to remove warnings when built with GCC(some remain).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
68
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
     1
# Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
     2
# All rights reserved.
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
     3
# This component and the accompanying materials are made available
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
     4
# under the terms of the License "Eclipse Public License v1.0"
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
     5
# which accompanies this distribution, and is available
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
     7
#
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
     8
# Initial Contributors:
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
     9
# Nokia Corporation - initial contribution.
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    10
#
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    11
# Contributors:
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    12
#
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    13
# Description:
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    14
# FLM to build x86 exes, libs and dlls
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    15
#
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    16
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    17
include $(FLMHOME)/flmtools.mk
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    18
include $(FLMHOME)/metaflm.mk
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    19
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    20
CREATABLEPATHS:=
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    21
CLEANTARGETS:=
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    22
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    23
# Handle Window/Linux differences
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    24
ifeq ($(OSTYPE),cygwin)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    25
  DOTDLL:=.dll
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    26
  WIN32:=1
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    27
  GCOVDIR:=$(if $(CODE_COVERAGE),$(EPOCROOT)/epoc32/gcc_mingw/libgcc/mingw32/3.4.5/)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    28
else
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    29
  DOTDLL:=.so
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    30
endif
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    31
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    32
# Product include files are different for S60
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    33
ifdef S60_BUILD
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    34
  PRODUCT_INCLUDE:=$(EPOCROOT)/epoc32/include/oem/bldvariant.hrh
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    35
else
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    36
  PRODUCT_INCLUDE:=$(EPOCROOT)/epoc32/include/variant/Symbian_OS.hrh
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    37
endif
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    38
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    39
# Define macros we need
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    40
CXXDEFS:=$(foreach def,$(MACROS),-D$(def)) -D__GCC32__ -D__EPOC32__ -D__X86__ -D_UNICODE -D__SUPPORT_CPP_EXCEPTIONS__ -D__TOOLS2__ -D'__PRODUCT_INCLUDE__="$(PRODUCT_INCLUDE)"'
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    41
ifeq ($(CFG_PATH),deb)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    42
  CXXDEFS+= -D_DEBUG
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    43
endif
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    44
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    45
# Setup the command line options for the compiler
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    46
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
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    47
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    48
PREINC=$(EPOCROOT)/epoc32/include/tools/hostbuild.h
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    49
ifeq ($(CFG_PATH),deb)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    50
  CXXOPT:=-fshort-wchar -x c++ -O0 -g3 -Wall -c -fmessage-length=0 -include $(PREINC)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    51
else
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    52
  CXXOPT:=-fshort-wchar -x c++ -Wall -c -fmessage-length=0 -include $(PREINC) $(if $(CODE_COVERAGE),-O0,$(OPTIMISE))
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    53
endif
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    54
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    55
# Allow specification of additional build include file
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    56
ifdef BUILDINC
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    57
  CXXOPT+= -include $(BUILDINC)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    58
endif
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    59
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    60
# Extra options needed for cia files
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    61
ASMOPT:=-fomit-frame-pointer -masm=intel
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    62
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    63
# Linker options for DLL
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    64
ifndef DLL_WIN_LINKER_OPTS
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    65
  DLL_WIN_LINKER_OPTS:=$(if $(CODE_COVERAGE),-lgcov) -Wl,-export-all-symbols -Wl,--enable-auto-import
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    66
endif
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    67
ifndef DLL_LIN_LINKER_OPTS
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    68
  DLL_LIN_LINKER_OPTS:=$(if $(CODE_COVERAGE),-lgcov) -Wl,-export-all-symbols -ldl
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    69
endif
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    70
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    71
# Source files to scan for in a directory
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    72
# Note that CPP and cpp will match on the same files - so a sort is necessary on wildcard results
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    73
SOURCE_EXT:=CPP cpp c cia
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    74
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    75
# Source code assumed to be all cpp/cia files in supplied directories
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    76
SOURCE_FILES:=$(foreach dir,$(SOURCE_DIRS),$(sort $(foreach ext,$(SOURCE_EXT),$(wildcard $(EXTENSION_ROOT)/$(dir)/*.$(ext))))) \
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    77
  $(foreach src,$(SOURCE),$(EXTENSION_ROOT)/$(if $(SOURCE_FOLDER),$(SOURCE_FOLDER)/)$(src))
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    78
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    79
# Include folders
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    80
CXXINC:=$(foreach inc,$(INCLUDES) $(SOURCE_DIRS),-I$(EXTENSION_ROOT)/$(inc)) \
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    81
  $(foreach inc,$(SYS_INCLUDES),-I$(EPOCROOT)/$(inc)) -I$(EXTENSION_ROOT)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    82
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    83
# Add standard include paths?
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    84
ifndef NO_STD_INCLUDE
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    85
  CXXINC+= -I$(EPOCROOT)/epoc32/include
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    86
endif
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    87
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    88
# Generate target folder names
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    89
TARGET_DIR:=$(EPOCROOT)/epoc32/release/tools2$(TOOLPLATFORMDIR)/$(CFG_PATH)/
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    90
OUTPUTPATH:=$(EPOCROOT)/epoc32/build/x86tools/$(CFG_PATH)/$(TARGET_NAME)/
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    91
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    92
# Target names differ depending on what we're building
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    93
ifeq ($(TARGET_TYPE),lib)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    94
  TARGET_FULLNAME:=$(TARGET_DIR)lib$(TARGET_NAME)$(if $(findstring .,$(TARGET_NAME)),,.a)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    95
endif
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    96
ifeq ($(TARGET_TYPE),exe)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    97
  TARGET_FULLNAME:=$(TARGET_DIR)$(TARGET_NAME)$(if $(findstring .,$(TARGET_NAME)),,$(DOTEXE))
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    98
endif
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    99
ifeq ($(TARGET_TYPE),dll)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   100
  TARGET_FULLNAME:=$(TARGET_DIR)lib$(TARGET_NAME)$(if $(findstring .,$(TARGET_NAME)),,$(DOTDLL))
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   101
endif
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   102
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   103
# Object files are the same name as the source files with a .o extension
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   104
OBJECTFILES:=$(foreach src,$(SOURCE_FILES),$(OUTPUTPATH)$(subst $(EPOCROOT),,$(src)).o)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   105
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   106
# Remember what we're going to create for later
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   107
CLEANTARGETS:=$(TARGET_FULLNAME) $(OBJECTFILES)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   108
RELEASEABLES:=$(TARGET_FULLNAME)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   109
CREATABLEPATHS:=$(dir $(OBJECTFILES))
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   110
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   111
# Standard targets
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   112
$(ALLTARGET):: $(RELEASEABLES)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   113
TARGET:: $(RELEASEABLES)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   114
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   115
# ***
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   116
# hosttargets
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   117
# 
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   118
define hosttargets
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   119
  # Compile
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   120
  $(OBJECTFILES) : $(PREINC) $(SOURCE_FILES)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   121
		$(call startrule,compile) \
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   122
		$(CXX) $(CXXDEFS) $(CXXINC) -I$(EPOCROOT)$$(subst $(OUTPUTPATH),,$$(dir $$@)) $(CXXOPT) $$(if $$(findstring .cia,$$@),$(ASMOPT),$(if $(CODE_COVERAGE),-fprofile-arcs -ftest-coverage)) $(COMPILE_OPTIONS) -o$$@ $(EPOCROOT)$$(subst $(OUTPUTPATH),,$$(basename $$@)) \
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   123
		$(call endrule,compile)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   124
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   125
  # Link
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   126
  $(TARGET_FULLNAME) : $(OBJECTFILES) $(foreach lib,$(LIBS),$(TARGET_DIR)lib$(lib).a) $(foreach lib,$(SHARED_LIBS),$(TARGET_DIR)lib$(lib)$(DOTDLL))
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   127
  ifeq ($(TARGET_TYPE),lib)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   128
		$(call startrule,linklib) \
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   129
		$(AR) -r $$@ $(OBJECTFILES) \
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   130
		$(call endrule,linklib)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   131
  endif
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   132
  ifeq ($(TARGET_TYPE),exe)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   133
		$(call startrule,linkexe) \
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   134
		$(CXX) -L$(TARGET_DIR) $(if $(GCOVDIR),-L$(GCOVDIR)) -o$$@ $(OBJECTFILES) $(foreach lib,$(LIBS) $(SHARED_LIBS),-l$(lib)) $(if $(CODE_COVERAGE),-lgcov) $(if $(WIN32),-Wl$(CHAR_COMMA)--enable-auto-import,-ldl) \
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   135
		$(call endrule,linkexe)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   136
  endif
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   137
  ifeq ($(TARGET_TYPE),dll)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   138
		$(call startrule,linkdll) \
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   139
		$(CXX) -L$(TARGET_DIR) $(if $(GCOVDIR),-L$(GCOVDIR)) -shared -o$$@ $(OBJECTFILES) $(foreach lib,$(LIBS) $(SHARED_LIBS), -l$(lib)) $(if $(WIN32),$(DLL_WIN_LINKER_OPTS),$(DLL_LIN_LINKER_OPTS)) \
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   140
		$(call endrule,linkdll)
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   141
  endif
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   142
endef
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   143
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   144
# Generate the rules
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   145
$(eval $(hosttargets))
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   146
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   147
# Create folders we need
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   148
$(call makepath,$(CREATABLEPATHS))
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   149
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   150
# Cleanup after ourselves
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   151
$(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS),$(CREATABLEPATHS)))
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   152
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   153
# Tell SBS what we're building
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   154
$(eval $(call whatmacro,$(RELEASEABLES),WHATTOOLS2))