13 # |
13 # |
14 # Description: Header file exporting Function Like Makefile (FLM) |
14 # Description: Header file exporting Function Like Makefile (FLM) |
15 # The file destinations are relative to EPOCROOT |
15 # The file destinations are relative to EPOCROOT |
16 # |
16 # |
17 |
17 |
18 # Find Java build dir by going up from $(TO_BLDINF). |
18 # Find Java build dir of component $(NAME) from $(TO_BLDINF). |
19 # (TO_BLDINF refers to the directory having initial bld.inf, i.e. |
19 # (TO_BLDINF refers to the directory having initial bld.inf, i.e. |
20 # - jrt/group (9.2 S60) |
20 # - combined build root, which contains directory $(NAME) |
21 # - jrt/group/sf (9.2 SF) |
21 # - $(NAME)/group (9.2 S60) |
22 # - jrt (10.1 SF/S60) |
22 # - $(NAME)/group/sf (9.2 SF) |
23 # therefore the jrt-directory is found from finding first directory having |
23 # - $(NAME) (10.1 SF/S60) |
24 # subsystem.mk, going up to max. three directory levels) |
24 # therefore the $(NAME)-directory is found from finding first directory having |
|
25 # subsystem.mk, going first down to $(NAME) and then up to max. three directory levels) |
25 |
26 |
26 JAVABUILDDIR:= $(dir $(firstword $(wildcard $(TO_BLDINF)/subsystem.mk $(TO_BLDINF)/../subsystem.mk $(TO_BLDINF)/../../subsystem.mk))) |
27 JAVABUILDDIR:= $(dir $(firstword $(wildcard $(TO_BLDINF)/$(NAME)/subsystem.mk $(TO_BLDINF)/subsystem.mk $(TO_BLDINF)/../subsystem.mk $(TO_BLDINF)/../../subsystem.mk))) |
27 |
28 |
28 # General Java makefile command |
29 # General Java makefile command |
29 JAVACMD:= make -C $(JAVABUILDDIR) -f subsystem.mk EPOCROOT=$(EPOCROOT)/ \ |
30 JAVACMD:= make -C $(JAVABUILDDIR) -f subsystem.mk EPOCROOT=$(EPOCROOT)/ \ |
30 PLATFORM=$(PLATFORM) CFG=$(CFG) BLD_INF_JAVA=1 |
31 PLATFORM=$(PLATFORM) CFG=$(CFG) BLD_INF_JAVA=1 |
31 |
32 |
33 JAVABUILDCMD:= make -C $(JAVABUILDDIR) -f subsystem.mk EPOCROOT=$(EPOCROOT)/ \ |
34 JAVABUILDCMD:= make -C $(JAVABUILDDIR) -f subsystem.mk EPOCROOT=$(EPOCROOT)/ \ |
34 PLATFORM=armv5 CFG=urel BLD_INF_JAVA=1 java finalactions |
35 PLATFORM=armv5 CFG=urel BLD_INF_JAVA=1 java finalactions |
35 |
36 |
36 # Marker file to prevent multiple Java compilations of the |
37 # Marker file to prevent multiple Java compilations of the |
37 # same platform/cfg, when building e.g. device variants. |
38 # same platform/cfg, when building e.g. device variants. |
38 NATIVEJAVAMARKER := $(EPOCBLD)/nativejavamarker_$(PLATFORM)_$(CFG).done |
39 NATIVEJAVAMARKER := $(EPOCBLD)/nativejavamarker_$(NAME)_$(PLATFORM)_$(CFG).done |
39 |
40 |
40 # Java build artifact file source and target |
41 # Java build artifact file source and target |
41 JAVABUILD_ARTIFACT_SRC := $(EPOCROOT)/epoc32/release/armv5/urel |
42 JAVABUILD_ARTIFACT_SRC := $(EPOCROOT)/epoc32/release/armv5/urel |
42 JAVABUILD_ARTIFACT_DST := $(EPOCROOT)/epoc32/release/$(PLATFORM)/$(CFG) |
43 JAVABUILD_ARTIFACT_DST := $(EPOCROOT)/epoc32/release/$(PLATFORM)/$(CFG) |
43 |
44 |
44 define compilenativejava |
45 define compilenativejava |
45 |
46 |
46 # This is the general Java compilation, done once for the component |
47 # This is the general Java compilation, done once for the component |
47 ifeq ($(GUARD_nativejavatarget),) |
48 ifeq ($(GUARD_nativejavatarget_$(NAME)),) |
48 GUARD_nativejavatarget:=1 |
49 GUARD_nativejavatarget_$(NAME):=1 |
49 .PHONY:: nativejavatarget |
50 .PHONY:: nativejavatarget_$(NAME) |
50 nativejavatarget: |
51 nativejavatarget_$(NAME): |
51 $(call startrule,compilenativejava,,javasources) \ |
52 $(call startrule,compilenativejava,,javasources) \ |
52 $(JAVABUILDCMD) \ |
53 $(JAVABUILDCMD) \ |
53 $(call endrule,compilenativejava) |
54 $(call endrule,compilenativejava) |
|
55 |
|
56 # If component depends on some other Java compilation, do the dependant |
|
57 # first (if on same build sequence) |
|
58 ifneq ($(DEPENDS),) |
|
59 .PHONY:: nativejavatarget_$(DEPENDS) |
|
60 nativejavatarget_$(NAME): nativejavatarget_$(DEPENDS) |
|
61 nativejavatarget_$(DEPENDS): ignored_dependency |
|
62 endif |
54 endif |
63 endif |
|
64 |
|
65 # Phony ignored dependency, just so that we have something to use when needed |
|
66 ifeq ($(GUARD_ignored_dependency),) |
|
67 GUARD_ignored_dependency:=1 |
|
68 .PHONY:: ignored_dependency |
|
69 ignored_dependency: |
|
70 endif |
55 |
71 |
56 # Actual resource target, one for each platform/cfg variant |
72 # Actual resource target, one for each platform/cfg variant |
57 ifeq ($(GUARD_$(call sanitise,$(NATIVEJAVAMARKER))),) |
73 ifeq ($(GUARD_$(call sanitise,$(NATIVEJAVAMARKER))),) |
58 GUARD_$(call sanitise,$(NATIVEJAVAMARKER)):=1 |
74 GUARD_$(call sanitise,$(NATIVEJAVAMARKER)):=1 |
59 |
75 |
60 RESOURCE:: $(NATIVEJAVAMARKER) |
76 RESOURCE:: $(NATIVEJAVAMARKER) |
61 |
77 |
62 # Copy the build artifacts to target |
78 # Copy the build artifacts to target |
63 $(NATIVEJAVAMARKER): nativejavatarget |
79 $(NATIVEJAVAMARKER): nativejavatarget_$(NAME) |
64 ifeq ($(filter armv5_urel ARMV5_urel ARMV5_UREL,$(PLATFORM)_$(CFG)),) |
80 ifeq ($(filter armv5_urel ARMV5_urel ARMV5_UREL,$(PLATFORM)_$(CFG)),) |
65 $(call makepath,$(JAVABUILD_ARTIFACT_DST)/z/resource/java/jvm/lib/jrt) |
81 $(call makepath,$(JAVABUILD_ARTIFACT_DST)/z/resource/java/jvm/lib/jrt) |
66 $(call makepath,$(JAVABUILD_ARTIFACT_DST)/z/resource/java/security) |
82 $(call makepath,$(JAVABUILD_ARTIFACT_DST)/z/resource/java/security) |
67 $(call startrule,copynativejavaresults) \ |
83 $(call startrule,copynativejavaresults) \ |
68 $(foreach f,java_impl_cdc.jar java_impl_cldc.jar java_platform_api.jar java_public_api.jar java_signature_test.jar, $(GNUCP) -v $(JAVABUILD_ARTIFACT_SRC)/$f $(JAVABUILD_ARTIFACT_DST) &&) \ |
84 $(foreach f,java_impl_cdc.jar java_impl_cldc.jar java_platform_api.jar java_public_api.jar java_signature_test.jar, $(GNUCP) -v $(JAVABUILD_ARTIFACT_SRC)/$f $(JAVABUILD_ARTIFACT_DST) &&) \ |