#
# The rules for building a program.
-base_prog = $(shell basename $(PROGRAM))
+base_prog = $(notdir $(PROGRAM))
+prog_dir := $(filter-out . ./, $(dir $(PROGRAM)))
sourcefile = $(base_prog).sources
+base_prog_config := $(wildcard $(base_prog).config.$(PROFILE))
+ifndef base_prog_config
base_prog_config := $(wildcard $(base_prog).config)
+endif
ifdef base_prog_config
PROGRAM_config := $(PROGRAM).config
endif
executable_CLEAN_FILES += $(response)
endif
+ifdef KEEP_OUTPUT_FILE_COPY
+ COPY_CMD = cp
+else
+ COPY_CMD = mv
+endif
+
makefrag = $(depsdir)/$(PROFILE)_$(base_prog).makefrag
pdb = $(patsubst %.exe,%.pdb,$(PROGRAM))
mdb = $(patsubst %.exe,%.mdb,$(PROGRAM))
endif
clean-local:
- -rm -f $(executable_CLEAN_FILES) $(CLEAN_FILES)
+ -rm -f $(executable_CLEAN_FILES) $(CLEAN_FILES) $(tests_CLEAN_FILES)
test-local:
@:
DISTFILES = $(sourcefile) $(base_prog_config) $(EXTRA_DISTFILES)
+ifdef HAS_NUNIT_TEST
+ASSEMBLY = $(PROGRAM)
+ASSEMBLY_EXT = .exe
+the_assembly = $(PROGRAM)
+include $(topdir)/build/tests.make
+endif
+
+ifdef HAVE_CS_TESTS
+DISTFILES += $(test_sourcefile)
+endif
+
dist-local: dist-default
for f in `cat $(sourcefile)` ; do \
case $$f in \
PROGRAM_COMPILE = $(CSCOMPILE)
endif
-$(PROGRAM): $(BUILT_SOURCES) $(EXTRA_SOURCES) $(response)
+$(PROGRAM): $(BUILT_SOURCES) $(EXTRA_SOURCES) $(response) $(prog_dir:=/.stamp)
$(PROGRAM_COMPILE) -target:exe -out:$(base_prog) $(BUILT_SOURCES) $(EXTRA_SOURCES) @$(response)
ifneq ($(base_prog),$(PROGRAM))
- mv $(base_prog) $(PROGRAM)
- test ! -f $(base_prog).mdb || mv $(base_prog).mdb $(PROGRAM).mdb
+ $(COPY_CMD) $(base_prog) $(PROGRAM)
+ test ! -f $(base_prog).mdb || $(COPY_CMD) $(base_prog).mdb $(PROGRAM).mdb
endif
ifdef PROGRAM_config
ifneq ($(base_prog_config),$(PROGRAM_config))
executable_CLEAN_FILES += $(PROGRAM_config)
-$(PROGRAM_config): $(base_prog_config)
+$(PROGRAM_config): $(base_prog_config) $(dir $(PROGRAM_config))/.stamp
cp $(base_prog_config) $(PROGRAM_config)
endif
endif
-include $(makefrag)
-all-local: $(makefrag)
-$(makefrag): $(topdir)/build/executable.make
+all-local: $(makefrag) $(extra_targets)
+
+csproj-local:
+ config_file=`basename $(PROGRAM) .exe`-$(PROFILE).input; \
+ echo $(thisdir):$$config_file >> $(topdir)/../mono/msvc/scripts/order; \
+ (echo $(is_boot); \
+ echo $(MCS); \
+ echo $(USE_MCS_FLAGS) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS); \
+ echo $(PROGRAM); \
+ echo $(BUILT_SOURCES_cmdline); \
+ echo $(build_lib); \
+ echo $(response)) > $(topdir)/../mono/msvc/scripts/inputs/$$config_file
+
+
+ifneq ($(response),$(sourcefile))
+$(response): $(topdir)/build/executable.make $(depsdir)/.stamp
+endif
+$(makefrag): $(topdir)/build/executable.make $(depsdir)/.stamp
+
+doc-update-local:
+ @:
+