1# -*- makefile -*- Time-stamp: <08/06/12 15:54:12 ptr>
2#
3# Copyright (c) 1997-1999, 2002, 2003, 2005-2008
4# Petr Ovtchenkov
5#
6# Portion Copyright (c) 1999-2001
7# Parallel Graphics Ltd.
8#
9# Licensed under the Academic Free License version 3.0
10#
11
12ifdef PRGNAME
13PRG        := $(OUTPUT_DIR)/${PRGNAME}${EXE}
14PRG_DBG    := $(OUTPUT_DIR_DBG)/${PRGNAME}${EXE}
15PRG_STLDBG := $(OUTPUT_DIR_STLDBG)/${PRGNAME}${EXE}
16endif
17
18ALLPRGS = ${PRG}
19ALLPRGS_DBG = ${PRG_DBG}
20ALLPRGS_STLDBG = ${PRG_STLDBG}
21
22define prog_prog
23$(1)_PRG        := $(OUTPUT_DIR)/$(1)${EXE}
24$(1)_PRG_DBG    := $(OUTPUT_DIR_DBG)/$(1)${EXE}
25$(1)_PRG_STLDBG := $(OUTPUT_DIR_STLDBG)/$(1)${EXE}
26
27ALLPRGS        += $${$(1)_PRG}
28ALLPRGS_DBG    += $${$(1)_PRG_DBG}
29ALLPRGS_STLDBG += $${$(1)_PRG_STLDBG}
30endef
31
32$(foreach prg,$(PRGNAMES),$(eval $(call prog_prog,$(prg))))
33
34include ${RULESBASE}/gmake/app/${COMPILER_NAME}.mak
35include ${RULESBASE}/gmake/app/rules.mak
36include ${RULESBASE}/gmake/app/rules-install.mak
37
38define prog_clean
39clean::
40	@rm -f $${$(1)_PRG} $${$(1)_PRG_DBG} $${$(1)_PRG_STLDBG}
41
42uninstall::
43	@rm -f $$(INSTALL_BIN_DIR)/$$($(1)_PRG) $$(INSTALL_BIN_DIR_DBG)/$$($(1)_PRG_DBG) $$(INSTALL_BIN_DIR_STLDBG)/$$($(1)_PRG_STLDBG)
44endef
45
46clean::
47ifdef PRGNAME
48	@-rm -f ${PRG} ${PRG_DBG} ${PRG_STLDBG}
49endif
50
51$(foreach prg,$(PRGNAMES),$(eval $(call prog_clean,$(prg))))
52
53distclean::
54	@-rm -f $(DEPENDS_COLLECTION)
55	@-rmdir -p ${OUTPUT_DIR} ${OUTPUT_DIR_DBG} ${OUTPUT_DIR_STLDBG} 2>/dev/null
56
57uninstall::
58ifdef PRGNAME
59	@-rm -f $(INSTALL_BIN_DIR)/${PRGNAME}${EXE} $(INSTALL_BIN_DIR_DBG)/${PRGNAME}${EXE} $(INSTALL_BIN_DIR_STLDBG)/${PRGNAME}${EXE}
60endif
61	@-rmdir -p $(INSTALL_BIN_DIR) $(INSTALL_BIN_DIR_DBG) $(INSTALL_BIN_DIR_STLDBG) 2>/dev/null
62