build/Makefile.defs
changeset 78 71ad690e91f5
parent 67 63b81d807542
child 80 d6dafc5d983f
equal deleted inserted replaced
72:1f0034e370aa 78:71ad690e91f5
    26   else
    26   else
    27     export BUILDENV = linux
    27     export BUILDENV = linux
    28   endif
    28   endif
    29 endif
    29 endif
    30 
    30 
       
    31 # Determine if we're building jrt or jrtext
       
    32 GEN_BUILD_FILES_DIR = $(if $(JRTEXT_SRC_ROOT),$(JRTEXT_SRC_ROOT),$(JAVA_SRC_ROOT))
       
    33 
    31 # S60 release file (written if release is given explicitly on commandline)
    34 # S60 release file (written if release is given explicitly on commandline)
    32 RD_JAVA_S60_RELEASE_FILE = $(JAVA_SRC_ROOT)/inc/java_s60_release.hrh
    35 RD_JAVA_S60_RELEASE_FILE = $(GEN_BUILD_FILES_DIR)/inc/java_s60_release.hrh
    33 
    36 
    34 include $(JAVA_SRC_ROOT)/build/Makefile.project
    37 include $(JAVA_SRC_ROOT)/build/Makefile.project
    35 
    38 
    36 ifeq ($(BUILDENV),symbian)
    39 ifeq ($(BUILDENV),symbian)
    37   export PLATFORM = winscw
    40   export PLATFORM = winscw
    38   export JAVA_BIN_ROOT=$(EPOCROOT)winscw/c/java
    41   export JAVA_BIN_ROOT=$(EPOCROOT)winscw/c/java
    39   ifeq ($(JAVA_6_HOME), )
    42   ifeq ($(JAVA_6_HOME), )
    40   $(error The environment variable JAVA_6_HOME is not defined)
    43   $(error The environment variable JAVA_6_HOME is not defined)
    41   endif
    44   endif
    42   export JAVA_HOME=$(JAVA_6_HOME)
    45   export JAVA_HOME=$(JAVA_6_HOME)
       
    46   HASH_CHAR=\#
    43 
    47 
    44   ifeq ($(notdir $(basename $(SHELL))),sh)
    48   ifeq ($(notdir $(basename $(SHELL))),sh)
    45     # Cygwin & Linux definitions
    49     # Cygwin & Linux definitions
    46     BATPREFIX =
    50     BATPREFIX =
    47     RMFILE = rm $(call PATHFIX, $(1))
    51     RMFILE = rm $(call PATHFIX, $(1))
   119 
   123 
   120 else
   124 else
   121   export PLATFORM = linux
   125   export PLATFORM = linux
   122   QMAKE = qmake
   126   QMAKE = qmake
   123   ANT := ant
   127   ANT := ant
       
   128   HASH_CHAR=\\\#
   124 
   129 
   125   ifndef JAVA_BIN_ROOT
   130   ifndef JAVA_BIN_ROOT
   126   export JAVA_BIN_ROOT=$(JAVA_SRC_ROOT)/bin
   131   export JAVA_BIN_ROOT=$(JAVA_SRC_ROOT)/bin
   127   endif
   132   endif
   128 
   133 
   183   override CFG := urel
   188   override CFG := urel
   184 endif
   189 endif
   185 
   190 
   186 export VARIANT
   191 export VARIANT
   187 
   192 
       
   193 # Specify RVCT version explicitly by default
       
   194 OVERRIDE_RVCT = 1
       
   195 SBSCONFIG = $(PLATFORM)_$(CFG)
       
   196 ifeq ($(OVERRIDE_RVCT),1)
       
   197   ifeq ($(PLATFORM),armv5)
       
   198     ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS
       
   199       SBSCONFIG = $(PLATFORM)_$(CFG).rvct4_0
       
   200       RVCTBIN = $(RVCT40BIN)
       
   201     else 
       
   202       SBSCONFIG = $(PLATFORM)_$(CFG).rvct2_2
       
   203       RVCTBIN = $(RVCT22BIN)
       
   204     endif
       
   205     export PATH:=$(RVCTBIN);$(subst $(RVCT40BIN),,$(subst $(RVCT22BIN),,$(PATH)))
       
   206   endif
       
   207 endif
       
   208 
   188 ANT_PROJECT_DEFINES = $(foreach d,$(PROJECT_DEFINES),-D$d=1)
   209 ANT_PROJECT_DEFINES = $(foreach d,$(PROJECT_DEFINES),-D$d=1)
   189 
   210 
   190 COMPONENT_NAME ?= $(notdir $(CURDIR))
   211 COMPONENT_NAME ?= $(notdir $(CURDIR))
   191 
   212 
   192 # Following targets should be defined by every level
   213 # Following targets should be defined by every level
   215 FORCE:
   236 FORCE:
   216 
   237 
   217 # Common ----------------------------------
   238 # Common ----------------------------------
   218 
   239 
   219 # Export files need a build_defines file
   240 # Export files need a build_defines file
   220 BUILDDEFINEFILE := $(JAVA_SRC_ROOT)/inc/build_defines.hrh
   241 BUILDDEFINEFILE := $(GEN_BUILD_FILES_DIR)/inc/build_defines.hrh
   221 QBUILDDEFINEFILE := $(JAVA_SRC_ROOT)/inc/build_defines.pri
   242 QBUILDDEFINEFILE := $(GEN_BUILD_FILES_DIR)/inc/build_defines.pri
   222 JAVAVERSIONFILE := $(JAVA_SRC_ROOT)/inc/java.txt
       
   223 
   243 
   224 # Project define file is needed by export and native phases of nonqt components
   244 # Project define file is needed by export and native phases of nonqt components
   225 # Native builds require project_defines.hrh for nonqt-mmp-files
   245 # Native builds require project_defines.hrh for nonqt-mmp-files
   226 PROJECTDEFINEFILE = $(JAVA_SRC_ROOT)/inc/project_defines.hrh
   246 PROJECTDEFINEFILE = $(GEN_BUILD_FILES_DIR)/inc/project_defines.hrh
       
   247 
       
   248 # Java version file
       
   249 JAVAVERSIONFILE := $(GEN_BUILD_FILES_DIR)/inc/java.txt
       
   250 
   227 
   251 
   228 ifndef FIRSTTIME_FLAG
   252 ifndef FIRSTTIME_FLAG
   229 export FIRSTTIME_FLAG = 1
   253 export FIRSTTIME_FLAG = 1
   230 FIRSTTIME = 1
   254 FIRSTTIME = 1
   231 endif
   255 endif
   235 
   259 
   236 # Echo the S60 release before export
   260 # Echo the S60 release before export
   237 ifeq ($(BUILDENV),symbian)
   261 ifeq ($(BUILDENV),symbian)
   238 all init export configure qmake java native releasebuild test: echo_s60_release
   262 all init export configure qmake java native releasebuild test: echo_s60_release
   239 echo_s60_release:
   263 echo_s60_release:
   240 	@echo Building on top of S60 $(RD_JAVA_S60_RELEASE)
   264 	@echo Building on top of S60 $(RD_JAVA_S60_RELEASE), PLATFORM=$(PLATFORM) VARIANT=$(VARIANT)
   241 endif
   265 endif
   242 
   266 
   243 include $(JAVA_SRC_ROOT)/build/makefile.javaversion
   267 include $(JAVA_SRC_ROOT)/build/makefile.javaversion
   244 
   268 
   245 COMMA = ,
   269 COMMA = ,
   246 JAVA_VERSION_ = $(subst .,$(COMMA),$(JAVA_VERSION))
   270 JAVA_VERSION_ = $(subst .,$(COMMA),$(JAVA_VERSION))
   247 
   271 
   248 configure: generateconffiles generatereleasefile
   272 configure: create_inc_dir generateconffiles generatereleasefile
       
   273 
       
   274 create_inc_dir:
       
   275 	$(call MKDIR, $(call PATHFIX,$(GEN_BUILD_FILES_DIR)/inc))
       
   276 
   249 generateconffiles:
   277 generateconffiles:
   250 	@echo Writing $(BUILDDEFINEFILE) ... \
   278 	@echo Writing $(BUILDDEFINEFILE) ... \
   251 	$(shell $(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/generated_header.txt) > $(BUILDDEFINEFILE)) \
   279 	$(shell $(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/generated_header.txt) > $(BUILDDEFINEFILE)) \
   252 	$(shell echo #define RD_JAVA_VERSION $(JAVA_VERSION_)>> $(BUILDDEFINEFILE)) \
   280 	$(shell echo $(HASH_CHAR)define RD_JAVA_VERSION $(JAVA_VERSION_)>> $(BUILDDEFINEFILE)) \
   253 	$(shell echo #define RD_JAVA_BIN_VERSION_NONQT $(shell python $(JAVA_SRC_ROOT)/build/buildutils/ver2binver.py mmp $(JAVA_VERSION))>> $(BUILDDEFINEFILE)) \
   281 	$(shell echo $(HASH_CHAR)define RD_JAVA_BIN_VERSION_NONQT $(shell python $(JAVA_SRC_ROOT)/build/buildutils/ver2binver.py mmp $(JAVA_VERSION))>> $(BUILDDEFINEFILE)) \
   254 	$(foreach d, $(PROJECT_DEFINES), $(shell echo #define $d >> $(BUILDDEFINEFILE)))
   282 	$(foreach d, $(PROJECT_DEFINES), $(shell echo $(HASH_CHAR)define $d>> $(BUILDDEFINEFILE)))
   255 	@echo Writing $(QBUILDDEFINEFILE) ... \
   283 	@echo Writing $(QBUILDDEFINEFILE) ... \
   256 	$(shell $(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/generated_header_hash.txt) > $(QBUILDDEFINEFILE)) \
   284 	$(shell $(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/generated_header_hash.txt) > $(QBUILDDEFINEFILE)) \
   257 	$(shell echo RD_JAVA_BIN_VERSION = $(shell python $(JAVA_SRC_ROOT)/build/buildutils/ver2binver.py qmake $(JAVA_VERSION))>> $(QBUILDDEFINEFILE)) \
   285 	$(shell echo RD_JAVA_BIN_VERSION = $(shell python $(JAVA_SRC_ROOT)/build/buildutils/ver2binver.py qmake $(JAVA_VERSION))>> $(QBUILDDEFINEFILE)) \
   258 	$(shell echo PROJECT_DEFINES *= $(PROJECT_DEFINES) >> $(QBUILDDEFINEFILE))
   286 	$(shell echo PROJECT_DEFINES *= $(PROJECT_DEFINES) >> $(QBUILDDEFINEFILE))
   259 	@echo Writing $(JAVAVERSIONFILE) \
   287 	@echo Writing $(JAVAVERSIONFILE) \