3 # The rules for building a program.
5 base_prog
= $(notdir $(PROGRAM
))
6 prog_dir
:= $(filter-out . .
/, $(dir $(PROGRAM
)))
7 sourcefile
= $(base_prog
).sources
8 base_prog_config
:= $(wildcard $(base_prog
).config.
$(PROFILE
))
9 ifndef base_prog_config
10 base_prog_config
:= $(wildcard $(base_prog
).config
)
12 ifdef base_prog_config
13 PROGRAM_config
:= $(PROGRAM
).config
16 executable_CLEAN_FILES
= *.exe
$(PROGRAM
) $(PROGRAM
).mdb
$(BUILT_SOURCES
)
18 ifeq (cat
,$(PLATFORM_CHANGE_SEPARATOR_CMD
))
19 response
= $(sourcefile
)
21 response
= $(depsdir
)/$(base_prog
).response
22 executable_CLEAN_FILES
+= $(response
)
25 ifdef KEEP_OUTPUT_FILE_COPY
31 makefrag
= $(depsdir
)/$(PROFILE
)_
$(base_prog
).makefrag
32 pdb
= $(patsubst %.exe
,%.pdb
,$(PROGRAM
))
33 mdb
= $(patsubst %.exe
,%.mdb
,$(PROGRAM
))
34 executable_CLEAN_FILES
+= $(makefrag
) $(pdb
) $(mdb
)
36 all-local
: $(PROGRAM
) $(PROGRAM_config
)
38 install-local
: all-local
43 install-local uninstall-local
:
47 ifndef PROGRAM_INSTALL_DIR
48 PROGRAM_INSTALL_DIR
= $(mono_libdir
)/mono
/$(FRAMEWORK_VERSION
)
51 install-local
: $(PROGRAM
) $(PROGRAM_config
)
52 $(MKINSTALLDIRS
) $(DESTDIR
)$(PROGRAM_INSTALL_DIR
)
53 $(INSTALL_BIN
) $(PROGRAM
) $(DESTDIR
)$(PROGRAM_INSTALL_DIR
)
54 test ! -f
$(PROGRAM
).mdb ||
$(INSTALL_BIN
) $(PROGRAM
).mdb
$(DESTDIR
)$(PROGRAM_INSTALL_DIR
)
56 $(INSTALL_DATA
) $(PROGRAM_config
) $(DESTDIR
)$(PROGRAM_INSTALL_DIR
)
58 ifdef PLATFORM_AOT_SUFFIX
59 test ! -f
$(PROGRAM
)$(PLATFORM_AOT_SUFFIX
) ||
$(INSTALL_LIB
) $(PROGRAM
)$(PLATFORM_AOT_SUFFIX
) $(DESTDIR
)$(PROGRAM_INSTALL_DIR
)
63 -rm -f
$(DESTDIR
)$(PROGRAM_INSTALL_DIR
)/$(base_prog
) $(DESTDIR
)$(PROGRAM_INSTALL_DIR
)/$(base_prog
).mdb
$(DESTDIR
)$(PROGRAM_INSTALL_DIR
)/$(base_prog
).config
67 -rm -f
$(executable_CLEAN_FILES
) $(CLEAN_FILES
) $(tests_CLEAN_FILES
)
73 run-test-ondotnet-local
:
76 DISTFILES
= $(sourcefile
) $(base_prog_config
) $(EXTRA_DISTFILES
)
81 the_assembly
= $(PROGRAM
)
82 include $(topdir
)/build
/tests.make
86 DISTFILES
+= $(test_sourcefile
)
89 dist-local
: dist-default
90 for f in
`cat $(sourcefile)` ; do \
93 *) dest
=`dirname "$$f"` ; \
94 case
$$subs in
*" $$dest "*) : ;; *) subs
=" $$dest$$subs" ; $(MKINSTALLDIRS
) $(distdir
)/$$dest ;; esac
; \
95 cp
-p
"$$f" $(distdir
)/$$dest || exit
1 ;; \
97 for d in .
$$subs ; do \
98 case
$$d in .
) : ;; *) test ! -f
$$d/ChangeLog || cp
-p
$$d/ChangeLog
$(distdir
)/$$d ;; esac
; done
100 ifndef PROGRAM_COMPILE
101 PROGRAM_COMPILE
= $(CSCOMPILE
)
104 $(PROGRAM
): $(BUILT_SOURCES
) $(EXTRA_SOURCES
) $(response
) $(prog_dir
:=/.stamp
)
105 $(PROGRAM_COMPILE
) -target
:exe
-out
:$(base_prog
) $(BUILT_SOURCES
) $(EXTRA_SOURCES
) @
$(response
)
106 ifneq ($(base_prog
),$(PROGRAM
))
107 $(COPY_CMD
) $(base_prog
) $(PROGRAM
)
108 test ! -f
$(base_prog
).mdb ||
$(COPY_CMD
) $(base_prog
).mdb
$(PROGRAM
).mdb
112 ifneq ($(base_prog_config
),$(PROGRAM_config
))
113 executable_CLEAN_FILES
+= $(PROGRAM_config
)
114 $(PROGRAM_config
): $(base_prog_config
) $(dir $(PROGRAM_config
))/.stamp
115 cp
$(base_prog_config
) $(PROGRAM_config
)
119 $(makefrag
): $(sourcefile
)
120 @echo Creating
$@ ...
121 @sed
's,^,$(PROGRAM): ,' $< > $@
123 ifneq ($(response
),$(sourcefile
))
124 $(response
): $(sourcefile
)
125 @echo Creating
$@ ...
126 @
( $(PLATFORM_CHANGE_SEPARATOR_CMD
) ) <$< >$@
131 all-local
: $(makefrag
) $(extra_targets
)
134 config_file
=`basename $(PROGRAM) .exe`-$(PROFILE
).input
; \
135 echo
$(thisdir
):$$config_file >> $(topdir
)/..
/mono
/msvc
/scripts
/order
; \
138 echo
$(USE_MCS_FLAGS
) $(LIBRARY_FLAGS
) $(LIB_MCS_FLAGS
); \
140 echo
$(BUILT_SOURCES_cmdline
); \
142 echo
$(response
)) > $(topdir
)/..
/mono
/msvc
/scripts
/inputs
/$$config_file
145 ifneq ($(response
),$(sourcefile
))
146 $(response
): $(topdir
)/build
/executable.make
$(depsdir
)/.stamp
148 $(makefrag
): $(topdir
)/build
/executable.make
$(depsdir
)/.stamp