3 # The rules for building a program.
5 # I'd rather not create a response file here,
6 # but since on Win32 we need to munge the paths
7 # anyway, we might as well.
9 base_prog = $(shell basename $(PROGRAM))
10 sourcefile = $(base_prog).sources
11 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
12 response = $(depsdir)/$(base_prog).response
14 response = $(sourcefile)
16 stampfile = $(depsdir)/$(base_prog).stamp
17 makefrag = $(depsdir)/$(base_prog).makefrag
18 pdb = $(patsubst %.exe,%.pdb,$(PROGRAM))
20 ifndef PROGRAM_INSTALL_DIR
21 PROGRAM_INSTALL_DIR = $(prefix)/bin
26 install-local: $(PROGRAM)
27 $(MKINSTALLDIRS) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
28 $(INSTALL_BIN) $(PROGRAM) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
31 -rm -f $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$(base_prog)
34 -rm -f *.exe $(BUILT_SOURCES) $(CLEAN_FILES) $(pdb) $(stampfile) $(makefrag)
35 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
40 test-local: $(PROGRAM)
44 run-test-ondotnet-local:
47 DISTFILES = $(sourcefile) $(EXTRA_DISTFILES)
49 dist-local: dist-default
50 for f in `cat $(sourcefile)` ; do \
51 dest=`dirname $(distdir)/$$f` ; \
52 $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \
55 # Changing makefile probably means changing the
56 # sources, so let's be safe and add a Makefile dep
58 ifndef PROGRAM_COMPILE
59 PROGRAM_COMPILE = $(CSCOMPILE)
62 $(PROGRAM): $(makefrag) $(response) $(stampfile)
63 $(PROGRAM_COMPILE) /target:exe /out:$@ $(BUILT_SOURCES) @$(response)
65 # warning: embedded tab in the 'echo touch' line
66 $(makefrag): $(sourcefile)
68 @echo "HAVE_MAKEFRAG = yes" >$@.new
69 @echo "$(stampfile): $(BUILT_SOURCES) \\" >>$@.new
70 @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
71 @cat $@.new |sed -e '$$s, \\$$,,' >$@
72 @echo " touch \$$@" >>$@
75 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
76 $(response): $(sourcefile)
78 @cat $< |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@