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))
22 install-local: $(PROGRAM)
23 $(MKINSTALLDIRS) $(DESTDIR)$(prefix)/bin
24 $(INSTALL_BIN) $(PROGRAM) $(DESTDIR)$(prefix)/bin
27 -rm -f $(DESTDIR)$(prefix)/bin/$(base_prog)
30 -rm -f *.exe $(BUILT_SOURCES) $(CLEAN_FILES) $(pdb) $(stampfile) $(makefrag)
31 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
36 test-local: $(PROGRAM)
41 DISTFILES = $(sourcefile) $(EXTRA_DISTFILES)
43 dist-local: dist-default
44 for f in `cat $(sourcefile)` ; do \
45 dest=`dirname $(distdir)/$$f` ; \
46 $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \
49 # Changing makefile probably means changing the
50 # sources, so let's be safe and add a Makefile dep
52 $(PROGRAM): $(makefrag) $(response) $(stampfile)
53 $(CSCOMPILE) /target:exe /out:$@ $(BUILT_SOURCES) @$(response)
55 $(makefrag): $(sourcefile)
57 @echo "HAVE_MAKEFRAG = yes" >$@.new
58 @echo "$(stampfile): $(BUILT_SOURCES) \\" >>$@.new
59 @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
60 @cat $@.new |sed -e '$$s, \\$$,,' >$@
61 @$(ECHO_ESCAPE) "\ttouch \$$@" >>$@
64 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
65 $(response): $(sourcefile)
67 @cat $< |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@