Files
harbour-core/harbour/config/linux/install.cf
Viktor Szakats f6bfa2149e 2009-07-15 14:01 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* config/hpux/install.cf
  * config/darwin/install.cf
  * config/dos/install.cf
  * config/win/install.cf
  * config/install.cf
  * config/linux/install.cf
  * config/os2/install.cf
  * config/sunos/install.cf
  * config/bsd/install.cf
  * config/wce/install.cf
    ! Restored previous install rule setup, to fix hbpp combined
      lib/bin install case.
    ; QUESTION: How to use multiple commands in a non-bash (= batch)
                INSTALL_RULE variable? This would be needed to support
                automatic addition of install dirs with non-bash shells.
2009-07-15 12:02:59 +00:00

63 lines
1.2 KiB
CFEngine3

#
# $Id$
#
ifeq ($(INSTALL_FILES),) # Empty install list
INSTALL_RULE =\
@echo Done
else
ifeq ($(SHLVL),) # non-bash
ifeq ($(OS2_SHELL),) # non-OS/2
INSTALL_DIR_OS = $(subst /,\,$(INSTALL_DIR))
INSTALL_FILES_OS = $(subst /,\,$(INSTALL_FILES))
INSTALL_RULE =\
-$(COMSPEC) /c for %%f in ($(INSTALL_FILES_OS)) do copy "%%f" "$(INSTALL_DIR_OS)"
else # OS/2
# We have to use script to overcome the max command size limit
# NOTE: The empty line directly before 'endef' HAVE TO exist!
# It causes that every commands will be separated by LF
define inst_file
$(COMSPEC) /C $(CP) $(file) $(subst /,\,$(INSTALL_DIR))
endef
INSTALL_FILES_OS = $(subst /,\,$(INSTALL_FILES))
INSTALL_RULE =\
$(foreach file, $(INSTALL_FILES_OS), $(inst_file))
endif
else # bash
INSTALL_RULE =\
@if [ -z $(INSTALL_DIR) ] || [ ! -d $(INSTALL_DIR) ]; \
then \
echo "! Can't install, path not found: '$(INSTALL_DIR)'" 1>&2; \
false; \
else \
for i in $(INSTALL_FILES); \
do \
if [ -r $$i ]; \
then \
echo "! Installing $$i on $(INSTALL_DIR)"; \
$(CP) $$i $(INSTALL_DIR); \
true; \
else \
echo "! Can't install $$i, not found" 1>&2; \
fi \
done \
fi
endif
endif # Empty install list