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
30 depsdir = $(topdir)/build/deps
31 distdir = $(dots)/$(package)/$(thisdir)
33 # Make sure these propagate if set manually
48 # Get this so the platform.make platform-check rule doesn't become the
53 # Get initial configuration. pre-config is so that the builder can
54 # override PLATFORM or PROFILE
56 include $(topdir)/build/config-default.make
57 -include $(topdir)/build/pre-config.make
59 # Default PLATFORM and PROFILE if they're not already defined.
62 ifeq ($(OS),Windows_NT)
71 include $(topdir)/build/platforms/$(PLATFORM).make
74 corlib = $(PLATFORM_CORLIB)
78 ifeq ($(PLATFORM_RUNTIME),$(RUNTIME))
79 PLATFORM_MONO_NATIVE = yes
82 # Rest of the configuration
88 include $(topdir)/build/profiles/$(PROFILE).make
89 -include $(topdir)/build/config.make
95 case $$2 in *=*) dk="exit 1" ;; *k*) dk=: ;; *) dk="exit 1" ;; esac; \
96 list='$(SUBDIRS)'; for d in $$list ; do \
97 (cd $$d && $(MAKE) $*) || $$dk ; \
100 # note: dist-local dep, extra subdirs, $* has become $@
102 dist-recursive: dist-local
103 @list='$(SUBDIRS) $(DIST_ONLY_SUBDIRS)'; for d in $$list ; do \
104 (cd $$d && $(MAKE) $@) || exit 1 ; \
107 # We do this manually to not have a make[1]: blah message (That is,
108 # instead of using a '%: %-recursive %-local' construct.)
110 # Let the makefile override these for special situations (running checks
111 # in the toplevel makefile, or a directory that needs to be built before
112 # its subdirectories).
114 ifndef OVERRIDE_BARE_TARGETS
116 all: all-recursive all-local
118 install: install-recursive install-local
120 test: test-recursive test-local
122 run-test: run-test-recursive test-local run-test-local
124 clean: clean-recursive clean-local
126 uninstall: uninstall-recursive uninstall-local
130 # Can only do this from the top dir
131 # ## dist: dist-recursive dist-local
133 # We invert the test here to not end in an error
134 # if ChangeLog doesn't exist.
136 # Note that we error out if we try to dist a nonexistant
137 # file. Seems reasonable to me.
141 test '!' -f ChangeLog || cp ChangeLog $(distdir)
142 for f in Makefile $(DISTFILES) ; do \
143 dest=`dirname $(distdir)/$$f` ; \
144 $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \
150 $(MAKE) MCS='$(INTERNAL_MCS)' BOOTSTRAP_MCS='$(INTERNAL_MCS)' all