3 # This is the makefile fragment with default rules
4 # for building things in MCS
6 # To customize the build, you should edit config.make.
7 # If you need to edit this file, that's a bug; email
8 # peter@newton.cx about it.
10 # Some more variables. The leading period in the sed expression prevents
11 # thisdir = . from being changed into '..' for the toplevel directory.
13 dots := $(shell echo $(thisdir) |sed -e 's,[^./][^/]*,..,g')
18 USE_MCS_FLAGS = $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS) $(MCS_FLAGS)
19 USE_MBAS_FLAGS = $(LOCAL_MBAS_FLAGS) $(PLATFORM_MBAS_FLAGS) $(PROFILE_MBAS_FLAGS) $(MBAS_FLAGS)
20 USE_CFLAGS = $(LOCAL_CFLAGS) $(CFLAGS)
21 CSCOMPILE = $(MCS) $(USE_MCS_FLAGS)
22 BASCOMPILE = $(MBAS) $(USE_MBAS_FLAGS)
23 CCOMPILE = $(CC) $(USE_CFLAGS)
24 BOOT_COMPILE = $(BOOTSTRAP_MCS) $(USE_MCS_FLAGS)
25 INSTALL_DATA = $(INSTALL) -m 644
26 INSTALL_BIN = $(INSTALL) -m 755
27 INSTALL_LIB = $(INSTALL_BIN)
28 MKINSTALLDIRS = $(SHELL) $(topdir)/mkinstalldirs
29 INTERNAL_MCS = $(RUNTIME) $(topdir)/mcs/mcs.exe
30 INTERNAL_MBAS = $(RUNTIME) $(topdir)/mbas/mbas.exe
31 INTERNAL_GMCS = $(RUNTIME) $(topdir)/gmcs/gmcs.exe
32 INTERNAL_ILASM = $(RUNTIME) $(topdir)/ilasm/ilasm.exe
33 INTERNAL_RESGEN = $(RUNTIME) $(topdir)/monoresgen/monoresgen.exe
36 depsdir = $(topdir)/build/deps
37 distdir = $(dots)/$(package)/$(thisdir)
39 # Make sure these propagate if set manually
54 # Get this so the platform.make platform-check rule doesn't become the
60 # Get initial configuration. pre-config is so that the builder can
61 # override PLATFORM or PROFILE
63 include $(topdir)/build/config-default.make
64 -include $(topdir)/build/pre-config.make
66 # Default PLATFORM and PROFILE if they're not already defined.
69 ifeq ($(OS),Windows_NT)
78 include $(topdir)/build/platforms/$(PLATFORM).make
81 corlib = $(PLATFORM_CORLIB)
85 ifeq ($(PLATFORM_RUNTIME),$(RUNTIME))
86 PLATFORM_MONO_NATIVE = yes
89 # Rest of the configuration
95 include $(topdir)/build/profiles/$(PROFILE).make
96 -include $(topdir)/build/config.make
98 ifdef OVERRIDE_TARGET_ALL
104 all.real: all-recursive
107 STD_TARGETS = test run-test run-test-ondotnet clean install uninstall
109 $(STD_TARGETS): %: %-recursive
113 @set . $$MAKEFLAGS; \
114 case $$2 in --unix) shift ;; esac; \
115 case $$2 in *=*) dk="exit 1" ;; *k*) dk=: ;; *) dk="exit 1" ;; esac; \
116 list='$(SUBDIRS)'; for d in $$list ; do \
117 (cd $$d && $(MAKE) $*) || $$dk ; \
120 # note: dist-local dep, extra subdirs, we invoke dist-recursive in the subdir too
121 dist-recursive: dist-local
122 @list='$(SUBDIRS) $(DIST_ONLY_SUBDIRS)'; for d in $$list ; do \
123 (cd $$d && $(MAKE) $@) || exit 1 ; \
126 # Can only do this from the top dir
127 # ## dist: dist-recursive dist-local
129 # We invert the test here to not end in an error
130 # if ChangeLog doesn't exist.
132 # Note that we error out if we try to dist a nonexistant
133 # file. Seems reasonable to me.
137 test '!' -f ChangeLog || cp ChangeLog $(distdir)
138 for f in Makefile $(DISTFILES) ; do \
139 dest=`dirname $(distdir)/$$f` ; \
140 $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \
146 $(MAKE) MCS='$(INTERNAL_MCS)' BOOTSTRAP_MCS='$(INTERNAL_MCS)' all