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