build/Makefile.subsystem
branchRCL_3
changeset 14 04becd199f91
child 18 9ac0a0a7da70
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     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 "Eclipse Public License v1.0"
       
     6 # which accompanies this distribution, and is available
       
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 #
       
     9 # Initial Contributors:
       
    10 # Nokia Corporation - initial contribution.
       
    11 #
       
    12 # Contributors:
       
    13 #
       
    14 # Description: 
       
    15 #
       
    16 
       
    17 ifndef JAVA_SRC_ROOT
       
    18 $(error JAVA_SRC_ROOT variable not defined!)
       
    19 endif
       
    20 
       
    21 # ------------------------------------------------
       
    22 
       
    23 
       
    24 ifndef SUBTARGETS
       
    25 # If order is not explicitly defined, use the following
       
    26 SUBTARGETS = $(COMPONENTS) $(SUBSYSTEMS) $(NONQTSUBSYSTEMS)
       
    27 endif
       
    28 
       
    29 .PHONY: subtargets $(SUBTARGETS)
       
    30 
       
    31 # Check for overlaps
       
    32 OVERLAPS = \
       
    33  $(filter $(SUBSYSTEMS) $(NONQTSUBSYSTEMS), $(COMPONENTS)) \
       
    34  $(filter $(COMPONENTS) $(NONQTSUBSYSTEMS), $(SUBSYSTEMS)) \
       
    35  $(filter $(COMPONENTS) $(SUBSYSTEMS), $(NONQTSUBSYSTEMS))
       
    36 ifneq ($(strip $(OVERLAPS)),)
       
    37 $(error Overlap(s) in COMPONENTS/SUBSYSTEMS/NONQTSUBSYSTEMS definition)
       
    38 endif
       
    39 
       
    40 ifdef ALLTARGETS
       
    41 REALTARGETS := $(SUBTARGETS)
       
    42 endif
       
    43 
       
    44 ifndef REALTARGETS
       
    45 # This is the real target list. Allow skipping of targets
       
    46 REALTARGETS := $(filter-out $(SKIPTARGETS),$(SUBTARGETS))
       
    47 # Filter targets by platform
       
    48 ifeq ($(BUILDENV),symbian)
       
    49 REALTARGETS := $(filter-out $(LINUX_ONLY), $(REALTARGETS))
       
    50 else
       
    51 REALTARGETS := $(filter-out $(SYMBIAN_ONLY), $(REALTARGETS))
       
    52 endif
       
    53 endif
       
    54 
       
    55 subtargets: $(REALTARGETS)
       
    56 
       
    57 
       
    58 $(SUBSYSTEMS): 
       
    59 	$(MAKE) TARGET_SUB=$@ -C $@ -f subsystem.mk $(TARGET_PHASE)
       
    60 
       
    61 $(COMPONENTS): 
       
    62 	$(MAKE) TARGET_SUB=$@ -C $@ -f ${JAVA_SRC_ROOT}/build/Makefile.comp $(TARGET_PHASE)
       
    63 
       
    64 $(NONQTSUBSYSTEMS): 
       
    65 	$(MAKE) TARGET_SUB=$@ -C $@ -f ${JAVA_SRC_ROOT}/build/Makefile.nonqt $(TARGET_PHASE)
       
    66 
       
    67 test:
       
    68 	$(PHASEINFO)
       
    69 	$(MAKE) -f subsystem.mk TARGET_PHASE=$@ subtargets
       
    70 	$(EXEC_SUB)
       
    71 
       
    72 finalactions:
       
    73 
       
    74 configure: configure_qmake
       
    75 
       
    76 configure_qmake: 
       
    77 	$(PHASEINFO)
       
    78 	$(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/generated_header_hash.txt) > $(COMPONENT_NAME).pro && \
       
    79 	echo TEMPLATE = subdirs>> $(COMPONENT_NAME).pro
       
    80 	$(MAKE) -f subsystem.mk TARGET_PHASE=configure_qmake TARGET_PRO=$(CURDIR)/$(COMPONENT_NAME).pro subtargets
       
    81 ifeq ($(BUILDENV),symbian)
       
    82 ifeq ($(notdir $(basename $(SHELL))),sh)
       
    83 	$(foreach d, $(filter $(NONQTSUBSYSTEMS),$(REALTARGETS)),echo 'BLD_INF_RULES.prj_extensions += "$$$${LITERAL_HASH}include \"$(d)/bld.inf\""' >> $(COMPONENT_NAME).pro &&)  \
       
    84 	echo BLD_INF_RULES.prj_extensions += "prj_extensions" >> $(COMPONENT_NAME).pro
       
    85 else
       
    86 	$(foreach d, $(filter $(NONQTSUBSYSTEMS),$(REALTARGETS)),echo BLD_INF_RULES.prj_extensions += "$$$${LITERAL_HASH}include \"$(d)/bld.inf\"" >> $(COMPONENT_NAME).pro &&)  \
       
    87 	echo BLD_INF_RULES.prj_extensions += "prj_extensions" >> $(COMPONENT_NAME).pro
       
    88 endif
       
    89 endif
       
    90 ifdef TARGET_PRO
       
    91 	echo SUBDIRS += $(TARGET_SUB) >> $(TARGET_PRO)
       
    92 endif
       
    93 
       
    94 configure_qmake_recurse:
       
    95 	$(MAKE) -f subsystem.mk TARGET_PHASE=configure_qmake subtargets
       
    96 
       
    97 clean_configure:
       
    98 	$(PHASEINFO)
       
    99 	$(MAKE) -f subsystem.mk TARGET_PHASE=clean_configure subtargets
       
   100 	$(call RMFILES,$(COMPONENT_NAME).pro)
       
   101 
       
   102 
       
   103 # Symbian ----------------------------------
       
   104 ifeq ($(BUILDENV),symbian)
       
   105 
       
   106 ifeq ($(COMPONENT_NAME),jrt)
       
   107 # When building from top level, the native compilation does also export, java and finalactions
       
   108 all: configure qmake native
       
   109 clean: clean_native clean_generated
       
   110 else
       
   111 all: configure qmake export java native finalactions
       
   112 clean: clean_java clean_native clean_generated
       
   113 endif
       
   114 
       
   115 # On top level symbian build, the java building happens always during native
       
   116 # phase, through bld.inf -file, so no direct Java building is done (unless it 
       
   117 # building _is_ made from the bld.inf).
       
   118 ifeq ($(COMPONENT_NAME),jrt)
       
   119 ifndef BLD_INF_JAVA
       
   120 NOJAVA=1
       
   121 endif
       
   122 endif
       
   123 
       
   124 ifdef NOJAVA
       
   125 java clean_java:
       
   126 else
       
   127 java clean_java:
       
   128 	$(MAKE) -f subsystem.mk TARGET_PHASE=$@ subtargets
       
   129 endif
       
   130 
       
   131 javareleasables makestubs:
       
   132 	$(MAKE) -f subsystem.mk TARGET_PHASE=$@ subtargets
       
   133 
       
   134 qmake:
       
   135 	$(QMAKE)
       
   136 ifndef RD_JAVA_UI_QT
       
   137 	$(MAKE) -f subsystem.mk qmakefix
       
   138 endif
       
   139 
       
   140 qmakefix:
       
   141 	$(PHASEINFO)
       
   142 	$(call RMFILES,bld.inf* Makefile*)
       
   143 	$(MAKE) -f subsystem.mk TARGET_PHASE=qmakefix subtargets
       
   144 	$(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/bld.inf) > bld.inf \
       
   145 	$(foreach d, $(REALTARGETS), && echo #include "$d/bld.inf" >> bld.inf )
       
   146 
       
   147 build_all: configure qmake
       
   148 ifdef USESBS
       
   149 	$(SBS) -c winscw_udeb -c armv5_urel -f -
       
   150 else
       
   151 	$(MAKE) -f subsystem.mk PLATFORM=winscw VARIANT=debug NODEP=1 native
       
   152 	$(MAKE) -f subsystem.mk PLATFORM=armv5 VARIANT=release NODEP=1 native
       
   153 endif
       
   154 
       
   155 
       
   156 reallyclean_all:
       
   157 	$(MAKE) -f subsystem.mk PLATFORM=winscw VARIANT=debug reallyclean_native
       
   158 	$(MAKE) -f subsystem.mk PLATFORM=armv5 VARIANT=release reallyclean_native
       
   159 	$(MAKE) -f subsystem.mk clean_java clean_generated
       
   160 
       
   161 clean_generated:
       
   162 	$(PHASEINFO)
       
   163 	$(MAKE) -f subsystem.mk TARGET_PHASE=clean_generated subtargets
       
   164 	$(call RMFILES,bld.inf abld.bat bld.inf* Makefile*)
       
   165 
       
   166 
       
   167 # Target for cleaning, in case bld.inf does not exist
       
   168 bld.inf:
       
   169 	$(MAKE) -f subsystem.mk makestubs qmake
       
   170 
       
   171 
       
   172 # Symbian SBS ------------------------------
       
   173 ifdef USESBS
       
   174 
       
   175 export:
       
   176 	$(PHASEINFO)
       
   177 	$(SBS) -c $(PLATFORM)_$(CFG) EXPORT
       
   178 
       
   179 cleanexport:
       
   180 	$(PHASEINFO)
       
   181 	$(SBS) -c $(PLATFORM)_$(CFG) CLEANEXPORT
       
   182 
       
   183 # BUILD combines commands EXPORT MAKEFILE BITMAP RESOURCE LIBRARY TARGET FINAL
       
   184 native:
       
   185 	$(PHASEINFO)
       
   186 	$(SBS) -c $(PLATFORM)_$(CFG)
       
   187 
       
   188 fastbuild: export java
       
   189 	$(SBS) -c $(PLATFORM)_$(CFG) TARGET
       
   190 
       
   191 clean_native:
       
   192 	$(PHASEINFO)
       
   193 	$(SBS) -c $(PLATFORM)_$(CFG) clean
       
   194 
       
   195 reallyclean: reallyclean_native clean_java clean_generated
       
   196 reallyclean_native: bld.inf
       
   197 	$(PHASEINFO)
       
   198 	$(SBS) -c $(PLATFORM)_$(CFG) reallyclean
       
   199 
       
   200 
       
   201 # Symbian ABLD MAKEFILE --------------------
       
   202 else
       
   203 
       
   204 export:
       
   205 	$(PHASEINFO)
       
   206 	$(BLDMAKE) bldfiles $(PLATFORM)
       
   207 	$(ABLDMAKE) -f $(BUILDDIR)/EXPORT.make EXPORT
       
   208 
       
   209 native:
       
   210 	$(PHASEINFO)
       
   211 	$(BLDMAKE) bldfiles $(PLATFORM)
       
   212 	$(ABLDMAKE) -f $(BUILDDIR)/EXPORT.make EXPORT
       
   213 	$(ABLDMAKE) -f $(BUILDDIR)/$(PLATFORM).make MAKEFILE $(VERBOSE)
       
   214 	$(ABLDMAKE) -f $(BUILDDIR)/$(PLATFORM).make LIBRARY $(VERBOSE)
       
   215 	$(ABLDMAKE) -f $(BUILDDIR)/$(PLATFORM).make RESOURCE CFG=$(CFG) $(VERBOSE)
       
   216 	$(ABLDMAKE) -f $(BUILDDIR)/$(PLATFORM).make TARGET CFG=$(CFG) $(VERBOSE)
       
   217 	$(ABLDMAKE) -f $(BUILDDIR)/$(PLATFORM).make FINAL CFG=$(CFG) $(VERBOSE)
       
   218 
       
   219 fastbuild: export java
       
   220 	$(ABLDMAKE) -f $(BUILDDIR)/$(PLATFORM).make TARGET CFG=$(CFG) $(VERBOSE)
       
   221 
       
   222 cleanexport:
       
   223 	$(PHASEINFO)
       
   224 	$(BLDMAKE) bldfiles $(PLATFORM)
       
   225 	-$(ABLDMAKE) -f $(BUILDDIR)/EXPORT.make CLEANEXPORT
       
   226 
       
   227 clean_native:
       
   228 	-$(ABLDMAKE) -f $(BUILDDIR)/$(PLATFORM).make CLEAN CFG=$(CFG) $(VERBOSE)
       
   229 
       
   230 reallyclean: reallyclean_native clean_java clean_generated
       
   231 reallyclean_native: bld.inf
       
   232 	$(PHASEINFO)
       
   233 	$(BLDMAKE) bldfiles $(PLATFORM)
       
   234 	$(ABLDMAKE) -f $(BUILDDIR)/$(PLATFORM).make MAKEFILE $(VERBOSE) NO_DEPENDENCIES=-nd
       
   235 	-abld reallyclean $(PLATFORM) $(CFG)
       
   236 	-$(BLDMAKE) clean
       
   237 
       
   238 endif
       
   239 
       
   240 
       
   241 # Linux ------------------------------------
       
   242 else
       
   243 
       
   244 all: configure qmake export java native finalactions
       
   245 
       
   246 java export qmake native clean reallyclean clean_generated cleanexport:
       
   247 	$(PHASEINFO)
       
   248 	$(MAKE) -f subsystem.mk TARGET_PHASE=$@ subtargets
       
   249 
       
   250 endif