37 SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar |
37 SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar |
38 |
38 |
39 # TODO: if it's a modules image, check if SA module is installed. |
39 # TODO: if it's a modules image, check if SA module is installed. |
40 MODULELIB_PATH= $(BOOT_JAVA_HOME)/lib/modules |
40 MODULELIB_PATH= $(BOOT_JAVA_HOME)/lib/modules |
41 |
41 |
42 # gnumake 3.78.1 does not accept the *s that |
42 AGENT_FILES_LIST := $(GENERATED)/agent.classes.list |
43 # are in AGENT_FILES1 and AGENT_FILES2, so use the shell to expand them |
|
44 AGENT_FILES1 := $(shell /usr/bin/test -d $(AGENT_DIR) && /bin/ls $(AGENT_FILES1)) |
|
45 AGENT_FILES2 := $(shell /usr/bin/test -d $(AGENT_DIR) && /bin/ls $(AGENT_FILES2)) |
|
46 |
|
47 AGENT_FILES1_LIST := $(GENERATED)/agent1.classes.list |
|
48 AGENT_FILES2_LIST := $(GENERATED)/agent2.classes.list |
|
49 |
43 |
50 SA_CLASSDIR = $(GENERATED)/saclasses |
44 SA_CLASSDIR = $(GENERATED)/saclasses |
51 |
45 |
52 SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)" |
46 SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)" |
53 |
47 |
57 all: |
51 all: |
58 $(QUIETLY) if [ -d $(AGENT_DIR) ] ; then \ |
52 $(QUIETLY) if [ -d $(AGENT_DIR) ] ; then \ |
59 $(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \ |
53 $(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \ |
60 fi |
54 fi |
61 |
55 |
62 $(GENERATED)/sa-jdi.jar: $(AGENT_FILES1) $(AGENT_FILES2) |
56 $(GENERATED)/sa-jdi.jar: $(AGENT_FILES) |
63 $(QUIETLY) echo "Making $@"; |
57 $(QUIETLY) echo "Making $@"; |
64 $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \ |
58 $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \ |
65 echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \ |
59 echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \ |
66 exit 1; \ |
60 exit 1; \ |
67 fi |
61 fi |
71 exit 1; \ |
65 exit 1; \ |
72 fi |
66 fi |
73 $(QUIETLY) if [ ! -d $(SA_CLASSDIR) ] ; then \ |
67 $(QUIETLY) if [ ! -d $(SA_CLASSDIR) ] ; then \ |
74 mkdir -p $(SA_CLASSDIR); \ |
68 mkdir -p $(SA_CLASSDIR); \ |
75 fi |
69 fi |
76 |
|
77 # Note: When indented, make tries to execute the '$(shell' comment. |
70 # Note: When indented, make tries to execute the '$(shell' comment. |
78 # In some environments, cmd processors have limited line length. |
71 # In some environments, cmd processors have limited line length. |
79 # To prevent the javac invocation in the next block from using |
72 # To prevent the javac invocation in the next block from using |
80 # a very long cmd line, we use javac's @file-list option. We |
73 # a very long cmd line, we use javac's @file-list option. We |
81 # generate the file lists using make's built-in 'foreach' control |
74 # generate the file lists using make's built-in 'foreach' control |
82 # flow which also avoids cmd processor line length issues. Since |
75 # flow which also avoids cmd processor line length issues. Since |
83 # the 'foreach' is done as part of make's macro expansion phase, |
76 # the 'foreach' is done as part of make's macro expansion phase, |
84 # the initialization of the lists is also done in the same phase |
77 # the initialization of the lists is also done in the same phase |
85 # using '$(shell rm ...' instead of using the more traditional |
78 # using '$(shell rm ...' instead of using the more traditional |
86 # 'rm ...' rule. |
79 # 'rm ...' rule. |
87 $(shell rm -rf $(AGENT_FILES1_LIST) $(AGENT_FILES2_LIST)) |
80 $(shell rm -rf $(AGENT_FILES_LIST)) |
88 $(foreach file,$(AGENT_FILES1),$(shell echo $(file) >> $(AGENT_FILES1_LIST))) |
81 # gnumake 3.78.1 does not accept the *'s that |
89 $(foreach file,$(AGENT_FILES2),$(shell echo $(file) >> $(AGENT_FILES2_LIST))) |
82 # are in AGENT_FILES, so use the shell to expand them. |
90 |
83 # Be extra carefull to not produce too long command lines in the shell! |
91 $(QUIETLY) $(COMPILE.JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES1_LIST) |
84 $(foreach file,$(AGENT_FILES),$(shell ls -1 $(file) >> $(AGENT_FILES_LIST))) |
92 $(QUIETLY) $(COMPILE.JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES2_LIST) |
85 $(QUIETLY) $(COMPILE.JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES_LIST) |
93 |
|
94 $(QUIETLY) $(COMPILE.RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer |
86 $(QUIETLY) $(COMPILE.RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer |
95 $(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES) |
87 $(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES) |
96 $(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql/sa.js |
88 $(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql/sa.js |
97 $(QUIETLY) cp $(AGENT_SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql |
89 $(QUIETLY) cp $(AGENT_SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql |
98 $(QUIETLY) mkdir -p $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources |
90 $(QUIETLY) mkdir -p $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources |