imgtools/imaker/src/imaker.mk
changeset 1 be27ed110b50
child 584 56dd7656a965
equal deleted inserted replaced
0:044383f39525 1:be27ed110b50
       
     1 #
       
     2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 # All rights reserved.
       
     4 # This component and the accompanying materials are made available
       
     5 # under the terms of the License "Symbian Foundation License v1.0"
       
     6 # which accompanies this distribution, and is available
       
     7 # at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     8 #
       
     9 # Initial Contributors:
       
    10 # Nokia Corporation - initial contribution.
       
    11 #
       
    12 # Contributors:
       
    13 #
       
    14 # Description: Default iMaker configuration
       
    15 #
       
    16 
       
    17 
       
    18 
       
    19 #
       
    20 # http://www.gnu.org/software/make/manual/make.html
       
    21 #
       
    22 
       
    23 ifndef __IMAKER_MK__
       
    24 __IMAKER_MK__ := 1
       
    25 
       
    26 # Special reserved characters (ASCII 30 and 31)
       
    27 ichar := 
       
    28 pchar := 
       
    29 
       
    30 comma    := ,
       
    31 ,        := ,
       
    32 empty    :=
       
    33 space    := $(empty) #
       
    34 $(space) := $(space)
       
    35 squot    := '\''
       
    36 '        := '\''
       
    37 \t       := $(empty)	# Tabulator!
       
    38 
       
    39 # Newline
       
    40 define \n
       
    41 
       
    42 
       
    43 endef
       
    44 
       
    45 DEFINE := define
       
    46 
       
    47 [A-Z]   := A B C D E F G H I J K L M N O P Q R S T U V W X Y Z #
       
    48 [a-z]   := a b c d e f g h i j k l m n o p q r s t u v w x y z #
       
    49 [0-9]   := 0 1 2 3 4 5 6 7 8 9 #
       
    50 [spcl]  := ! " \# $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ #
       
    51 charset := $([A-Z])$([a-z])$([0-9])$([spcl])
       
    52 
       
    53 not         = $(if $(strip $1),,1)
       
    54 true        = $(if $(filter-out 0,$(subst 0,0 ,$1)),1)
       
    55 false       = $(if $(call true,$1),,1)
       
    56 iif         = $(if $(call true,$1),$2,$3)
       
    57 defined     = $(filter-out undef%,$(origin $1))
       
    58 equal       = $(if $(strip $(subst $(strip $1),,$2)$(subst $(strip $2),,$1)),,1)
       
    59 select      = $(if $(call equal,$(call lcase,$1),$(call lcase,$2)),$3,$4)
       
    60 everynth    = $(strip $(eval __i_enth :=)$(call _everynth,$1,$(call restwords,$2,$3))$(__i_enth))
       
    61 _everynth   = $(if $2,$(eval __i_enth += $(word 1,$2))$(call _everynth,$1,$(call restwords,$1,$(call restwords,$2))))
       
    62 def2str     = $(if $(or $(call false,$2),$(findstring $(\n),$1)),$(subst $(\t),\t,$(subst $(\n),\n,$(call quote,$1))),$1)
       
    63 cleandef    = $(subst $(ichar)_, ,$(filter-out /*%*/,$(subst /*, /*,$(subst */,*/ ,$(subst $( ),$(ichar)_,$1)))))
       
    64 getwords    = $(subst |, ,$(subst \|,$(ichar):,$(subst $( ),$(ichar)_,$1)))
       
    65 restoreelem = $(strip $(subst $(ichar):,\|,$(subst $(ichar)_, ,$1)))
       
    66 getelem     = $(call restoreelem,$(word $1,$(call getwords,$2)))
       
    67 lcase       = $(call tr,$([A-Z]),$([a-z]),$1)
       
    68 ucase       = $(call tr,$([a-z]),$([A-Z]),$1)
       
    69 pathconv    = $(call iif,$(USE_UNIX),$(subst \,/,$1),$(subst /,\,$1))
       
    70 reverse     = $(if $1,$(call reverse,$(call restwords,$1)) $(word 1,$1))
       
    71 firstwords  = $(if $2,$(wordlist 1,$(words $(wordlist $1,$(words $2),$2)),$2),$(wordlist 1,$(words $(wordlist 2,$(words $1),$1)),$1))
       
    72 restwords   = $(if $2,$(wordlist $1,$(words $2),$2),$(wordlist 2,$(words $1),$1))
       
    73 restelems   = $(call restoreelem,$(subst $( ),|,$(call restwords,$1,$(call getwords,$2))))
       
    74 substm      = $(eval __i_str := $3)$(strip $(foreach w,$1,$(eval __i_str := $(subst $w,$2,$(__i_str)))))$(__i_str)
       
    75 substs      = $(subst $(ichar)\,$2,$(subst $1,$2,$(subst $2,$(ichar)\,$3)))
       
    76 quote       = $(call substs,\t,\\\t,$(call substs,\n,\\\n,$1))
       
    77 quoteval    = $(subst \#,\\\#,$(subst $$,$$$$,$1))
       
    78 sstrip      = $(subst $( ),,$(strip $1))
       
    79 
       
    80 strlen = $(call _str2chars,$1)$(words $(__i_str))
       
    81 substr = $(call _str2chars,$3)$(subst $(ichar), ,$(subst $( ),,$(wordlist $1,$(if $2,$2,$(words $(__i_str))),$(__i_str))))
       
    82 _str2chars = $(strip\
       
    83   $(eval __i_str := $(subst $( ),$(ichar),$1))\
       
    84   $(foreach c,$(charset)$(ichar),$(eval __i_str := $(subst $c,$c ,$(__i_str)))))
       
    85 
       
    86 tr =\
       
    87   $(strip $(eval __i_tr := $3)\
       
    88   $(foreach c,\
       
    89     $(join $(addsuffix :,$1),$2),\
       
    90     $(eval __i_tr := $(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)),$(__i_tr))))$(__i_tr))
       
    91 
       
    92 pquote      = q$(pchar)$1$(pchar)
       
    93 peval       = @PEVAL{$(call substs,|,\|,$1)}LAVEP@
       
    94 phex        = $(call peval,sprintf(q(%0$(if $2,$2,8)X),$(subst 0x0x,0x,$1)))
       
    95 pabs2rel    = $(call peval,GetRelFname($(call pquote,$1$), $(call pquote,$2)))
       
    96 pfilesize   = $(call peval,-s $(call pquote,$1) || 0)
       
    97 prepeat     = $(call peval,$(call pquote,$2) x ($1))
       
    98 pstr2xml    = $(call peval,Str2Xml($(call pquote,$1)))
       
    99 pmatch      = $(call peval,$(call pquote,$1) =~ m$(pchar)$2$(pchar)m $(if $3,$3,&& $$1 || q(???)))
       
   100 pgrep       = $(call peval,\
       
   101   $(eval __i_notfound := $(call pquote,$(if $4,$4,???)))\
       
   102   open(F, $(call pquote,$1)) or return($(__i_notfound));\
       
   103   $$_ = $(if $2,Uni2Ascii)(join(q(), <F>));\
       
   104   $$_ = Quote($(if $3,m$(pchar)$3$(pchar)m ? $$1 : $(__i_notfound),$$_));\
       
   105   s/\n/\\\n/g; s/\t/\\\t/g;\
       
   106   close(F); return($$_))
       
   107 
       
   108 getlastdir = $(foreach file,$1,$(notdir $(patsubst %/,%,$(file))))
       
   109 upddrive   = $(if $2,$2,$(EPOCDRIVE))$(if $(filter %:,$(call substr,1,2,$1)),$(call substr,3,,$1),$1)
       
   110 dir2inc    = $(foreach dir,$1,-I$(call upddrive,$(dir)))
       
   111 findfile   = $(foreach file,$1,$(eval __i_ffile := $(call _findfile,$(addsuffix /$(file),$2)))$(if $(__i_ffile),$(__i_ffile),$(file)))
       
   112 _findfile  = $(if $1,$(eval __i_ffile := $(wildcard $(word 1,$1)))$(if $(__i_ffile),$(__i_ffile),$(call _findfile,$(call restwords,$1))))
       
   113 
       
   114 filterwcard = $(shell $(PERL) -Xe '\
       
   115   (my $$re = q$(ichar)$1$(ichar)) =~ s/(.)/{q(*)=>q(.*),q(?)=>q(.),q([)=>q([),q(])=>q(])}->{$$1} || qq(\Q$$1\E)/ge;\
       
   116     print(map(qq( $$_), sort({lc($$a) cmp lc($$b)} grep(/^$$re$$/, split(/\s+/, q$(ichar)$2$(ichar))))))')
       
   117 
       
   118 cppdef2var =\
       
   119   $(if $(wildcard $1),\
       
   120     $(eval __i_def2var := $(shell $(PERL) -Xe '\
       
   121       print(join(q(|), map(/^\s*\#define\s+(\S+)\s*(.*?)\s*$$/ ? qq($$1?=) . ($$2 eq q() ? 1 : $$2) : (),\
       
   122         sort({lc($$a) cmp lc($$b)} qx$(pchar)$(CPP) -nostdinc -undef -dM $(call dir2inc,$2) $(call upddrive,$1)$(pchar)))))'))\
       
   123     $(foreach assign,$(call getwords,$(__i_def2var)),$(eval $(call restoreelem,$(assign)))),\
       
   124   $(eval include $1))
       
   125 
       
   126 mac2cppdef = $(foreach def,$1,$(if\
       
   127   $(filter -D% --D%,$(def)),$(eval __i_def := $(subst =, ,$(patsubst $(if $(filter --D%,$(def)),-)-D%,%,$(def))))\
       
   128     $(\n)$(if $(filter -D%,$(def)),\#undef  $(word 1,$(__i_def))$(\n)\#define,define ) $(word 1,$(__i_def)) $(word 2,$(__i_def)),\
       
   129   $(if $(filter -U%,$(def)),$(\n)\#undef $(patsubst -U%,%,$(def)))))
       
   130 
       
   131 EPOCDRIVE   := $(eval EPOCDRIVE := $(call substr,1,2,$(CURDIR)))$(if $(filter %:,$(EPOCDRIVE)),$(EPOCDRIVE))
       
   132 EPOC32      := $(patsubst %/,%,$(subst \,/,$(EPOCROOT)))/epoc32
       
   133 E32ROM      := $(EPOC32)/rom
       
   134 E32ROMCFG   := $(E32ROM)/config
       
   135 E32ROMINC   := $(E32ROM)/include
       
   136 E32ROMBLD   := $(EPOC32)/rombuild
       
   137 E32INC      := $(EPOC32)/include
       
   138 E32INCCFG   := $(E32INC)/config
       
   139 E32TOOLS    := $(EPOC32)/tools
       
   140 E32GCCBIN   := $(EPOC32)/gcc/bin
       
   141 
       
   142 ITOOL_DIR   ?= $(E32TOOLS)/rom
       
   143 ITOOL_PATH  :=
       
   144 IMAKER_DIR  ?= $(ITOOL_DIR)/imaker
       
   145 IMAKER_TOOL := $(IMAKER_DIR)/imaker.pl
       
   146 
       
   147 CPP       ?= $(if $(wildcard $(E32TOOLS)/scpp.exe),$(E32TOOLS)/scpp.exe,cpp)
       
   148 PERL      ?= perl
       
   149 PYTHON    ?= python
       
   150 USE_UNIX  := $(if $(findstring cmd.exe,$(call lcase,$(SHELL)))$(findstring mingw,$(call lcase,$(MAKE))),0,1)
       
   151 NULL      := $(call iif,$(USE_UNIX),/dev/null,nul)
       
   152 DONOTHING := $(call iif,$(USE_UNIX),\#,rem)
       
   153 
       
   154 YEAR  := $(call substr,1,4,$(TIMESTAMP))
       
   155 YEAR2 := $(call substr,3,4,$(TIMESTAMP))
       
   156 MONTH := $(call substr,5,6,$(TIMESTAMP))
       
   157 DAY   := $(call substr,7,8,$(TIMESTAMP))
       
   158 WEEK  := $(call substr,15,,$(TIMESTAMP))
       
   159 
       
   160 CURDIR := $(call substr,$(call select,$(call substr,1,2,$(CURDIR)),$(EPOCDRIVE),3,1),,$(CURDIR))
       
   161 CURDIR := $(CURDIR:/=/.)
       
   162 USER   := $(or $(USERNAME),$(shell $(PERL) -Xe 'print(getlogin())'))
       
   163 
       
   164 MAKECMDGOALS ?= $(.DEFAULT_GOAL)
       
   165 TARGET        = $(word 1,$(MAKECMDGOALS))
       
   166 TARGETNAME    = $(word 1,$(subst -, ,$(TARGET)))
       
   167 TARGETID      = $(subst $( ),_,$(call restwords,$(subst _, ,$(TARGETNAME))))
       
   168 TARGETEXT     = $(findstring -,$(TARGET))$(subst $( ),-,$(call restwords,$(subst -, ,$(TARGET))))
       
   169 
       
   170 CLEAN     = 1
       
   171 BUILD     = 1
       
   172 KEEPGOING = 0
       
   173 KEEPTEMP  = 0
       
   174 PRINTCMD  = 0
       
   175 SKIPPRE   = 0
       
   176 SKIPBLD   = 0
       
   177 SKIPPOST  = 0
       
   178 VERBOSE   = 1
       
   179 
       
   180 CONFIGROOT ?= $(E32ROMCFG)
       
   181 
       
   182 LABEL      =
       
   183 NAME       = $(PRODUCT_NAME)$(LABEL)
       
   184 WORKDIR    = $(if $(PRODUCT_NAME),$(E32ROMBLD)/$(PRODUCT_NAME),$(CURDIR))
       
   185 WORKPREFIX = $(WORKDIR)/$(NAME)
       
   186 WORKNAME   = $(WORKPREFIX)
       
   187 
       
   188 CLEAN_WORKAREA  = del | $(WORKDIR)/* | deldir | $(WORKDIR)/*
       
   189 ALL.CLEAN.STEPS = $(ALL.IMAGE.STEPS) WORKAREA
       
   190 
       
   191 
       
   192 ###############################################################################
       
   193 #
       
   194 
       
   195 CMDFILE = $(WORKPREFIX)$(if $(notdir $(WORKPREFIX)),_)$(call substm,* : ?,@,$(TARGET)).icmd
       
   196 #LOGFILE = $(if $(IMAGE_TYPE),$($(IMAGE_TYPE)_PREFIX)_$(call lcase,$(IMAGE_TYPE))_imaker,$(WORKDIR)/log/$(basename $(notdir $(CMDFILE)))).log
       
   197 export LOGFILE ?= $(WORKDIR)/log/$(basename $(notdir $(CMDFILE))).log
       
   198 
       
   199 BUILD_EMPTY = echo-q | Empty target, nothing to build.
       
   200 
       
   201 CLEAN_IMAKERPRE = $(CLEAN_IMAKEREVAL) | del | "$(CMDFILE)" "$(IMAKER_VARXML)"
       
   202 BUILD_IMAKERPRE =\
       
   203   $(call testnewapi,$(strip $(API_TEST))) |\
       
   204   $(if $(filter help% print-%,$(MAKECMDGOALS)),,$(if $(and $(IMAKER_VARXML),$(IMAKER_VARLIST)),\
       
   205     write | $(IMAKER_VARXML) | $(call def2str,$(IMAKER_XMLINFO))))
       
   206 
       
   207 IMAKER_VARXML  = $(if $(IMAGE_TYPE),$($(IMAGE_TYPE)_PREFIX)_$(TARGET)_config.xml)
       
   208 IMAKER_VARLIST = NAME WORKDIR
       
   209 
       
   210 define IMAKER_XMLINFO
       
   211   <?xml version="1.0" encoding="utf-8"?>
       
   212   <build>
       
   213   \    <config type="$(MAKECMDGOALS)">
       
   214   $(foreach var,$(IMAKER_VARLIST),
       
   215   \        <set name="$(var)" value="$(call pstr2xml,$($(var)))"/>)
       
   216   \    </config>
       
   217   </build>
       
   218 endef
       
   219 
       
   220 BUILD_PRINTVAR = $(call peval,DPrint(1,\
       
   221   $(foreach var1,$(subst $(,), ,$(subst print-,,$(filter print-%,$(MAKECMDGOALS)))),\
       
   222     $(foreach var2,$(call filterwcard,$(var1),$(filter-out BUILD_PRINTVAR,$(filter $(word 1,$(call substm,* ? [, ,$(var1)))%,$(.VARIABLES)))),\
       
   223       $(call pquote,$(var2) = `$(call def2str,$($(var2)))$').qq(\n),))); return(q()))
       
   224 
       
   225 IMAKER_EVAL = $(strip\
       
   226   $(foreach file,$(call getwords,$(value MKFILE_LIST)),$(eval __i_file := $(call restoreelem,$(file)))$(eval -include $(__i_file)))\
       
   227   $(foreach file,$(call getwords,$(value CPPFILE_LIST)),$(eval __i_file := $(call restoreelem,$(file)))$(call cppdef2var,$(__i_file),$(FEATVAR_IDIR)))\
       
   228   $(LANGUAGE_EVAL)\
       
   229   $(eval ITOOL_PATH := $(if $(ITOOL_PATH),$(ITOOL_PATH)$(,))$(ITOOL_DIR)$(,))\
       
   230   $(eval ITOOL_PATH := $(ITOOL_PATH)$(call iif,$(USE_IINTPRSIS),$(USE_IINTPRSIS)$(,))$(call iif,$(USE_IREADIMG),$(USE_IREADIMG)$(,))$(call iif,$(USE_IROMBLD),$(USE_IROMBLD)$(,)))\
       
   231   $(eval ITOOL_PATH := $(call pathconv,$(subst $(,),$(call iif,$(USE_UNIX),:,;),$(ITOOL_PATH)$(call upddrive,$(E32TOOLS))$(,)$(call upddrive,$(E32GCCBIN)))))\
       
   232   $(eval PATH := $(ITOOL_PATH)$(call iif,$(USE_UNIX),:,;)$(PATH)))
       
   233 
       
   234 IMAKER_CMDARG  := $(value IMAKER_CMDARG)
       
   235 IMAKER_MAKECMD := $(value IMAKER_MAKECMD)
       
   236 IMAKER_PERLCMD :=
       
   237 IMAKER_SUBMAKE :=
       
   238 
       
   239 define IMAKER
       
   240   $(if $(and $(filter-out help-config,$(filter help-% print-%,$(MAKECMDGOALS))),$(IMAKER_PERLCMD)),-$(DONOTHING),
       
   241     $(if $(IMAKER_PERLCMD),,$(IMAKER_EVAL))
       
   242     $(eval __i_steps := $1)
       
   243     $(if $(findstring |,$(__i_steps)),
       
   244       $(eval IMAKER_PERLCMD := -)
       
   245       $(foreach target,$(call getwords,$(__i_steps)),$(if $(call restoreelem,$(target)),
       
   246         $(eval IMAKER_SUBMAKE += $(words $(IMAKER_SUBMAKE) x))
       
   247         $(subst $(MAKECMDGOALS) |,,$(IMAKER_MAKECMD) |)IMAKER_SUBMAKE="$(IMAKER_SUBMAKE)" $(call restoreelem,$(target)) $(call restwords,$(MAKECMDGOALS))$(\n))),
       
   248       $(eval __i_steps := $(if $(strip $(__i_steps)),$(foreach step,$(__i_steps),\
       
   249         $(eval __i_step := $(word 1,$(subst :, ,$(step))))$(eval __i_attrib := $(word 2,$(subst :, ,$(step))))\
       
   250         $(if $(call defined,STEPS_$(__i_step)),\
       
   251           $(foreach step2,$(STEPS_$(__i_step)),$(if $(__i_attrib),$(word 1,$(subst :, ,$(step2))):$(__i_attrib),$(step2))),\
       
   252           $(step))),EMPTY:b))
       
   253       $(eval __i_steps := IMAKERPRE:cbk$(call sstrip,$(foreach step,$(__i_steps),\
       
   254         $(eval __i_step := $(word 1,$(subst :, ,$(step))))$(eval __i_attrib := $(word 2,$(subst :, ,$(step))))\
       
   255         -$(__i_step):$(or $(findstring c,$(__i_attrib)),$(call iif,$(CLEAN),c))$(or $(findstring b,$(__i_attrib)),$(call iif,$(BUILD),b))\
       
   256         $(or $(findstring k,$(__i_attrib)),$(call iif,$(KEEPGOING),k)))))
       
   257       $(eval IMAKER_STEPS := $(__i_steps))
       
   258       $(eval __i_steps :=\
       
   259         $(if $(filter print-%,$(MAKECMDGOALS)),IMAKERPRE:cbk-PRINTVAR:b,\
       
   260           $(if $(filter-out help-config,$(filter help-%,$(MAKECMDGOALS))),IMAKERPRE:cbk-HELPDYNAMIC:b-HELP:b,$(__i_steps))))
       
   261       $(eval IMAKER_PERLCMD := $(PERL) -x $(IMAKER_TOOL)\
       
   262         --cmdfile "$(CMDFILE)"\
       
   263         $(if $(LOGFILE),--logfile "$(if $(word 2,$(IMAKER_SUBMAKE))$(IMAKER_PERLCMD)$(MAKE_RESTARTS),>>$(LOGFILE:>>%=%),$(LOGFILE))")\
       
   264         $(call iif,$(PRINTCMD),--printcmd)\
       
   265         --step "$(__i_steps)"\
       
   266         $(if $(VERBOSE),--verbose "$(call select,$(VERBOSE),debug,127,$(VERBOSE))")\
       
   267         $(if $(WORKDIR),--workdir "$(WORKDIR)"))
       
   268       -$(PERL) -Xe '$(if $(wildcard $(WORKDIR)),,use File::Path; eval { mkpath(q$(ichar)$(WORKDIR)$(ichar)) };)\
       
   269         open(ICMD, q$(ichar)>$(CMDFILE)$(ichar));\
       
   270         $(eval __i_submake := $(words $(IMAKER_SUBMAKE)))\
       
   271         print(ICMD $(foreach var,IMAKER_VERSION IMAKER_CMDARG IMAKER_MAKECMD IMAKER_PERLCMD $(if $(IMAKER_SUBMAKE),IMAKER_SUBMAKE|__i_submake)\
       
   272           IMAKER_EXITSHELL SHELL MAKE MAKEFLAGS MAKECMDGOALS $$@|@ MAKELEVEL MAKE_RESTARTS MAKEFILE_LIST .INCLUDE_DIRS FEATVAR_IDIR CPPFILE_LIST\
       
   273           EPOCROOT ITOOL_DIR IMAKER_DIR ITOOL_PATH PATH,\
       
   274           sprintf(qq(\# %-17s),q($(word 1,$(subst |, ,$(var))))).q$(ichar)= `$($(or $(word 2,$(subst |, ,$(var))),$(var)))$'$(ichar).qq(\n),));\
       
   275         close(ICMD)'
       
   276       $(foreach step,$(subst -, ,$(__i_steps)),\
       
   277         $(eval __i_step := $(word 1,$(subst :, ,$(step))))$(eval __i_attrib := $(subst $(__i_step),,$(step)))\
       
   278         $(eval __i_clean := $(findstring c,$(__i_attrib)))$(eval __i_build := $(findstring b,$(__i_attrib)))\
       
   279         -$(PERL) -Xe 'open(ICMD, q$(ichar)>>$(CMDFILE)$(ichar));\
       
   280           print(ICMD qq(\n)\
       
   281             $(if $(eval __i_imgtype := $(IMAGE_TYPE))$(__i_imgtype),,\
       
   282               $(eval IMAGE_TYPE += $(foreach type,CORE ROFS2 ROFS3 ROFS4 ROFS5 ROFS6 UDA,$(findstring $(type),$(step))))\
       
   283               $(eval IMAGE_TYPE := $(word 1,$(IMAGE_TYPE))))\
       
   284             $(if $(__i_clean),.q$(ichar)CLEAN_$(__i_step)=$(CLEAN_$(__i_step))$(ichar).qq(\n))\
       
   285             $(if $(__i_build),.q$(ichar)BUILD_$(__i_step)=$(BUILD_$(__i_step))$(ichar).qq(\n)));\
       
   286             $(eval IMAGE_TYPE := $(__i_imgtype))\
       
   287           close(ICMD)'$(\n))
       
   288       $(IMAKER_PERLCMD)
       
   289       $(eval IMAKER_CMDARG :=))
       
   290   )
       
   291 endef
       
   292 
       
   293 
       
   294 ###############################################################################
       
   295 # Test if old variables are in use
       
   296 
       
   297 define API_TEST
       
   298 #  OLD_VARIABLE1     NEW_VARIABLE1
       
   299 #  OLD_VARIABLEn     NEW_VARIABLEn
       
   300 
       
   301   CUSTVARIANT_MKNAME  VARIANT_MKNAME
       
   302   CUSTVARIANT_CONFML  VARIANT_CONFML
       
   303   CUSTVARIANT_CONFCP  VARIANT_CONFCP
       
   304 endef
       
   305 
       
   306 testnewapi = $(if $1,\
       
   307   $(if $(call defined,$(word 1,$1)),\
       
   308     warning | 1 | ***************************************\n |\
       
   309     warning | 1 | Old-style variable found: $(word 1,$1) ($(origin $(word 1,$1)))\n |\
       
   310     warning | 1 | Instead$(,) start using $(word 2,$1)\n |)\
       
   311   $(call testnewapi,$(call restwords,3,$1)))
       
   312 
       
   313 
       
   314 ###############################################################################
       
   315 # Targets
       
   316 
       
   317 .PHONY: version clean
       
   318 
       
   319 .SECONDEXPANSION:
       
   320 version: ;@$(DONOTHING)
       
   321 
       
   322 clean: CLEAN     = 1
       
   323 clean: BUILD     = 0
       
   324 clean: KEEPGOING = 1
       
   325 clean: LOGFILE   =
       
   326 clean:\
       
   327   ;@$(call IMAKER,$$(ALL.CLEAN.STEPS))
       
   328 
       
   329 print-%: ;@$(call IMAKER)
       
   330 
       
   331 step-% : ;@$(call IMAKER,$(subst -, ,$*))
       
   332 
       
   333 #==============================================================================
       
   334 
       
   335 include $(addprefix $(IMAKER_DIR)/imaker_,$(addsuffix .mk,help image minienv public tools version))
       
   336 
       
   337 -include $(IMAKER_DIR)/imaker_extension.mk
       
   338 
       
   339 
       
   340 ###############################################################################
       
   341 #
       
   342 
       
   343 else
       
   344 ifeq ($(__IMAKER_MK__),1)
       
   345 __IMAKER_MK__ := 2
       
   346 
       
   347 -include $(IMAKER_DIR)/imaker_extension.mk
       
   348 
       
   349 
       
   350 ###############################################################################
       
   351 #
       
   352 
       
   353 else
       
   354 $(error Do not include imaker.mk, it is handled by iMaker!)
       
   355 endif
       
   356 
       
   357 endif # __IMAKER_MK__
       
   358 
       
   359 # END OF IMAKER.MK