sbsv1/buildsystem/extension/base/bootstrap.mk
author Zheng Shen <zheng.shen@nokia.com>
Tue, 26 Oct 2010 11:12:31 +0800
changeset 654 7c11c3d8d025
parent 599 fa7a3cc6effd
permissions -rw-r--r--
romtools 13.2.0.1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     1
# Copyright (c) 2006-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
ifndef CPU
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
CPU := arm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
ifndef LINKBASE
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
LINKBASE := 0x00000000
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
include $(EPOCROOT)epoc32/tools/shell/$(notdir $(basename $(SHELL))).mk
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
PROCEED:=build
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
ifneq "$(PBUILDPID)" ""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
        ifneq "$(CFG)" "UREL"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
                PROCEED:=skip
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
        endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
COPY := $(call ecopy)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
ifeq "$(CPU)" "x86"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
        ifeq "$(MEMMODEL)" "direct"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
                BLDSGL:=s
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
        else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
                ifeq "$(MEMMODEL)" "flexible"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
                        BLDSGL:=f
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
                else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
                        BLDSGL:=
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
                endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
        endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
        ifdef SMP
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
                BLDSMP:=smp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
        else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
                BLDSMP:=
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
        endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
        EPOCROOT:=$(subst /,\,$(EPOCROOT))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
        EPOCBLDABS := $(EPOCROOT)epoc32\build\tasm$(PBUILDPID)\$(BLDSGL)$(VNAME)$(BLDSMP)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
        DRIVELETTER := $(shell cd 2>NUL)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
        DRIVELETTER_2 := $(word 1,$(subst \, ,$(DRIVELETTER)))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
        EPOCBLDABS_1 := $(subst $(TO_ROOT),,$(EPOCBLD))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
        EPOCBLDABS_2 := $(subst $(DRIVELETTER_2),,$(EPOCBLDABS_1))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
        
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
        EPOCBLDABS := $(call epocbldabs,$(DRIVELETTER_2),$(EPOCBLDABS_2))/$(NAME)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
EPOCINC := $(INC_PATH)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
EPOCKERNINC := $(EPOCINC)/kernel
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
EPOCCPUINC := $(EPOCKERNINC)/$(CPU)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68
EPOCMMINC := $(INC_PATH)/memmodel/epoc/$(MEMMODEL)/$(CPU)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    69
EPOCTRG := $(EPOCROOT)epoc32/release/$(PLATFORM_PATH)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    70
TRG := $(EPOCTRG)/$(NAME).bin
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    71
TEMPTRG := $(EPOCBLDABS)/$(NAME).bin
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    72
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    73
ifdef EXTRA_INC_PATH
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    74
ASMINCPATH := $(EXTRA_INC_PATH)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    75
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    76
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    77
ifeq "$(CPU)" "arm"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    78
ASMINCPATH := . $(EPOCBLDABS) $(ASMINCPATH) $(EXTENSION_ROOT) $(EPOCCPUINC)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    79
ARMASM_OUT := $(shell armasm 2>&1)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    80
ARMASM_OUT_4 := $(word 4,$(ARMASM_OUT))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    81
ARMASM_OUT_6 := $(word 6,$(ARMASM_OUT))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    82
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    83
# Use GCC toolchain if no other is available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    84
TOOLVER := GCC
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    85
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    86
RVCTSTR := $(strip $(findstring RVCT, $(ARMASM_OUT_4)))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    87
ifeq "$(RVCTSTR)" "RVCT"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    88
        TOOLVER := RVCT
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    89
        OP := --
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    90
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    91
ifeq "$(ARMASM_OUT_6)" "2.37"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    92
        TOOLVER := 211
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    93
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    94
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    95
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    96
ifeq "$(MEMMODEL)" "direct"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    97
CFG_MM := CFG_MMDirect
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    98
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    99
ifeq "$(MEMMODEL)" "moving"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   100
CFG_MM := CFG_MMMoving
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   101
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   102
ifeq "$(MEMMODEL)" "multiple"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   103
CFG_MM := CFG_MMMultiple
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   104
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   105
ifeq "$(MEMMODEL)" "flexible"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   106
CFG_MM := CFG_MMFlexible
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   107
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   108
ifndef CFG_MM
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   109
$(error Memory model unknown)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   110
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   111
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   112
ASM_MACROS += $(CFG_MM)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   113
ifdef SMP
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   114
        ASM_MACROS += SMP
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   115
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   116
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   117
ifeq "$(CPU)" "x86"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   118
        ifndef BASEINCLUDES
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   119
                BASEINCLUDES := bootcpu.inc bootmacr.inc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   120
        endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   121
        ifndef BASESOURCES
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   122
                BASESOURCES := bootmain.asm bootcpu.asm bootutil.asm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   123
        endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   124
        GENINCLUDES := $(GENINCLUDES) x86boot.h
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   125
        ASMINCPATH := . 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   126
        ASM := tasm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   127
        LINK := tlink
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   128
        EXE2BIN := exe2bin
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   129
        SRCEXT := asm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   130
        INCEXT := inc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   131
        OBJEXT := obj
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   132
        EXEEXT := exe
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   133
        
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   134
        ASMINCPATHCMD := $(foreach dir,$(ASMINCPATH),$(join /i,$(call slash2generic,$(dir))))   
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   135
        ASM_MACRO_CMD := $(foreach macro,$(ASM_MACROS),/d$(macro)=1)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   136
        AFLAGS := /l /m3 /ML /W-PDC $(ASM_MACRO_CMD) $(ASMINCPATHCMD)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   137
        LFLAGS := /m /s /n /3 /c
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   138
        ASMTYP := TASM
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   139
        LINKFILE :=
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   140
        define do_asm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   141
                cd $(EPOCBLDABS) && $(CP) $(call slash2generic,$<) .
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   142
                cd $(EPOCBLDABS) && $(ASM) $(AFLAGS) $(notdir $<)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   143
        endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   144
        define do_link
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   145
                cd $(EPOCBLDABS) && $(LINK) $(LFLAGS) $(filter %.$(OBJEXT),$(foreach obj,$^,$(notdir $(obj)))), temp.exe
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   146
                cd $(EPOCBLDABS) && $(COPY) temp.exe $@
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   147
                cd $(EPOCBLDABS) && $(ERASE) temp.exe
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   148
        endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   149
        define do_strip
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   150
                cd $(EPOCBLDABS) && $(COPY) $< temp.exe
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   151
                cd $(EPOCBLDABS) && $(EXE2BIN) temp.exe temp.bin
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   152
                cd $(EPOCBLDABS) && $(COPY) temp.bin $@
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   153
                cd $(EPOCBLDABS) && $(ERASE) temp.exe temp.bin
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   154
        endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   155
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   156
ifeq "$(CPU)" "arm"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   157
        ifeq "$(TOOLVER)" "211"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   158
                ASM := armasm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   159
                LINK := armlink
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   160
                SRCEXT := s
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   161
                INCEXT := inc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   162
                OBJEXT := o
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   163
                EXEEXT := in
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   164
                ASMINCPATHCMD := $(foreach dir,$(ASMINCPATH),$(join -I ,$(dir)))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   165
                ASM_MACRO_CMD := $(foreach macro,$(ASM_MACROS),-predefine "$(macro) SETL {TRUE}")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   166
                AFLAGS := $(ASM_ARM211_VARIANTFLAGS) -apcs 3/32bit/nosw -Length 0 -Width 200 $(ASM_MACRO_CMD) $(ASMINCPATHCMD)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   167
                LFLAGS := -Base $(LINKBASE) -Data 0xf0000000 -Entry $(LINKBASE) -Bin -map
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   168
                SYMOPT := -symbols
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   169
                ASMTYP := ARMASM
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   170
                LINKFILE :=
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   171
                define do_asm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   172
                        $(ASM) $(AFLAGS) -o $@ -LIST $(join $(basename $@),.lst) $<
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   173
                endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   174
                define do_link
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   175
                        $(LINK) $(LFLAGS) $(SYMOPT) $(join $(basename $@),.sym) -o $@ $(filter %.$(OBJEXT),$^)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   176
                endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   177
                define do_strip
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   178
                        @if exist $@ $(ERASE) $(call slash2generic,$@) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   179
                        $(COPY) $< $@
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   180
                endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   181
        endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   182
        ifeq "$(TOOLVER)" "RVCT"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   183
                ASM_MACROS += USE_CXSF
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   184
                ASM := armasm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   185
                LINK := armlink
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   186
                FROMELF := fromelf
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   187
                SRCEXT := s
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   188
                INCEXT := inc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   189
                OBJEXT := o
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   190
                EXEEXT := in
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   191
                ASMINCPATHCMD := $(foreach dir,$(ASMINCPATH),$(join -I ,$(dir)))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   192
                ASM_MACRO_CMD := $(foreach macro,$(ASM_MACROS),$(OP)predefine "$(macro) SETL {TRUE}")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   193
                AFLAGS := -g $(OP)keep $(ASM_MACRO_CMD) $(ASMINCPATHCMD) $(ASM_RVCT_VARIANTFLAGS)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   194
                LFLAGS := $(OP)ro-base $(LINKBASE) $(OP)entry $(LINKBASE) $(OP)map
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   195
                SYMOPT := $(OP)symdefs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   196
                ASMTYP := ARMASM
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   197
                LINKFILE :=
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   198
                define do_asm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   199
                        $(ASM) $(AFLAGS) -o $@ $(OP)LIST $(join $(basename $@),.lst) $<
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   200
                endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   201
                define do_link
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   202
                        $(LINK) $(LFLAGS) $(SYMOPT) $(join $(basename $@),.sym) -o $@ $(filter %.$(OBJEXT),$^)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   203
                        $(COPY) $@ $(join $(basename $(TRG)),.sym)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   204
                endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   205
                define do_strip
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   206
                        $(FROMELF) $(OP)bin $(OP)output $@ $<
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   207
                endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   208
        endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   209
        ifeq "$(TOOLVER)" "GCC"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   210
                ASM_MACROS += USE_CXSF GNU_ASM
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   211
                ASM := as
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   212
                LINK := ld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   213
                STRIP := strip
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   214
                SRCEXT := s
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   215
                INCEXT := ginc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   216
                OBJEXT := o
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   217
                EXEEXT := in
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   218
                ASMINCPATHCMD := $(foreach dir,$(ASMINCPATH),$(join -I ,$(dir)))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   219
                ASM_MACRO_CMD := $(foreach macro,$(ASM_MACROS),--defsym $(macro)=1 )
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   220
                AFLAGS := -mapcs-32 -R -n $(ASM_MACRO_CMD) -I- $(ASMINCPATHCMD)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   221
                LFLAGS := -n -x --section-alignment 4 --file-alignment 2 -no-whole-archive
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   222
                SYMOPT := -symdefs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   223
                ASMTYP := AS
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   224
                PROCESS_INCLUDES := 1
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   225
                ifndef LINKFILE
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   226
                        LINKFILE := bootstrap.lnk
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   227
                endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   228
                define do_asm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   229
                        perl $(EPOCROOT)epoc32/tools/armasm2as.pl $< $(join $(basename $@),.ss)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   230
                        $(ASM) $(AFLAGS) -acdhlms=$(join $(basename $@),.lst) -o $@ $(join $(basename $@),.ss)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   231
                endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   232
                define do_link
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   233
                        if exist $(join $(basename $@),.lnk) $(ERASE) $(call slash2generic,$(join $(basename $@),.lnk)) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   234
                        $(COPY) $(subst /,\,$(filter %.lnk,$^)) $(join $(basename $@),.lnk)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   235
                        $(LINK) -M -o $@ $(filter %.$(OBJEXT),$^) $(LFLAGS) --script=$(join $(basename $@),.lnk) >$(join $(basename $@),.map)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   236
                endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   237
                define do_strip
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   238
                        $(STRIP) -O binary -o $(TEMPTRG) $<
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   239
                        $(COPY) $(TEMPTRG) $@
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   240
                        $(ERASE) $(call slash2generic,$(TEMPTRG)) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   241
                endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   242
        endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   243
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   244
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
# Generic source files
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   248
ifndef BASESOURCES
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   249
BASESOURCES := bootmain.s bootcpu.s bootutils.s
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   250
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   251
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   252
# Path for generic source files
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   253
ifndef BASESRCPATH
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   254
BASESRCPATH := $(E32PATH)/eka/kernel/$(CPU)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   255
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   256
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   257
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   258
# Generated include files
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   259
GENINCLUDES := $(foreach f,$(GENINCLUDES),$(basename $(f)).$(INCEXT))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   260
GENINCLUDES := $(GENINCLUDES) e32rom.$(INCEXT) kernboot.$(INCEXT)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   261
GENINCLUDES := $(GENINCLUDES) bootdefs.$(INCEXT)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   262
ifneq "$(MEMMODEL)" "direct"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   263
GENINCLUDES := $(GENINCLUDES) mmboot.$(INCEXT)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   264
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   265
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   266
# Headers from which GENINCLUDES are generated
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   267
GENHEADERS = $(foreach inc,$(GENINCLUDES),$(basename $(inc)).h)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   268
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   269
# Non-generated generic include files
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   270
ifndef BASEINCLUDES
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   271
BASEINCLUDES := bootcpu.inc bootmacro.inc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   272
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   273
BASEINCLUDES := $(foreach f,$(BASEINCLUDES),$(basename $(f)).$(INCEXT))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   274
INCLUDES := $(foreach f,$(INCLUDES),$(basename $(f)).$(INCEXT))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   275
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   276
# Generic object files
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   277
BASEOBJECTS = $(foreach src, $(BASESOURCES), $(basename $(src)).$(OBJEXT))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   278
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   279
# Platform specific object files
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   280
OBJECTS = $(foreach src, $(SOURCES), $(basename $(src)).$(OBJEXT))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   281
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   282
# Object files with paths
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   283
FULLBASEOBJECTS = $(addprefix $(EPOCBLDABS)/,$(BASEOBJECTS))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   284
FULLOBJECTS = $(addprefix $(EPOCBLDABS)/,$(OBJECTS))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   285
LINKOBJECTS = $(FULLBASEOBJECTS) $(FULLOBJECTS)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   286
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   287
# Generated include files with paths
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   288
FULLGENINCLUDES = $(addprefix $(EPOCBLDABS)/,$(GENINCLUDES))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   289
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   290
# Tell make where to look for things
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   291
vpath %.h . $(EXTRA_INC_PATH) $(EPOCINC) $(EPOCKERNINC) $(EPOCCPUINC) $(EPOCMMINC)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   292
vpath %.inc . $(EXTRA_INC_PATH) $(EXTENSION_ROOT) $(EPOCINC) $(EPOCKERNINC) $(EPOCCPUINC) $(EPOCMMINC) $(EPOCBLDABS)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   293
vpath %.ginc $(EPOCBLDABS)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   294
vpath %.$(SRCEXT) . $(EXTRA_SRC_PATH) $(EXTENSION_ROOT) $(BASESRCPATH)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   295
vpath %.$(OBJEXT) $(EPOCBLDABS)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   296
vpath %.lnk . $(EXTENSION_ROOT) $(EPOCCPUINC)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   297
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   298
# How to link the object files 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   299
$(EPOCBLDABS)/$(NAME).$(EXEEXT): $(LINKOBJECTS) $(LINKFILE) $(call pipe,$(EPOCBLDABS)) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   300
	$(do_link)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   301
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   302
# How to strip linked object to binary
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   303
$(TRG): $(EPOCBLDABS)/$(NAME).$(EXEEXT)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   304
	$(do_strip)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   305
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   306
# How to assemble the source files
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   307
ifdef PROCESS_INCLUDES
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   308
FULLBASEINCLUDES := $(addprefix $(EPOCBLDABS)/,$(BASEINCLUDES))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   309
FULLINCLUDES := $(addprefix $(EPOCBLDABS)/,$(INCLUDES))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   310
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   311
$(FULLBASEINCLUDES) : $(EPOCBLDABS)/%.$(INCEXT) : %.inc $(call pipe,$(EPOCBLDABS))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   312
	perl $(EPOCROOT)epoc32/tools/armasm2as.pl $< $@
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   313
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   314
$(FULLINCLUDES) : $(EPOCBLDABS)/%.$(INCEXT) : %.inc $(call pipe,$(EPOCBLDABS))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   315
	perl $(EPOCROOT)epoc32/tools/armasm2as.pl $< $@
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   316
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   317
$(FULLBASEOBJECTS) : $(EPOCBLDABS)/%.$(OBJEXT) : %.$(SRCEXT) $(FULLINCLUDES) $(FULLBASEINCLUDES) $(FULLGENINCLUDES) $(call pipe,$(EPOCBLDABS))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   318
	$(do_asm)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   319
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   320
$(FULLOBJECTS) : $(EPOCBLDABS)/%.$(OBJEXT) : %.$(SRCEXT) $(FULLINCLUDES) $(FULLBASEINCLUDES) $(FULLGENINCLUDES) $(call pipe,$(EPOCBLDABS))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   321
	$(do_asm)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   322
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   323
else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   324
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   325
ifeq "$(CPU)" "x86"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   326
FULLBASEINCLUDES := $(addprefix $(EPOCBLDABS)/,$(BASEINCLUDES))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   327
FULLINCLUDES := $(addprefix $(EPOCBLDABS)/,$(INCLUDES))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   328
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   329
$(FULLBASEINCLUDES) $(FULLINCLUDES) : $(EPOCBLDABS)/%.inc : %.inc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   330
	$(CP) $(call slash2generic,$<) $(call slash2generic,$@) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   331
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   332
$(FULLBASEOBJECTS) $(FULLOBJECTS) : $(EPOCBLDABS)/%.$(OBJEXT) : %.$(SRCEXT) $(FULLBASEINCLUDES) $(FULLGENINCLUDES) $(FULLINCLUDES)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   333
	$(do_asm)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   334
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   335
else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   336
$(FULLBASEOBJECTS) $(FULLOBJECTS) : $(EPOCBLDABS)/%.$(OBJEXT) : %.$(SRCEXT) $(BASEINCLUDES) $(FULLGENINCLUDES) $(INCLUDES) $(call pipe,$(EPOCBLDABS))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   337
	$(do_asm)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   338
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   339
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   340
endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   341
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   342
# How to translate the .h files to .inc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   343
$(FULLGENINCLUDES) : $(EPOCBLDABS)/%.$(INCEXT) : %.h $(call pipe,$(EPOCBLDABS))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   344
	perl $(EPOCROOT)epoc32/tools/h2inc.pl $< $@ $(ASMTYP)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   345
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   346
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   347
# How to make the working directories
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   348
$(EPOCBLDABS) $(EPOCTRG) :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   349
	$(call ifnotexistd,$(call slash2generic,$@))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   350
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   351
# Makmake targets
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   352
.PHONY : MAKMAKE FREEZE LIB CLEANLIB RESOURCE FINAL BLD SAVESPACE RELEASABLES CLEAN
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   353
.PHONY : build skip
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   354
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   355
MAKMAKE :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   356
	echo Nothing to do
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   357
	echo $(BASESRCPATH)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   358
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   359
FREEZE :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   360
	echo Nothing to do
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   361
	echo $(BASESRCPATH)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   362
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   363
LIB :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   364
	echo Nothing to do
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   365
	echo $(BASESRCPATH)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   366
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   367
CLEANLIB :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   368
	echo Nothing to do
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   369
	echo $(BASESRCPATH)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   370
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   371
RESOURCE :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   372
	echo Nothing to do
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   373
	echo $(BASESRCPATH)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   374
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   375
FINAL :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   376
	echo Nothing to do
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   377
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   378
BLD SAVESPACE : $(PROCEED)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   379
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   380
RELEASABLES :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   381
	@echo $(TRG)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   382
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   383
CLEAN :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   384
	-$(ERASE) $(call slash2generic,$(TRG)) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   385
	-$(ERASE) $(call slash2generic,$(EPOCBLDABS)/*.*) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   386
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   387
build: $(EPOCTRG) $(EPOCBLDABS) $(TRG)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   388
	echo Bootstrap built for $(PLATFORM) $(CFG)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   389
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   390
skip:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   391
	echo Bootstrap build skipped for $(PLATFORM) $(CFG)