make/linux/makefiles/sa.make

Print this page

        

@@ -66,11 +66,11 @@
              -a "$(SRCARCH)" != "ppc" \
              -a "$(SRCARCH)" != "zero" ] ; 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

@@ -81,10 +81,14 @@
         fi
         $(QUIETLY) if [ ! -d $(SA_CLASSDIR) ] ; then \
           mkdir -p $(SA_CLASSDIR);        \
         fi
         
+        # The file lists are generated when make does variable expansion
+        # in preparation for executing the rules for this target; javac
+        # uses the file lists in the next block during rule execution.
+        $(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) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -target 1.4 -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES1_LIST)
         $(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -target 1.4 -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES2_LIST)

@@ -102,12 +106,9 @@
         $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.x86.X86ThreadContext
         $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.ia64.IA64ThreadContext
         $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext
         $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.sparc.SPARCThreadContext
 
-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)