[csdoc-patches] csdoc/src/mcs/build config-default.make,NONE,1.1 executable.make,NONE,1.1 library.ma
Status: Planning
Brought to you by:
mastergaurav
From: <mas...@us...> - 2004-10-06 19:31:41
|
Update of /cvsroot/csdoc/csdoc/src/mcs/build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20482 Added Files: config-default.make executable.make library.make rules.make Log Message: no message --- NEW FILE: config-default.make --- # -*- makefile -*- # # This makefile fragment has (default) configuration # settings for building MCS. # DO NOT EDIT THIS FILE! Create config.make and override settings # there. RUNTIME_FLAGS = TEST_HARNESS = $(topdir)/class/lib/$(PROFILE)/nunit-console.exe MCS_FLAGS = $(PLATFORM_DEBUG_FLAGS) MBAS_FLAGS = $(PLATFORM_DEBUG_FLAGS) LIBRARY_FLAGS = /noconfig CFLAGS = -g -O2 INSTALL = /usr/bin/install prefix = /usr/local RUNTIME = mono $(RUNTIME_FLAGS) TEST_RUNTIME = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) --debug # In case you want to add MCS_FLAGS, this lets you not have to # keep track of the default value DEFAULT_MCS_FLAGS := $(MCS_FLAGS) DEFAULT_MBAS_FLAGS := $(MBAS_FLAGS) # You shouldn't need to set these but might on a # weird platform. # CC = cc # SHELL = /bin/sh # MAKE = gmake --- NEW FILE: executable.make --- # -*- makefile -*- # # The rules for building a program. # I'd rather not create a response file here, # but since on Win32 we need to munge the paths # anyway, we might as well. base_prog = $(shell basename $(PROGRAM)) sourcefile = $(base_prog).sources PROGRAM_config := $(wildcard $(PROGRAM).config) ifeq (cat,$(PLATFORM_CHANGE_SEPARATOR_CMD)) response = $(sourcefile) else response = $(depsdir)/$(base_prog).response executable_CLEAN_FILES += $(response) endif makefrag = $(depsdir)/$(base_prog).makefrag pdb = $(patsubst %.exe,%.pdb,$(PROGRAM)) mdb = $(patsubst %.exe,%.mdb,$(PROGRAM)) executable_CLEAN_FILES += $(makefrag) $(pdb) $(mdb) ifndef PROGRAM_INSTALL_DIR PROGRAM_INSTALL_DIR = $(prefix)/bin endif all-local: $(PROGRAM) install-local: $(PROGRAM) $(PROGRAM_config) $(MKINSTALLDIRS) $(DESTDIR)$(PROGRAM_INSTALL_DIR) $(INSTALL_BIN) $(PROGRAM) $(DESTDIR)$(PROGRAM_INSTALL_DIR) -$(INSTALL_BIN) $(PROGRAM).mdb $(DESTDIR)$(PROGRAM_INSTALL_DIR) ifdef PROGRAM_config $(INSTALL_DATA) $(PROGRAM_config) $(DESTDIR)$(PROGRAM_INSTALL_DIR) endif uninstall-local: -rm -f $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$(base_prog) $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$(base_prog).mdb clean-local: -rm -f *.exe $(BUILT_SOURCES) $(executable_CLEAN_FILES) $(CLEAN_FILES) test-local: $(PROGRAM) @: run-test-local: @: run-test-ondotnet-local: @: DISTFILES = $(sourcefile) $(EXTRA_DISTFILES) dist-local: dist-default for f in `cat $(sourcefile)` ; do \ dest=`dirname $(distdir)/$$f` ; \ $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \ done ifndef PROGRAM_COMPILE echo CSCOMPILE = $(CSCOMPILE) PROGRAM_COMPILE = $(CSCOMPILE) endif $(PROGRAM): $(BUILT_SOURCES) $(EXTRA_SOURCES) $(response) $(PROGRAM_COMPILE) /target:exe /out:$@ $(BUILT_SOURCES) $(EXTRA_SOURCES) @$(response) $(makefrag): $(sourcefile) @echo Creating $@ ... @sed 's,^,$(PROGRAM): ,' $< > $@ ifneq ($(response),$(sourcefile)) $(response): $(sourcefile) @echo Creating $@ ... @( $(PLATFORM_CHANGE_SEPARATOR_CMD) ) <$< >$@ endif -include $(makefrag) all-local: $(makefrag) $(makefrag): $(topdir)/build/executable.make --- NEW FILE: library.make --- # -*- makefile -*- # # The rules for building our class libraries. # # The NO_TEST stuff is not too pleasant but whatcha # gonna do. # All the dep files now land in the same directory so we # munge in the library name to keep the files from clashing. sourcefile = $(LIBRARY).sources PLATFORM_excludes := $(wildcard $(LIBRARY).$(PLATFORM)-excludes) ifndef PLATFORM_excludes ifeq (cat,$(PLATFORM_CHANGE_SEPARATOR_CMD)) response = $(sourcefile) endif endif ifndef response response = $(depsdir)/$(PROFILE)_$(LIBRARY).response library_CLEAN_FILES += $(response) $(LIBRARY).mdb endif ifndef LIBRARY_NAME LIBRARY_NAME = $(LIBRARY) endif makefrag = $(depsdir)/$(PROFILE)_$(LIBRARY).makefrag the_lib = $(topdir)/class/lib/$(PROFILE)/$(LIBRARY_NAME) the_lib_signature_stamp = $(makefrag:.makefrag=.was_signed) the_pdb = $(the_lib:.dll=.pdb) the_mdb = $(the_lib).mdb library_CLEAN_FILES += $(makefrag) $(the_lib) $(the_pdb) \ $(the_mdb) $(the_lib_signature_stamp) ifndef NO_TEST test_nunit_lib = nunit.framework.dll nunit.core.dll nunit.util.dll test_nunit_dep = $(test_nunit_lib:%=$(topdir)/class/lib/$(PROFILE)/%) test_nunit_ref = $(test_nunit_dep:%=-r:%) library_CLEAN_FILES += TestResult*.xml ifndef test_against test_against = $(the_lib) test_dep = $(the_lib) endif ifndef test_lib test_lib = $(LIBRARY:.dll=_test_$(PROFILE).dll) test_sourcefile = $(LIBRARY:.dll=_test.dll.sources) else test_sourcefile = $(test_lib).sources endif test_pdb = $(test_lib:.dll=.pdb) test_response = $(depsdir)/$(test_lib).response test_makefrag = $(depsdir)/$(test_lib).makefrag test_flags = /r:$(test_against) $(test_nunit_ref) $(TEST_MCS_FLAGS) library_CLEAN_FILES += $(LIBRARY:.dll=_test*.dll) $(LIBRARY:.dll=_test*.pdb) $(test_response) $(test_makefrag) ifndef btest_lib btest_lib = $(LIBRARY:.dll=_btest_$(PROFILE).dll) btest_sourcefile = $(LIBRARY:.dll=_btest.dll.sources) else btest_sourcefile = $(btest_lib).sources endif btest_pdb = $(btest_lib:.dll=.pdb) btest_response = $(depsdir)/$(btest_lib).response btest_makefrag = $(depsdir)/$(btest_lib).makefrag btest_flags = /r:$(test_against) $(test_nunit_ref) $(TEST_MBAS_FLAGS) library_CLEAN_FILES += $(LIBRARY:.dll=_btest*.dll) $(LIBRARY:.dll=_btest*.pdb) $(btest_response) $(btest_makefrag) ifndef HAVE_CS_TESTS HAVE_CS_TESTS := $(wildcard $(test_sourcefile)) endif ifndef HAVE_VB_TESTS HAVE_VB_TESTS := $(wildcard $(btest_sourcefile)) endif endif gacutil = $(topdir)/tools/gacutil/gacutil.exe sn = $(topdir)/tools/security/sn.exe PACKAGE = 1.0 ifeq ($(PROFILE), net_2_0) PACKAGE = 2.0 endif ifeq ($(PLATFORM), win32) GACDIR = `cygpath -w $(DESTDIR)$(prefix)/lib` else GACDIR = $(DESTDIR)$(prefix)/lib endif all-local install-local test-local: $(the_lib) ifdef LIBRARY_INSTALL_DIR install-local: $(MKINSTALLDIRS) $(DESTDIR)$(LIBRARY_INSTALL_DIR) $(INSTALL_LIB) $(the_lib) $(DESTDIR)$(LIBRARY_INSTALL_DIR)/$(LIBRARY_NAME) -$(INSTALL_LIB) $(the_lib).mdb $(DESTDIR)$(LIBRARY_INSTALL_DIR)/$(LIBRARY_NAME).mdb uninstall-local: -rm -f $(DESTDIR)$(LIBRARY_INSTALL_DIR)/$(LIBRARY_NAME) $(DESTDIR)$(LIBRARY_INSTALL_DIR)/$(LIBRARY_NAME).mdb else install-local: $(gacutil) MONO_PATH="$(topdir)/class/lib/$(PROFILE):$$MONO_PATH" $(RUNTIME) $(gacutil) /i $(the_lib) /f /root $(GACDIR) /package $(PACKAGE) uninstall-local: $(gacutil) MONO_PATH="$(topdir)/class/lib/$(PROFILE):$$MONO_PATH" $(RUNTIME) $(gacutil) /u $(LIBRARY_NAME:.dll=) endif ifndef NO_SIGN_ASSEMBLY all-local install-local: $(the_lib_signature_stamp) ifndef LIBRARY_SNK LIBRARY_SNK = $(topdir)/class/mono.snk endif $(the_lib_signature_stamp): $(the_lib) $(sn) MONO_PATH="$(topdir)/class/lib/$(PROFILE):$$MONO_PATH" $(RUNTIME) $(sn) -q -R $(the_lib) $(LIBRARY_SNK) echo stamp > $@ endif clean-local: -rm -f $(library_CLEAN_FILES) $(CLEAN_FILES) test-local run-test-local run-test-ondotnet-local: @: ifndef NO_TEST $(test_nunit_dep): $(topdir)/build/deps/nunit-$(PROFILE).stamp @if test -f $@; then :; else rm -f $<; $(MAKE) $<; fi $(topdir)/build/deps/nunit-$(PROFILE).stamp: cd ${topdir}/nunit20 && $(MAKE) echo "stamp" >$@ endif test_assemblies := ifdef HAVE_CS_TESTS test_assemblies += $(test_lib) endif ifdef HAVE_VB_TESTS test_assemblies += $(btest_lib) endif ifdef test_assemblies test-local: $(test_assemblies) run-test-local: run-test-lib run-test-ondotnet-local: run-test-ondotnet-lib run-test-lib: test-local $(TEST_RUNTIME) $(TEST_HARNESS) /xml:TestResult-$(PROFILE).xml $(test_assemblies) run-test-ondotnet-lib: test-local $(TEST_HARNESS) /xml:TestResult-ondotnet-$(PROFILE).xml $(test_assemblies) endif DISTFILES = $(sourcefile) $(test_sourcefile) $(EXTRA_DISTFILES) TEST_FILES = ifdef HAVE_CS_TESTS TEST_FILES += `sed 's,^,Test/,' $(test_sourcefile)` endif ifdef HAVE_VB_TESTS TEST_FILES += `sed 's,^,Test/,' $(btest_sourcefile)` endif dist-local: dist-default for f in `cat $(sourcefile)` $(TEST_FILES) ; do \ case $$f in \ ../*) : ;; \ *) dest=`dirname $(distdir)/$$f` ; $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ;; \ esac ; done ifndef LIBRARY_COMPILE LIBRARY_COMPILE = $(CSCOMPILE) endif ifndef TEST_COMPILE TEST_COMPILE = $(CSCOMPILE) endif ifndef BTEST_COMPILE BTEST_COMPILE = $(BASCOMPILE) endif $(gacutil) $(sn): cd $(@D) && $(MAKE) $(@F) # The library $(the_lib): $(response) ifdef LIBRARY_USE_INTERMEDIATE_FILE $(LIBRARY_COMPILE) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) /target:library /out:$(@F) @$(response) mv $(@F) $@ -mv $(@F).mdb $@.mdb else $(LIBRARY_COMPILE) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) /target:library /out:$@ @$(response) endif $(makefrag): $(sourcefile) @echo Creating $@ ... @sed 's,^,$(the_lib): ,' $< >$@ ifneq ($(response),$(sourcefile)) $(response): $(sourcefile) $(PLATFORM_excludes) @echo Creating $@ ... @sort $(sourcefile) $(PLATFORM_excludes) | uniq -u | $(PLATFORM_CHANGE_SEPARATOR_CMD) >$@ endif -include $(makefrag) # for now, don't give any /lib flags or set MONO_PATH, since we # give a full path to the assembly. ifdef HAVE_CS_TESTS $(test_lib): $(test_dep) $(test_response) $(test_nunit_dep) $(TEST_COMPILE) /target:library /out:$@ $(test_flags) @$(test_response) $(test_response): $(test_sourcefile) @echo Creating $@ ... @sed 's,^,Test/,' $(test_sourcefile) | $(PLATFORM_CHANGE_SEPARATOR_CMD) >$@ $(test_makefrag): $(test_response) @echo Creating $@ ... @sed 's,^,$(test_lib): ,' $< >$@ -include $(test_makefrag) endif ifdef HAVE_VB_TESTS $(btest_lib): $(test_dep) $(btest_response) $(test_nunit_dep) $(BTEST_COMPILE) /target:library /out:$@ $(btest_flags) @$(btest_response) $(btest_response): $(btest_sourcefile) @echo Creating $@ ... @sed 's,^,Test/,' $(btest_sourcefile) | $(PLATFORM_CHANGE_SEPARATOR_CMD) >$@ $(btest_makefrag): $(btest_response) @echo Creating $@ ... @sed 's,^,$(btest_lib): ,' $< >$@ -include $(btest_makefrag) endif all-local: $(makefrag) $(test_makefrag) $(btest_makefrag) $(makefrag) $(test_makefrag) $(btest_makefrag): $(topdir)/build/library.make --- NEW FILE: rules.make --- # -*- makefile -*- # # This is the makefile fragment with default rules # for building things in MCS # # To customize the build, you should edit config.make. # If you need to edit this file, that's a bug; email # pe...@ne... about it. # Some more variables. The leading period in the sed expression prevents # thisdir = . from being changed into '..' for the toplevel directory. dots := $(shell echo $(thisdir) |sed -e 's,[^./][^/]*,..,g') topdir := $(dots) VERSION = 0.93 USE_MCS_FLAGS = $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS) $(MCS_FLAGS) USE_MBAS_FLAGS = $(LOCAL_MBAS_FLAGS) $(PLATFORM_MBAS_FLAGS) $(PROFILE_MBAS_FLAGS) $(MBAS_FLAGS) USE_CFLAGS = $(LOCAL_CFLAGS) $(CFLAGS) CSCOMPILE = $(MCS) $(USE_MCS_FLAGS) BASCOMPILE = $(MBAS) $(USE_MBAS_FLAGS) CCOMPILE = $(CC) $(USE_CFLAGS) BOOT_COMPILE = $(BOOTSTRAP_MCS) $(USE_MCS_FLAGS) INSTALL_DATA = $(INSTALL) -m 644 INSTALL_BIN = $(INSTALL) -m 755 INSTALL_LIB = $(INSTALL_BIN) MKINSTALLDIRS = $(SHELL) $(topdir)/mkinstalldirs INTERNAL_MCS = $(RUNTIME) $(topdir)/mcs/mcs.exe INTERNAL_MBAS = $(RUNTIME) $(topdir)/mbas/mbas.exe INTERNAL_GMCS = $(RUNTIME) $(topdir)/gmcs/gmcs.exe INTERNAL_ILASM = $(RUNTIME) $(topdir)/ilasm/ilasm.exe INTERNAL_RESGEN = $(RUNTIME) $(topdir)/monoresgen/monoresgen.exe corlib = mscorlib.dll depsdir = $(topdir)/build/deps distdir = $(dots)/$(package)/$(thisdir) # Make sure these propagate if set manually export PLATFORM export PROFILE export MCS export MCS_FLAGS export CC export CFLAGS export INSTALL export MKINSTALLDIRS export TEST_HARNESS export BOOTSTRAP_MCS export DESTDIR export RESGEN # Get this so the platform.make platform-check rule doesn't become the # default target .DEFAULT: all default: all # Get initial configuration. pre-config is so that the builder can # override PLATFORM or PROFILE include $(topdir)/build/config-default.make -include $(topdir)/build/pre-config.make # Default PLATFORM and PROFILE if they're not already defined. ifndef PLATFORM ifeq ($(OS),Windows_NT) PLATFORM = win32 else PLATFORM = linux endif endif # Platform config include $(topdir)/build/platforms/$(PLATFORM).make ifdef PLATFORM_CORLIB corlib = $(PLATFORM_CORLIB) endif # Useful ifeq ($(PLATFORM_RUNTIME),$(RUNTIME)) PLATFORM_MONO_NATIVE = yes endif # Rest of the configuration ifndef PROFILE PROFILE = default endif include $(topdir)/build/profiles/$(PROFILE).make -include $(topdir)/build/config.make ifdef OVERRIDE_TARGET_ALL all: all.override else all: all.real endif all.real: all-recursive $(MAKE) all-local STD_TARGETS = test run-test run-test-ondotnet clean install uninstall $(STD_TARGETS): %: %-recursive $(MAKE) $@-local %-recursive: @set . $$MAKEFLAGS; \ case $$2 in --unix) shift ;; esac; \ case $$2 in *=*) dk="exit 1" ;; *k*) dk=: ;; *) dk="exit 1" ;; esac; \ list='$(SUBDIRS)'; for d in $$list ; do \ (cd $$d && $(MAKE) $*) || $$dk ; \ done # note: dist-local dep, extra subdirs, we invoke dist-recursive in the subdir too dist-recursive: dist-local @list='$(SUBDIRS) $(DIST_ONLY_SUBDIRS)'; for d in $$list ; do \ (cd $$d && $(MAKE) $@) || exit 1 ; \ done # Can only do this from the top dir # ## dist: dist-recursive dist-local # We invert the test here to not end in an error # if ChangeLog doesn't exist. # # Note that we error out if we try to dist a nonexistant # file. Seems reasonable to me. # # Pick up Makefile, makefile, or GNUmakefile dist-default: -mkdir -p $(distdir) test '!' -f ChangeLog || cp ChangeLog $(distdir) if test -f Makefile; then m=M; fi; \ if test -f makefile; then m=m; fi; \ if test -f GNUmakefile; then m=GNUm; fi; \ for f in $${m}akefile $(DISTFILES) ; do \ dest=`dirname $(distdir)/$$f` ; \ $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \ done # Useful withmcs: $(MAKE) MCS='$(INTERNAL_MCS)' BOOTSTRAP_MCS='$(INTERNAL_MCS)' all |