sbsv1/buildsystem/extension/base/lab_restricted_miniboot.mk
author lorewang
Wed, 17 Nov 2010 11:21:28 +0800
changeset 684 2defe8c85348
parent 599 fa7a3cc6effd
permissions -rw-r--r--
elf2e32 treatment of ARM$$INIT_ARRAY$$Base can break GCCE builds
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     1
# lab_restricted_miniboot.mk
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     2
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     3
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     4
# All rights reserved.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     5
# This component and the accompanying materials are made available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     6
# under the terms of "Eclipse Public License v1.0"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     7
# which accompanies this distribution, and is available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     8
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     9
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    10
# Initial Contributors:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    11
# Nokia Corporation - initial contribution.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    12
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    13
# Contributors:
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
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    17
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    18
TMPROOT:=$(subst \,/,$(EPOCROOT))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
EPOCROOT:=$(patsubst %/,%,$(TMPROOT))/
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
#Set the directories
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
SRCDIR := $(EXTENSION_ROOT)/../../lab_restricted/unistore2/nandboot/miniboot_largeblk
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
# Build directory (EPOCBLD too long)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
BUILDLOC = $(EPOCROOT)epoc32/build/lab_restricted/unistore2/nandboot/miniboot/$(PLATFORM_PATH)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
# Set the target name
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
TARGETDIR := $(EPOCROOT)epoc32/release/$(PLATFORM_PATH)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
TARGET = $(TARGETDIR)$/lab_miniboot.bin
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
TMPTARGET = $(BUILDLOC)$/lab_miniboot.elf
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
TMPTARGET2 = $(BUILDLOC)$/lab_miniboot.bin
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
# Set the Load Address for the miniboot
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
# This is currently set to the beginning of SRAM
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
LINKBASE=0x40200000
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
#Rules
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
vpath %.s . $(SRCDIR)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
ASMSOURCE := miniboot_largeblk.s
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
ARMASM_OUT := $(shell armasm 2>&1)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
ARMASM_OUT_4 := $(word 4,$(ARMASM_OUT))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
# Select the toolchain: ARM RVCT, then GCC
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
#TOOLVER := RVCT
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
OP := --
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
OB := o
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
#Arm RVCT tools
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
ASM_TRUE_MACROS += USE_CXSF
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
ASM := armasm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
LINK := armlink
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
FROMELF := fromelf
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
OBJEXT := o
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
ASM_TRUE_MACRO_CMD := $(foreach macro,$(ASM_TRUE_MACROS),$(OP)predefine "$(macro) SETL {TRUE}")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
ASM_FALSE_MACRO_CMD := $(foreach macro,$(ASM_FALSE_MACROS),$(OP)predefine "$(macro) SETL {FALSE}")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
AFLAGS := -g $(OP)keep $(ASM_TRUE_MACRO_CMD) $(ASM_FALSE_MACRO_CMD) -I$(BUILDLOC)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
LFLAGS := $(OP)ro-base $(LINKBASE) $(OP)entry BootEntry $(OP)FIRST BootEntry $(OP)map
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
SYMOPT := $(OP)symdefs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
ASMTYP := ARMASM
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
define do_asm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68
	$(ASM) $(AFLAGS) -$(OB) $@ $(OP)LIST $(join $(basename $@),.lst) $<
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    69
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    70
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    71
define do_link
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    72
	$(LINK) $(LFLAGS) -$(OB) $@ $(FULLOBJECTS)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    73
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    74
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    75
define do_strip
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    76
	$(FROMELF) $(OP)bin $(OP)output $@ $<
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    77
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    78
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    79
define do_omapsig
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    80
	perl -S $(EPOCROOT)epoc32/tools/omapsig.pl $(LINKBASE) $< $@
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    81
endef
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    82
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    83
ASMOBJECTS := $(foreach f,$(ASMSOURCE),$(basename $(f)).$(OBJEXT))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    84
FULLASMOBJECTS := $(addprefix $(BUILDLOC)/,$(ASMOBJECTS))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    85
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    86
FULLOBJECTS := $(FULLASMOBJECTS)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    87
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    88
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    89
#Link
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    90
$(TMPTARGET) : $(FULLOBJECTS)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    91
	$(do_link)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    92
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    93
#strip
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    94
$(TMPTARGET2) : $(TMPTARGET)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    95
	$(do_strip)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    96
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    97
#omapsig
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    98
$(TARGET) : $(TMPTARGET2)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    99
	$(do_omapsig)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   100
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   101
#Asm objects
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   102
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   103
$(FULLASMOBJECTS) : $(BUILDLOC)/%.$(OBJEXT) : $(SRCDIR)/$(ASMSOURCE) $(FULLINCLUDES) $(FULLBUILTINCLUDES) $(FULLBUILTINCLUDES2) $(FULLBLDINCLUDES) $(FULLGENINCLUDES) $(FULLPLATINCLUDES)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   104
	$(do_asm)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   105
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   106
# make the work directories
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   107
$(TARGETDIR) :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   108
	$(call ifnotexistd,"$(TARGETDIR)")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   109
   
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   110
$(BUILDLOC) :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   111
	$(call ifnotexistd,"$(BUILDLOC)")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   112
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   113
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   114
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   115
MAKMAKE :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   116
	echo Nothing to do
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   117
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   118
FREEZE :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   119
	echo Nothing to do
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   120
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   121
LIB :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   122
	echo Nothing to do
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   123
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   124
CLEANLIB :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   125
	echo Nothing to do
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   126
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   127
RESOURCE :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   128
	echo Nothing to do
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   129
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   130
FINAL :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   131
	echo Nothing to do
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   132
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   133
BLD SAVESPACE : $(TARGETDIR) $(BUILDLOC) $(TARGET)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   134
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   135
RELEASABLES :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   136
	@echo "$(TARGET)"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   137
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   138
CLEAN :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   139
	-$(ERASE) $(call slash2generic,"$(TARGET)")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   140
	-$(ERASE) $(call slash2generic,"$(BUILDLOC)/*.*")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   141