sbsv1/buildsystem/extension/syslibs/generate_cpp.mk
author lorewang
Wed, 01 Dec 2010 16:05:36 +0800
changeset 715 e0739b8406dd
parent 599 fa7a3cc6effd
permissions -rw-r--r--
Specify extenal tool with path
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     1
# Copyright (c) 2000-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
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    15
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    16
# To ensure that EPOCROOT always ends with a forward slash
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    17
TMPROOT:=$(subst \,/,$(EPOCROOT))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    18
EPOCROOT:=$(patsubst %/,%,$(TMPROOT))/
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
include $(EPOCROOT)epoc32/tools/shell/$(notdir $(basename $(SHELL))).mk
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
ifneq ($(FIRST_PASS),completed)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
FIRST_PASS=completed
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
SOURCE_DIRECTORY=$(EXTENSION_ROOT)/../data
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
TOOLS=\
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
$(EPOCROOT)epoc32/tools/PARSER.pm \
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
$(EPOCROOT)epoc32/tools/WRITER.pm \
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
$(EPOCROOT)epoc32/tools/cnvtool.pl
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
TARGET_DIRECTORY:=$(call generated,generatedcpp/charconv)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
TARGET_DIRECTORY2:=$(EPOCROOT)epoc32/tools/charconv
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
ifeq ($(TYPE),dat)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
TARGET_FILES2=$(patsubst %,$(TARGET_DIRECTORY2)/%.dat,$(STEMS))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
$(TARGET_FILES2) : $(TARGET_DIRECTORY2)/%.dat: $(SOURCE_DIRECTORY)/%.txt $(SOURCE_DIRECTORY)/%$(CTL_EXT).ctl $(EXTRA_DEP) $(TOOLS)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
	@$(call createdir,"$(TARGET_DIRECTORY2)")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
	perl $(EPOCROOT)epoc32/tools/cnvtool.pl $(subst .txt,$(CTL_EXT).ctl,$<) $< $@  -flattenHashAndSave $(foreach PARAM,$(EXTRA_PARAMS),"$(PARAM)" )
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
# This is required by parellel build
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
TARGET_FILES=$(patsubst %,$(TARGET_DIRECTORY)/g_%.cpp,$(STEMS)) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
$(TARGET_FILES) : $(TARGET_DIRECTORY)/g_%.cpp: $(SOURCE_DIRECTORY)/%.txt $(SOURCE_DIRECTORY)/%$(CTL_EXT).ctl $(EXTRA_DEP) $(TOOLS)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
	@$(call createdir,"$(TARGET_DIRECTORY)")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
	@$(call createdir,"$(TARGET_DIRECTORY2)")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
	perl $(EPOCROOT)epoc32/tools/cnvtool.pl $(subst .txt,$(CTL_EXT).ctl,$<) $< $@ -generateSourceCode $(foreach PARAM,$(EXTRA_PARAMS),"$(PARAM)" )
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
ifneq ($(TYPE),all)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
DO_NOTHING :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
# do nothing
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68
  # the targets below are the public ones
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    69
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    70
MAKMAKE : $(TARGET_FILES2) $(TARGET_FILES)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    71
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    72
BLD : $(TARGET_FILES2) $(TARGET_FILES)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    73
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    74
SAVESPACE : BLD
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    75
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    76
FREEZE : DO_NOTHING
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    77
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    78
LIB : DO_NOTHING
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    79
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    80
CLEANLIB : DO_NOTHING
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    81
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    82
RESOURCE : DO_NOTHING
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    83
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    84
CLEAN :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    85
	-$(ERASE) $(TARGET_FILES2) $(TARGET_FILES)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    86
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    87
RELEASABLES : DO_NOTHING
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    88
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    89
FINAL : DO_NOTHING
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    90
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    91
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    92
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    93
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    94
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    95
ifeq ($(TYPE),dat)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    96
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    97
RELEASABLES : 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    98
	$(call formatreleasables,$(TARGET_FILES2))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    99
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   100
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   101
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   102
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   103
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   104
ifeq ($(TYPE),all)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   105
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   106
TYPE=dat
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   107
TARGET_FILES2=$(TARGET_FILES)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   108
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   109
include $(call include)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   110
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   111
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   112