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
12 ifeq (cat,$(PLATFORM_CHANGE_SEPARATOR_CMD))
13 response = $(sourcefile)
15 response = $(depsdir)/$(base_prog).response
16 executable_CLEAN_FILES += $(response)
19 makefrag = $(depsdir)/$(base_prog).makefrag
20 pdb = $(patsubst %.exe,%.pdb,$(PROGRAM))
21 executable_CLEAN_FILES += $(makefrag) $(pdb)
23 ifndef PROGRAM_INSTALL_DIR
24 PROGRAM_INSTALL_DIR = $(prefix)/bin
29 install-local: $(PROGRAM)
30 $(MKINSTALLDIRS) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
31 $(INSTALL_BIN) $(PROGRAM) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
34 -rm -f $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$(base_prog)
37 -rm -f *.exe $(BUILT_SOURCES) $(executable_CLEAN_FILES) $(CLEAN_FILES)
39 test-local: $(PROGRAM)
43 run-test-ondotnet-local:
46 DISTFILES = $(sourcefile) $(EXTRA_DISTFILES)
48 dist-local: dist-default
49 for f in `cat $(sourcefile)` ; do \
50 dest=`dirname $(distdir)/$$f` ; \
51 $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \
54 ifndef PROGRAM_COMPILE
55 PROGRAM_COMPILE = $(CSCOMPILE)
58 $(PROGRAM): $(BUILT_SOURCES) $(response)
59 $(PROGRAM_COMPILE) /target:exe /out:$@ $(BUILT_SOURCES) @$(response)
61 $(makefrag): $(sourcefile)
63 @sed 's,^,$(PROGRAM): ,' $< > $@
65 ifneq ($(response),$(sourcefile))
66 $(response): $(sourcefile)
68 @( $(PLATFORM_CHANGE_SEPARATOR_CMD) ) <$< >$@
73 all-local: $(makefrag)
74 $(makefrag): $(topdir)/build/executable.make