2003-04-29 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
[mono.git] / mcs / class / executable.make
1 RUNTIME = mono
2 MCS = $(RUNTIME) $(topdir)/mcs/mcs.exe
3 MCS_FLAGS = --target exe
4 INSTALL = /usr/bin/install
5 prefix = /usr
6
7 all: $(PROGRAM)
8
9 clean:
10         -rm -rf $(PROGRAM) .response-exe .makefrag-exe
11
12 .response-exe: $(PROGRAM_LIST)
13         cat $^ |egrep '\.cs$$' >$@
14
15 .makefrag-exe: $(PROGRAM_LIST)
16         echo -n "program-deps: " >$@.new
17         cat $^ |egrep '\.cs$$' | sed -e 's,\.cs,.cs \\,' >>$@.new
18         cat $@.new |sed -e '$$s, \\$$,,' >$@
19         rm -rf $@.new
20
21 -include .makefrag-exe
22
23 $(PROGRAM): .response-exe .makefrag-exe program-deps
24         MONO_PATH=$(MONO_PATH_PREFIX)$(MONO_PATH) $(MCS) $(MCS_FLAGS) -o $(PROGRAM) $(PROGRAM_FLAGS) @.response-exe
25         touch -r $(PROGRAM) program-deps
26
27 install: all
28         mkdir -p $(prefix)/bin/
29         $(INSTALL) -m 755 $(PROGRAM) $(prefix)/bin/
30