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)/class/lib/$(PROFILE)/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)/tools/resgen/resgen.exe
36 depsdir = $(topdir)/build/deps
38 # Make sure these propagate if set manually
53 # Get this so the platform.make platform-check rule doesn't become the
59 # Get initial configuration. pre-config is so that the builder can
60 # override PLATFORM or PROFILE
62 include $(topdir)/build/config-default.make
63 -include $(topdir)/build/pre-config.make
65 # Default PLATFORM and PROFILE if they're not already defined.
68 ifeq ($(OS),Windows_NT)
77 include $(topdir)/build/platforms/$(PLATFORM).make
80 corlib = $(PLATFORM_CORLIB)
84 ifeq ($(PLATFORM_RUNTIME),$(RUNTIME))
85 PLATFORM_MONO_NATIVE = yes
88 # Rest of the configuration
94 include $(topdir)/build/profiles/$(PROFILE).make
95 -include $(topdir)/build/config.make
97 ifdef OVERRIDE_TARGET_ALL
103 all.real: all-recursive
106 STD_TARGETS = test run-test run-test-ondotnet clean install uninstall
108 $(STD_TARGETS): %: %-recursive
111 # The way this is set up, any profile-specific subdirs list should
112 # be listed _before_ including rules.make. However, the default
113 # SUBDIRS list can come after, so don't use the eager := syntax when
114 # using the defaults.
115 PROFILE_SUBDIRS := $($(PROFILE)_SUBDIRS)
116 ifndef PROFILE_SUBDIRS
117 PROFILE_SUBDIRS = $(SUBDIRS)
121 @set . $$MAKEFLAGS; final_exit=:; \
122 case $$2 in --unix) shift ;; esac; \
123 case $$2 in *=*) dk="exit 1" ;; *k*) dk=: ;; *) dk="exit 1" ;; esac; \
124 list='$(PROFILE_SUBDIRS)'; for d in $$list ; do \
125 (cd $$d && $(MAKE) $*) || { final_exit="exit 1"; $$dk; } ; \
130 DIST_SUBDIRS = $(SUBDIRS) $(DIST_ONLY_SUBDIRS)
132 dist-recursive: dist-local
133 @case '$(distdir)' in [\\/$$]* | ?:[\\/]* ) reldir='$(distdir)' ;; *) reldir='../$(distdir)' ;; esac ; \
134 list='$(DIST_SUBDIRS)'; for d in $$list ; do \
135 (cd $$d && $(MAKE) distdir=$$reldir/$$d $@) || exit 1 ; \
138 # The following target can be used like
140 # dist-local: dist-default
141 # ... additional commands ...
144 # 1. we invert the test here to not end in an error if ChangeLog doesn't exist.
145 # 2. we error out if we try to dist a nonexistant file.
146 # 3. we pick up Makefile, makefile, or GNUmakefile.
149 test '!' -f ChangeLog || cp ChangeLog $(distdir)
150 if test -f Makefile; then m=M; fi; \
151 if test -f makefile; then m=m; fi; \
152 if test -f GNUmakefile; then m=GNUm; fi; \
153 for f in $${m}akefile $(DISTFILES) ; do \
154 dest=`dirname $(distdir)/$$f` ; \
155 $(MKINSTALLDIRS) $$dest && cp -p $$f $$dest || exit 1 ; \
161 $(MAKE) MCS='$(INTERNAL_MCS)' BOOTSTRAP_MCS='$(INTERNAL_MCS)' all