2004-07-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / class / System / Makefile
index 420dc4ff78b405e88b6e641a3d897f04a5307434..622b72ad380cda4642f8d34a7dbe830656e86825 100644 (file)
@@ -8,40 +8,30 @@ LIBRARY = System.dll
 # 1st pass - build System.dll without System.Xml.dll reference
 # 2nd pass - build System.dll with System.Xml.dll reference
 
-LIB_MCS_FLAGS = /r:$(corlib) $(EXTRA_FLAGS)
+LIB_MCS_FLAGS = /r:$(corlib)
 TEST_MCS_FLAGS = /nowarn:1595 /nowarn:0618
 
-CYCLIC_DEP = System.Xml.dll
+CYCLIC_DEP := System.Xml.dll
+CYCLIC_DEP_FILE := $(wildcard ../lib/$(PROFILE)/$(CYCLIC_DEP))
 
 EXTRA_DISTFILES = \
        System.Text.RegularExpressions/notes.txt        \
        System.ComponentModel.Design/Changelog          \
        Test/test-config-file
 
-ifdef SECOND_PASS
-       include ../../build/library.make
+ifdef USE_BOOT_COMPILE
+LIBRARY_COMPILE = $(BOOT_COMPILE)
+endif
+
+include ../../build/library.make
+
+ifdef CYCLIC_DEP_FILE
+LIB_MCS_FLAGS += /define:XML_DEP /r:$(CYCLIC_DEP)
+$(the_lib): $(CYCLIC_DEP_FILE)
 else
-all-local:
-       @if test ! -f ../lib/$(CYCLIC_DEP) ; then \
-           echo "Creating temporary $(LIBRARY) without $(CYCLIC_DEP) reference." ; \
-           $(MAKE) SECOND_PASS=yes || exit 1 ; \
-           rm -f '$(depsdir)/$(LIBRARY).stamp'; \
-       else \
-           $(MAKE) SECOND_PASS=yes EXTRA_FLAGS='/define:XML_DEP /r:$(CYCLIC_DEP)' || exit 1; \
-       fi
-
-## TODO: how to do this without duplication
-
-install-local:
-           @$(MAKE) SECOND_PASS=yes EXTRA_FLAGS='/r:$(CYCLIC_DEP)' install-local || exit 1; \
-           
-test-local: all-local
-           @$(MAKE) SECOND_PASS=yes EXTRA_FLAGS='/r:$(CYCLIC_DEP)' test-local || exit 1; \
-           
-run-test-local:
-           @$(MAKE) SECOND_PASS=yes EXTRA_FLAGS='/r:$(CYCLIC_DEP)' run-test-local || exit 1; \
-           
-clean-local:
-           @$(MAKE) SECOND_PASS=yes EXTRA_FLAGS='/r:$(CYCLIC_DEP)' clean-local || exit 1; \
-           
+# First pass: Build temporary System.dll without depending on System.Xml.dll
+$(the_lib): echo-warning
+.PHONY: echo-warning
+echo-warning:
+       @echo "** Building temporary System.dll without parts that depend on System.Xml"
 endif