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_CFLAGS = $(LOCAL_CFLAGS) $(CFLAGS)
20 CSCOMPILE = $(MCS) $(USE_MCS_FLAGS)
21 CCOMPILE = $(CC) $(USE_CFLAGS)
22 BOOT_COMPILE = $(BOOTSTRAP_MCS) $(USE_MCS_FLAGS)
23 INSTALL_DATA = $(INSTALL) -m 644
24 INSTALL_BIN = $(INSTALL) -m 755
25 INSTALL_LIB = $(INSTALL_BIN)
26 MKINSTALLDIRS = $(SHELL) $(topdir)/mkinstalldirs
27 INTERNAL_MCS = $(RUNTIME) $(topdir)/mcs/mcs.exe
28 INTERNAL_GMCS = $(RUNTIME) $(topdir)/gmcs/gmcs.exe
29 INTERNAL_ILASM = $(RUNTIME) $(topdir)/ilasm/ilasm.exe
30 INTERNAL_RESGEN = $(RUNTIME) $(topdir)/monoresgen/monoresgen.exe
33 depsdir = $(topdir)/build/deps
34 distdir = $(dots)/$(package)/$(thisdir)
36 # Make sure these propagate if set manually
51 # Get this so the platform.make platform-check rule doesn't become the
56 # Get initial configuration. pre-config is so that the builder can
57 # override PLATFORM or PROFILE
59 include $(topdir)/build/config-default.make
60 -include $(topdir)/build/pre-config.make
62 # Default PLATFORM and PROFILE if they're not already defined.
65 ifeq ($(OS),Windows_NT)
74 include $(topdir)/build/platforms/$(PLATFORM).make
77 corlib = $(PLATFORM_CORLIB)
81 ifeq ($(PLATFORM_RUNTIME),$(RUNTIME))
82 PLATFORM_MONO_NATIVE = yes
85 # Rest of the configuration
91 include $(topdir)/build/profiles/$(PROFILE).make
92 -include $(topdir)/build/config.make
98 case $$2 in *=*) dk="exit 1" ;; *k*) dk=: ;; *) dk="exit 1" ;; esac; \
99 list='$(SUBDIRS)'; for d in $$list ; do \
100 (cd $$d && $(MAKE) $*) || $$dk ; \
103 # note: dist-local dep, extra subdirs, $* has become $@
105 dist-recursive: dist-local
106 @list='$(SUBDIRS) $(DIST_ONLY_SUBDIRS)'; for d in $$list ; do \
107 (cd $$d && $(MAKE) $@) || exit 1 ; \
110 # We do this manually to not have a make[1]: blah message (That is,
111 # instead of using a '%: %-recursive %-local' construct.)
113 # Let the makefile override these for special situations (running checks
114 # in the toplevel makefile, or a directory that needs to be built before
115 # its subdirectories).
117 ifndef OVERRIDE_BARE_TARGETS
119 all: all-recursive all-local
121 install: install-recursive install-local
123 test: test-recursive test-local
125 run-test: run-test-recursive test-local run-test-local
127 clean: clean-recursive clean-local
129 uninstall: uninstall-recursive uninstall-local
133 # Can only do this from the top dir
134 # ## dist: dist-recursive dist-local
136 # We invert the test here to not end in an error
137 # if ChangeLog doesn't exist.
139 # Note that we error out if we try to dist a nonexistant
140 # file. Seems reasonable to me.
144 test '!' -f ChangeLog || cp ChangeLog $(distdir)
145 for f in Makefile $(DISTFILES) ; do \
146 dest=`dirname $(distdir)/$$f` ; \
147 $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \
153 $(MAKE) MCS='$(INTERNAL_MCS)' BOOTSTRAP_MCS='$(INTERNAL_MCS)' all