Files
harbour-core/harbour/config/instsh.mk
Viktor Szakats a72a3ca377 2010-06-17 19:28 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* config/global.mk
    % Minor optimization for Windows platform
    ! At the same time fix for CreateProcess( 'uname' ) error on Win9x.

  * config/wce/mingwarm.mk
  * config/win/mingw.mk
  * config/win/cygwin.mk
    ! Fix to previous: In multi-command cmdlines, f.e.: '(cmd1 && cmd2)'
      $(RM) command _must_ be used as a workaround so that GNU Make
      converts it to a batch file. Unfortunately with this, an 'ar'
      failure will be masked by a successful $(RM), so the make won't
      stop.

  * config/globsh.mk
    + Added new command macro $(FALSE) preparing for general solution
      to force failure.

  * config/beos/gcc.mk
  * config/qnx/gcc.mk
  * config/bsd/gcc.mk
  * config/bsd/clang.mk
  * config/darwin/gcc.mk
  * config/darwin/icc.mk
  * config/darwin/clang.mk
  * config/hpux/gcc.mk
  * config/linux/gcc.mk
  * config/linux/icc.mk
  * config/linux/clang.mk
  * config/linux/sunpro.mk
  * config/sunos/gcc.mk
  * config/sunos/sunpro.mk
  * config/instsh.mk
    * 'false' -> '$(FALSE)' for shell independence.
2010-06-17 17:30:41 +00:00

111 lines
2.5 KiB
Makefile

#
# $Id$
#
INSTALL_RULE :=
INSTALL_FILES := $(strip $(INSTALL_FILES))
INSTALL_DIR := $(strip $(INSTALL_DIR))
ifneq ($(INSTALL_FILES),) # Empty install list
ifeq ($(INSTALL_DIR),) # Empty install dir
INSTALL_RULE := @$(ECHO) $(ECHOQUOTE)! Can't install, install dir isn't set$(ECHOQUOTE)
else
_SAME_DIR :=
# Check if $(abspath)/$(realpath) functions are supported
ifneq ($(abspath .),)
ifeq ($(realpath $(INSTALL_DIR)),$(realpath .))
_SAME_DIR := yes
endif
endif
ifeq ($(_SAME_DIR),yes)
INSTALL_RULE := @$(ECHO) $(ECHOQUOTE)! Skip install, destination dir '$(INSTALL_DIR)' is the same as source$(ECHOQUOTE)
else
ifneq ($(HB_SHELL),sh)
INSTALL_DIR_OS := $(subst /,\,$(HB_INST_PKGPREF)$(INSTALL_DIR))
INSTALL_FILES_OS := $(subst /,\,$(INSTALL_FILES))
else
INSTALL_DIR_OS := $(subst \,/,$(HB_INST_PKGPREF)$(INSTALL_DIR))
endif
ifeq ($(HB_SHELL),sh)
INSTALL_RULE := \
@$(MDP) $(INSTALL_DIR_OS); \
if [ ! -d "$(INSTALL_DIR_OS)" ]; \
then \
$(ECHO) "! Can't install, path not found: '$(INSTALL_DIR_OS)'" 1>&2; \
$(FALSE); \
else \
for i in $(INSTALL_FILES); \
do \
if [ -r "$$i" ]; \
then \
$(ECHO) "! Installing $$i on $(INSTALL_DIR_OS)"; \
$(CP) $$i $(INSTALL_DIR_OS); \
true; \
else \
$(ECHO) "! Can't install $$i, not found" 1>&2; \
fi \
done \
fi
endif
ifeq ($(HB_SHELL),nt)
define inst_file_all
-@if not exist "$(INSTALL_DIR_OS)" $(MDP) "$(INSTALL_DIR_OS)"
-@for %%f in ($(INSTALL_FILES_OS)) do $(CP) "%%f" "$(INSTALL_DIR_OS)"
endef
INSTALL_RULE := $(inst_file_all)
endif
ifeq ($(HB_SHELL),os2)
define inst_file_all
-@$(MDP) $(INSTALL_DIR_OS)
$(foreach file,$(INSTALL_FILES),$(inst_file))
endef
# NOTE: The empty line directly before 'endef' HAVE TO exist!
# It causes that every command will be separated by LF
define inst_file
-@$(CP) $(file) $(INSTALL_DIR_OS)
endef
INSTALL_RULE := $(inst_file_all)
endif
ifeq ($(HB_SHELL),dos)
define inst_file_all
-@$(MDP) $(INSTALL_DIR_OS)
$(foreach file,$(INSTALL_FILES_OS),$(inst_file))
endef
# NOTE: The empty line directly before 'endef' HAVE TO exist!
# It causes that every command will be separated by LF
define inst_file
-@$(CP) $(file) $(INSTALL_DIR_OS)
endef
INSTALL_RULE := $(inst_file_all)
endif
endif # Source and destination directories are equal
endif # Empty install dir
endif # Empty install list