This commit was manufactured by cvs2svn to create branch 'mono-1-0'.
[mono.git] / mcs / build / executable.make
1 # -*- makefile -*-
2 #
3 # The rules for building a program.
4
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.
8
9 base_prog = $(shell basename $(PROGRAM))
10 sourcefile = $(base_prog).sources
11
12 ifeq (cat,$(PLATFORM_CHANGE_SEPARATOR_CMD))
13 response = $(sourcefile)
14 else
15 response = $(depsdir)/$(base_prog).response
16 executable_CLEAN_FILES += $(response)
17 endif
18
19 makefrag = $(depsdir)/$(base_prog).makefrag
20 pdb = $(patsubst %.exe,%.pdb,$(PROGRAM))
21 executable_CLEAN_FILES += $(makefrag) $(pdb)
22
23 ifndef PROGRAM_INSTALL_DIR
24 PROGRAM_INSTALL_DIR = $(prefix)/bin
25 endif
26
27 all-local: $(PROGRAM)
28
29 install-local: $(PROGRAM)
30         $(MKINSTALLDIRS) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
31         $(INSTALL_BIN) $(PROGRAM) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
32
33 uninstall-local:
34         -rm -f $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$(base_prog)
35
36 clean-local:
37         -rm -f *.exe $(BUILT_SOURCES) $(executable_CLEAN_FILES) $(CLEAN_FILES)
38
39 test-local: $(PROGRAM)
40         @:
41 run-test-local:
42         @:
43 run-test-ondotnet-local:
44         @:
45
46 DISTFILES = $(sourcefile) $(EXTRA_DISTFILES)
47
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 ; \
52         done
53
54 ifndef PROGRAM_COMPILE
55 PROGRAM_COMPILE = $(CSCOMPILE)
56 endif
57
58 $(PROGRAM): $(BUILT_SOURCES) $(response)
59         $(PROGRAM_COMPILE) /target:exe /out:$@ $(BUILT_SOURCES) @$(response)
60
61 $(makefrag): $(sourcefile)
62         @echo Creating $@ ...
63         @sed 's,^,$(PROGRAM): ,' $< > $@
64
65 ifneq ($(response),$(sourcefile))
66 $(response): $(sourcefile)
67         @echo Creating $@ ...
68         @( $(PLATFORM_CHANGE_SEPARATOR_CMD) ) <$< >$@
69 endif
70
71 -include $(makefrag)
72
73 all-local: $(makefrag)
74 $(makefrag): $(topdir)/build/executable.make