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