2004-06-10 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / build / executable.make
index 3bd31c27ec4a5d608ceabf7ec59b62c44bf0b7d2..6bb38a9bc76a7060d5dbc1bff644b1c077aaa3d1 100644 (file)
@@ -13,30 +13,34 @@ response = $(depsdir)/$(base_prog).response
 else
 response = $(sourcefile)
 endif
-stampfile = $(depsdir)/$(base_prog).stamp
 makefrag = $(depsdir)/$(base_prog).makefrag
 pdb = $(patsubst %.exe,%.pdb,$(PROGRAM))
 
+ifndef PROGRAM_INSTALL_DIR
+PROGRAM_INSTALL_DIR = $(prefix)/bin
+endif
+
 all-local: $(PROGRAM)
 
 install-local: $(PROGRAM)
-       $(MKINSTALLDIRS) $(DESTDIR)$(prefix)/bin
-       $(INSTALL_BIN) $(PROGRAM) $(DESTDIR)$(prefix)/bin
+       $(MKINSTALLDIRS) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
+       $(INSTALL_BIN) $(PROGRAM) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
 
 uninstall-local:
-       -rm -f $(DESTDIR)$(prefix)/bin/$(base_prog)
+       -rm -f $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$(base_prog)
 
 clean-local:
-       -rm -f *.exe $(BUILT_SOURCES) $(CLEAN_FILES) $(pdb) $(stampfile) $(makefrag)
+       -rm -f *.exe $(BUILT_SOURCES) $(CLEAN_FILES) $(pdb) $(makefrag)
 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
        -rm -f $(response)
 endif
 
-ifndef HAS_TEST
 test-local: $(PROGRAM)
-
+       @:
 run-test-local:
-endif
+       @:
+run-test-ondotnet-local:
+       @:
 
 DISTFILES = $(sourcefile) $(EXTRA_DISTFILES)
 
@@ -46,25 +50,16 @@ dist-local: dist-default
            $(MKINSTALLDIRS) $$dest && cp $$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): $(makefrag) $(BUILT_SOURCES) $(response)
        $(PROGRAM_COMPILE) /target:exe /out:$@ $(BUILT_SOURCES) @$(response)
 
-# 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
+       @sed 's,^,$(PROGRAM): ,' $< > $@
 
 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
 $(response): $(sourcefile)
@@ -73,9 +68,3 @@ $(response): $(sourcefile)
 endif
 
 -include $(makefrag)
-
-ifndef HAVE_MAKEFRAG
-$(stampfile):
-       touch $@
-endif
-