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 sourcefile = $(PROGRAM).sources
10 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
11 response = $(depsdir)/$(PROGRAM).response
13 response = $(sourcefile)
15 stampfile = $(depsdir)/$(PROGRAM).stamp
16 makefrag = $(depsdir)/$(PROGRAM).makefrag
21 $(MKINSTALLDIRS) $(DESTDIR)$(prefix)/bin
22 $(INSTALL_BIN) $(PROGRAM) $(DESTDIR)$(prefix)/bin
25 -rm -f *.exe $(BUILT_SOURCES) $(CLEAN_FILES) $(stampfile) $(makefrag)
26 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
31 test-local: $(PROGRAM)
36 DISTFILES = $(sourcefile) $(EXTRA_DISTFILES)
38 dist-local: dist-default
39 cat $(sourcefile) |xargs -n 20 \
40 $(SHELL) -c 'for f in $$* ; do \
41 dest=`dirname $(distdir)/$$f` ; \
42 $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \
45 # Changing makefile probably means changing the
46 # sources, so let's be safe and add a Makefile dep
48 $(PROGRAM): $(makefrag) $(response) $(stampfile)
49 $(CSCOMPILE) /target:exe /out:$@ $(BUILT_SOURCES) @$(response)
51 $(makefrag): $(sourcefile)
53 @echo "HAVE_MAKEFRAG = yes" >$@.new
54 @echo "$(stampfile): $(BUILT_SOURCES) \\" >>$@.new
55 @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
56 @cat $@.new |sed -e '$$s, \\$$,,' >$@
57 @echo -e "\ttouch \$$@" >>$@
60 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
61 $(response): $(sourcefile)
62 cat $< |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@