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 PROGRAM_config
:= $(wildcard $(PROGRAM
).config
)
13 ifeq (cat
,$(PLATFORM_CHANGE_SEPARATOR_CMD
))
14 response
= $(sourcefile
)
16 response
= $(depsdir
)/$(base_prog
).response
17 executable_CLEAN_FILES
+= $(response
)
20 makefrag
= $(depsdir
)/$(base_prog
).makefrag
21 pdb
= $(patsubst %.exe
,%.pdb
,$(PROGRAM
))
22 mdb
= $(patsubst %.exe
,%.mdb
,$(PROGRAM
))
23 executable_CLEAN_FILES
+= $(makefrag
) $(pdb
) $(mdb
)
25 ifndef PROGRAM_INSTALL_DIR
26 PROGRAM_INSTALL_DIR
= $(prefix)/bin
31 install-local
: $(PROGRAM
) $(PROGRAM_config
)
32 $(MKINSTALLDIRS
) $(DESTDIR
)$(PROGRAM_INSTALL_DIR
)
33 $(INSTALL_BIN
) $(PROGRAM
) $(DESTDIR
)$(PROGRAM_INSTALL_DIR
)
34 -$(INSTALL_BIN
) $(PROGRAM
).mdb
$(DESTDIR
)$(PROGRAM_INSTALL_DIR
)
36 $(INSTALL_DATA
) $(PROGRAM_config
) $(DESTDIR
)$(PROGRAM_INSTALL_DIR
)
40 -rm -f
$(DESTDIR
)$(PROGRAM_INSTALL_DIR
)/$(base_prog
) $(DESTDIR
)$(PROGRAM_INSTALL_DIR
)/$(base_prog
).mdb
43 -rm -f
*.exe
$(BUILT_SOURCES
) $(executable_CLEAN_FILES
) $(CLEAN_FILES
)
45 test-local
: $(PROGRAM
)
49 run-test-ondotnet-local
:
52 DISTFILES
= $(sourcefile
) $(EXTRA_DISTFILES
)
54 dist-local
: dist-default
55 for f in
`cat $(sourcefile)` ; do \
56 dest
=`dirname $(distdir)/$$f` ; \
57 $(MKINSTALLDIRS
) $$dest && cp
$$f $$dest || exit
1 ; \
60 ifndef PROGRAM_COMPILE
61 PROGRAM_COMPILE
= $(CSCOMPILE
)
64 $(PROGRAM
): $(BUILT_SOURCES
) $(EXTRA_SOURCES
) $(response
)
65 $(PROGRAM_COMPILE
) /target
:exe
/out
:$@
$(BUILT_SOURCES
) $(EXTRA_SOURCES
) @
$(response
)
67 $(makefrag
): $(sourcefile
)
69 @sed
's,^,$(PROGRAM): ,' $< > $@
71 ifneq ($(response
),$(sourcefile
))
72 $(response
): $(sourcefile
)
74 @
( $(PLATFORM_CHANGE_SEPARATOR_CMD
) ) <$< >$@
79 all-local
: $(makefrag
)
80 $(makefrag
): $(topdir
)/build
/executable.make