make/solaris/makefiles/sa.make

Print this page

        

@@ -57,11 +57,11 @@
 all: 
         $(QUIETLY) if [ -d $(AGENT_DIR) ] ; then \
            $(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \
         fi
 
-$(GENERATED)/sa-jdi.jar: $(AGENT_FILES1) $(AGENT_FILES2) agent_files_preclean
+$(GENERATED)/sa-jdi.jar: $(AGENT_FILES1) $(AGENT_FILES2)
         $(QUIETLY) echo "Making $@";
         $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
            echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
            exit 1; \
         fi

@@ -72,10 +72,20 @@
         fi
         $(QUIETLY) if [ ! -d $(SA_CLASSDIR) ] ; then \
           mkdir -p $(SA_CLASSDIR);        \
         fi
         
+        # In some environments, cmd processors have limited line length.
+        # To prevent the javac invocation in the next block from using
+        # a very long cmd line, we use javac's @file-list option. We
+        # generate the file lists using make's built-in 'foreach' control
+        # flow which also avoids cmd processor line length issues. Since
+        # the 'foreach' is done as part of make's macro expansion phase,
+        # the initialization of the lists is also done in the same phase
+        # using '$(shell rm ...' instead of using the more traditional
+        # 'rm ...' rule.
+        $(shell rm -rf $(AGENT_FILES1_LIST) $(AGENT_FILES2_LIST))
         $(foreach file,$(AGENT_FILES1),$(shell echo $(file) >> $(AGENT_FILES1_LIST)))
         $(foreach file,$(AGENT_FILES2),$(shell echo $(file) >> $(AGENT_FILES2_LIST)))
         
         $(QUIETLY) $(COMPILE.JAVAC) -source 1.4 -target 1.4 -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES1_LIST)
         $(QUIETLY) $(COMPILE.JAVAC) -source 1.4 -target 1.4 -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES2_LIST)

@@ -90,12 +100,9 @@
         $(QUIETLY) cp -r $(AGENT_SRC_DIR)/images/* $(SA_CLASSDIR)/
         $(QUIETLY) $(RUN.JAR) cf $@ -C $(SA_CLASSDIR)/ .
         $(QUIETLY) $(RUN.JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector
         $(QUIETLY) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.proc.ProcDebuggerLocal
 
-agent_files_preclean:
-        rm -rf $(AGENT_FILES1_LIST) $(AGENT_FILES2_LIST)
-
 clean:
         rm -rf $(SA_CLASSDIR)
         rm -rf $(GENERATED)/sa-jdi.jar
         rm -rf $(AGENT_FILES1_LIST) $(AGENT_FILES2_LIST)