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 *.exe $(BUILT_SOURCES) $(CLEAN_FILES) $(pdb) $(stampfile) $(makefrag)
28 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
33 test-local: $(PROGRAM)
38 DISTFILES = $(sourcefile) $(EXTRA_DISTFILES)
40 dist-local: dist-default
41 for f in `cat $(sourcefile)` ; do \
42 dest=`dirname $(distdir)/$$f` ; \
43 $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \
46 # Changing makefile probably means changing the
47 # sources, so let's be safe and add a Makefile dep
49 $(PROGRAM): $(makefrag) $(response) $(stampfile)
50 $(CSCOMPILE) /target:exe /out:$@ $(BUILT_SOURCES) @$(response)
52 $(makefrag): $(sourcefile)
54 @echo "HAVE_MAKEFRAG = yes" >$@.new
55 @echo "$(stampfile): $(BUILT_SOURCES) \\" >>$@.new
56 @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
57 @cat $@.new |sed -e '$$s, \\$$,,' >$@
58 @$(ECHO_ESCAPE) "\ttouch \$$@" >>$@
61 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
62 $(response): $(sourcefile)
64 @cat $< |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@