X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fbuild%2Fexecutable.make;h=ccbbcc3b1692d768c93b84cf0ec6e9a27cb5d38b;hb=a18b6d2f420bf249938980c74ef623fd2ef66674;hp=3bd31c27ec4a5d608ceabf7ec59b62c44bf0b7d2;hpb=0f06a4fb246609b645c1d9df4295690bfbdd22fd;p=mono.git diff --git a/mcs/build/executable.make b/mcs/build/executable.make index 3bd31c27ec4..ccbbcc3b169 100644 --- a/mcs/build/executable.make +++ b/mcs/build/executable.make @@ -2,80 +2,102 @@ # # The rules for building a program. -# I'd rather not create a response file here, -# but since on Win32 we need to munge the paths -# anyway, we might as well. - base_prog = $(shell basename $(PROGRAM)) sourcefile = $(base_prog).sources -ifdef PLATFORM_CHANGE_SEPARATOR_CMD -response = $(depsdir)/$(base_prog).response -else +base_prog_config := $(wildcard $(base_prog).config) +ifdef base_prog_config +PROGRAM_config := $(PROGRAM).config +endif + +executable_CLEAN_FILES = *.exe $(PROGRAM) $(PROGRAM).mdb $(BUILT_SOURCES) + +ifeq (cat,$(PLATFORM_CHANGE_SEPARATOR_CMD)) response = $(sourcefile) +else +response = $(depsdir)/$(base_prog).response +executable_CLEAN_FILES += $(response) endif -stampfile = $(depsdir)/$(base_prog).stamp -makefrag = $(depsdir)/$(base_prog).makefrag -pdb = $(patsubst %.exe,%.pdb,$(PROGRAM)) -all-local: $(PROGRAM) +makefrag = $(depsdir)/$(PROFILE)_$(base_prog).makefrag +pdb = $(patsubst %.exe,%.pdb,$(PROGRAM)) +mdb = $(patsubst %.exe,%.mdb,$(PROGRAM)) +executable_CLEAN_FILES += $(makefrag) $(pdb) $(mdb) -install-local: $(PROGRAM) - $(MKINSTALLDIRS) $(DESTDIR)$(prefix)/bin - $(INSTALL_BIN) $(PROGRAM) $(DESTDIR)$(prefix)/bin +all-local: $(PROGRAM) $(PROGRAM_config) +install-local: all-local +test-local: all-local uninstall-local: - -rm -f $(DESTDIR)$(prefix)/bin/$(base_prog) -clean-local: - -rm -f *.exe $(BUILT_SOURCES) $(CLEAN_FILES) $(pdb) $(stampfile) $(makefrag) -ifdef PLATFORM_CHANGE_SEPARATOR_CMD - -rm -f $(response) +ifdef NO_INSTALL +install-local uninstall-local: + @: +else + +ifndef PROGRAM_INSTALL_DIR +PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION) +endif + +install-local: $(PROGRAM) $(PROGRAM_config) + $(MKINSTALLDIRS) $(DESTDIR)$(PROGRAM_INSTALL_DIR) + $(INSTALL_BIN) $(PROGRAM) $(DESTDIR)$(PROGRAM_INSTALL_DIR) + test ! -f $(PROGRAM).mdb || $(INSTALL_BIN) $(PROGRAM).mdb $(DESTDIR)$(PROGRAM_INSTALL_DIR) +ifdef PROGRAM_config + $(INSTALL_DATA) $(PROGRAM_config) $(DESTDIR)$(PROGRAM_INSTALL_DIR) endif -ifndef HAS_TEST -test-local: $(PROGRAM) +uninstall-local: + -rm -f $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$(base_prog) $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$(base_prog).mdb $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$(base_prog).config +endif +clean-local: + -rm -f $(executable_CLEAN_FILES) $(CLEAN_FILES) + +test-local: + @: run-test-local: -endif + @: +run-test-ondotnet-local: + @: -DISTFILES = $(sourcefile) $(EXTRA_DISTFILES) +DISTFILES = $(sourcefile) $(base_prog_config) $(EXTRA_DISTFILES) dist-local: dist-default for f in `cat $(sourcefile)` ; do \ dest=`dirname $(distdir)/$$f` ; \ - $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \ + $(MKINSTALLDIRS) $$dest && cp -p $$f $$dest || exit 1 ; \ done -# Changing makefile probably means changing the -# sources, so let's be safe and add a Makefile dep - ifndef PROGRAM_COMPILE PROGRAM_COMPILE = $(CSCOMPILE) endif -$(PROGRAM): $(makefrag) $(response) $(stampfile) - $(PROGRAM_COMPILE) /target:exe /out:$@ $(BUILT_SOURCES) @$(response) +$(PROGRAM): $(BUILT_SOURCES) $(EXTRA_SOURCES) $(response) + $(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 +endif + +ifdef PROGRAM_config +ifneq ($(base_prog_config),$(PROGRAM_config)) +executable_CLEAN_FILES += $(PROGRAM_config) +$(PROGRAM_config): $(base_prog_config) + cp $(base_prog_config) $(PROGRAM_config) +endif +endif -# warning: embedded tab in the 'echo touch' line $(makefrag): $(sourcefile) @echo Creating $@ ... - @echo "HAVE_MAKEFRAG = yes" >$@.new - @echo "$(stampfile): $(BUILT_SOURCES) \\" >>$@.new - @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new - @cat $@.new |sed -e '$$s, \\$$,,' >$@ - @echo " touch \$$@" >>$@ - @rm -rf $@.new - -ifdef PLATFORM_CHANGE_SEPARATOR_CMD + @sed 's,^,$(PROGRAM): ,' $< > $@ + +ifneq ($(response),$(sourcefile)) $(response): $(sourcefile) @echo Creating $@ ... - @cat $< |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@ + @( $(PLATFORM_CHANGE_SEPARATOR_CMD) ) <$< >$@ endif -include $(makefrag) -ifndef HAVE_MAKEFRAG -$(stampfile): - touch $@ -endif - +all-local: $(makefrag) +$(makefrag): $(topdir)/build/executable.make