21 # - jrt/group/sf (9.2 SF) |
21 # - jrt/group/sf (9.2 SF) |
22 # - jrt (10.1 SF/S60) |
22 # - jrt (10.1 SF/S60) |
23 # therefore the jrt-directory is found from finding first directory having |
23 # therefore the jrt-directory is found from finding first directory having |
24 # subsystem.mk, going up to max. three directory levels) |
24 # subsystem.mk, going up to max. three directory levels) |
25 |
25 |
26 JAVABUILDDIR = $(dir $(firstword $(wildcard $(TO_BLDINF)/subsystem.mk $(TO_BLDINF)/../subsystem.mk $(TO_BLDINF)/../../subsystem.mk))) |
26 JAVABUILDDIR:= $(dir $(firstword $(wildcard $(TO_BLDINF)/subsystem.mk $(TO_BLDINF)/../subsystem.mk $(TO_BLDINF)/../../subsystem.mk))) |
27 |
27 |
28 JAVABUILDCMD = make -C $(JAVABUILDDIR) -f subsystem.mk EPOCROOT=$(EPOCROOT)/ \ |
28 # General Java makefile command |
|
29 JAVACMD:= make -C $(JAVABUILDDIR) -f subsystem.mk EPOCROOT=$(EPOCROOT)/ \ |
29 PLATFORM=$(PLATFORM) CFG=$(CFG) BLD_INF_JAVA=1 |
30 PLATFORM=$(PLATFORM) CFG=$(CFG) BLD_INF_JAVA=1 |
30 |
31 |
31 define java_build |
32 # General build command, targetting armv5 urel files |
32 RESOURCE:: |
33 JAVABUILDCMD:= make -C $(JAVABUILDDIR) -f subsystem.mk EPOCROOT=$(EPOCROOT)/ \ |
|
34 PLATFORM=armv5 CFG=urel BLD_INF_JAVA=1 java finalactions |
|
35 |
|
36 # Marker file to prevent multiple Java compilations of the |
|
37 # same platform/cfg, when building e.g. device variants. |
|
38 NATIVEJAVAMARKER := $(EPOCBLD)/nativejavamarker_$(PLATFORM)_$(CFG).done |
|
39 |
|
40 # Java build artifact file source and target |
|
41 JAVABUILD_ARTIFACT_SRC := $(EPOCROOT)/epoc32/release/armv5/urel |
|
42 JAVABUILD_ARTIFACT_DST := $(EPOCROOT)/epoc32/release/$(PLATFORM)/$(CFG) |
|
43 |
|
44 define compilenativejava |
|
45 |
|
46 # This is the general Java compilation, done once for the component |
|
47 ifeq ($(GUARD_nativejavatarget),) |
|
48 GUARD_nativejavatarget:=1 |
|
49 .PHONY:: nativejavatarget |
|
50 nativejavatarget: |
33 $(call startrule,compilenativejava,,javasources) \ |
51 $(call startrule,compilenativejava,,javasources) \ |
34 $(JAVABUILDCMD) java finalactions\ |
52 $(JAVABUILDCMD) \ |
35 $(call endrule,compilenativejava) |
53 $(call endrule,compilenativejava) |
|
54 endif |
|
55 |
|
56 # Actual resource target, one for each platform/cfg variant |
|
57 ifeq ($(GUARD_$(call sanitise,$(NATIVEJAVAMARKER))),) |
|
58 GUARD_$(call sanitise,$(NATIVEJAVAMARKER)):=1 |
|
59 |
|
60 RESOURCE:: $(NATIVEJAVAMARKER) |
|
61 |
|
62 # Copy the build artifacts to target |
|
63 $(NATIVEJAVAMARKER): nativejavatarget |
|
64 ifeq ($(filter armv5_urel ARMV5_urel ARMV5_UREL,$(PLATFORM)_$(CFG)),) |
|
65 $(call makepath,$(JAVABUILD_ARTIFACT_DST)/z/resource/java/jvm/lib/jrt) |
|
66 $(call makepath,$(JAVABUILD_ARTIFACT_DST)/z/resource/java/security) |
|
67 $(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) &&) \ |
|
69 $(GNUCP) -Rv $(JAVABUILD_ARTIFACT_SRC)/z/resource/java/jvm/lib/jrt $(JAVABUILD_ARTIFACT_DST)/z/resource/java/jvm/lib && \ |
|
70 $(GNUCP) -Rv $(JAVABUILD_ARTIFACT_SRC)/z/resource/java/security $(JAVABUILD_ARTIFACT_DST)/z/resource/java \ |
|
71 $(call endrule,copynativejavaresults) |
|
72 endif |
|
73 endif |
|
74 |
|
75 # Use normal clean for all variants |
36 CLEAN:: |
76 CLEAN:: |
37 $(call startrule,cleannativejava,,javasources) \ |
77 $(call startrule,cleannativejava,,javasources) \ |
38 $(JAVABUILDCMD) clean_java \ |
78 $(JAVACMD) clean_java \ |
39 $(call endrule,cleannativejava) |
79 $(call endrule,cleannativejava) |
40 endef |
80 endef |
41 |
81 |
42 $(eval $(java_build)) |
82 $(eval $(compilenativejava)) |
43 |
83 |
44 RELEASABLES = $(shell $(JAVABUILDCMD) -s javareleasables) |
84 RELEASABLES:= $(shell $(JAVACMD) -s javareleasables) |
45 $(eval $(call whatmacro,$(RELEASABLES),WHATRESOURCES)) |
85 $(eval $(call whatmacro,$(RELEASABLES),WHATRESOURCES)) |
|
86 |
|
87 $(eval $(call GenerateStandardCleanTarget,$(NATIVEJAVAMARKER))) |
|
88 |
|
89 |