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
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
100 @set . $$MAKEFLAGS; \
101 case $$2 in *=*) dk="exit 1" ;; *k*) dk=: ;; *) dk="exit 1" ;; esac; \
102 list='$(SUBDIRS)'; for d in $$list ; do \
103 (cd $$d && $(MAKE) $*) || $$dk ; \
106 # note: dist-local dep, extra subdirs, $* has become $@
108 dist-recursive: dist-local
109 @list='$(SUBDIRS) $(DIST_ONLY_SUBDIRS)'; for d in $$list ; do \
110 (cd $$d && $(MAKE) $@) || exit 1 ; \
113 # We do this manually to not have a make[1]: blah message (That is,
114 # instead of using a '%: %-recursive %-local' construct.)
116 # Let the makefile override these for special situations (running checks
117 # in the toplevel makefile, or a directory that needs to be built before
118 # its subdirectories).
120 ifndef OVERRIDE_BARE_TARGETS
122 all: all-recursive all-local
124 install: install-recursive install-local
126 test: test-recursive test-local
128 run-test: run-test-recursive test-local run-test-local
130 run-test-ondotnet: run-test-ondotnet-recursive test-local run-test-ondotnet-local
132 clean: clean-recursive clean-local
134 uninstall: uninstall-recursive uninstall-local
138 # Can only do this from the top dir
139 # ## dist: dist-recursive dist-local
141 # We invert the test here to not end in an error
142 # if ChangeLog doesn't exist.
144 # Note that we error out if we try to dist a nonexistant
145 # file. Seems reasonable to me.
149 test '!' -f ChangeLog || cp ChangeLog $(distdir)
150 for f in Makefile $(DISTFILES) ; do \
151 dest=`dirname $(distdir)/$$f` ; \
152 $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \
158 $(MAKE) MCS='$(INTERNAL_MCS)' BOOTSTRAP_MCS='$(INTERNAL_MCS)' all