make-w32
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error with make 3.79 on Windows XP


From: DKurhade
Subject: Re: Error with make 3.79 on Windows XP
Date: Fri, 26 Jun 2009 13:08:37 +0530

Hi Eli,

Please take a look at the snippet of the makefile.

s# this is a generic makefile for installing files and directories from
# a source location to a target location. For it to work correctly your
# calling makefile should:
# 1.) define SOURCE as your source root
# 2.) define DEST as your installation root
# 3.) use DIRS_OR_FILES to specify absolute path of files or dirs you
#   want installed at your DEST. Dirs are intalled
#   recursively
# 4.) define INSTALL_LOG. INSTALL_LOG will contain a list of files that
# are installed at DEST
#

###
# make sure necessary variables have been set
###
ifndef SOURCE
  $(error variable SOURCE must be defined)
endif
ifndef DEST
  $(error variable DEST must be defined)
endif
ifndef DIRS_OR_FILES
  $(error variable DIRS_OR_FILES must be defined)
endif
ifndef INSTALL_LOG
  $(error variable INSTALL_LOG must be defined)
endif

# add terminal / to SOURCE and DEST
dir = $(filter %/, $(DEST))
ifneq ($(DEST),  $(dir))
  override DEST := $(DEST)/
endif
dir = $(filter %/, $(SOURCE))
ifneq ($(SOURCE),  $(dir))
  override SOURCE := $(SOURCE)/
endif

ifndef LN
  # symbolic links for UNIX, actual copies on Windows
  #ifeq "$(shell uname)" "Windows_NT"
  LN=cp -f
  #else
  #  LN=ln -s
  #endif
endif

# get list of files that need to be created at DEST
source_dirs:=$(shell find $(DIRS_OR_FILES) -follow -type d -o -type l |
sort)
ifeq "$(shell uname)" "Windows_NT"
  source_files=$(foreach dir, $(source_dirs), $(wildcard $(dir)/*)) $
(DIRS_OR_FILES)
else
  source_files:=$(shell for dir in $(source_dirs); do for file in $$dir/*;
do printf "%s\n" $$file;done ;done | egrep -v '[:]|[*]') $(DIRS_OR_FILES)
# For UNIX we filter list thru "grep -v" to exclude files containing ":" in
# their name from consideration. These files cause make to get syntax
# errors.  The only known source of these files are logfiles created by
# the findmerge command. This problem does not affect NT (and the fix would
# not work on NT either because ":" are a standard part of absolute paths"
# Also if a dir is empty "dir/*" will not be expanded so we need to filter
# out "*" to prevent strange behaviour.
endif

#To copy the .classpath and .project files found in JVI and JDO demos
source_files+=$(foreach dir, $(source_dirs), $(wildcard $(dir)/.*)) $
(DIRS_OR_FILES)

target_files=$(source_files:$(SOURCE)%=$(DEST)%)

# get list of dirs that need to be created at DEST
target_dirs=$(foreach file, $(target_files), $(dir $(file)))
target_dirs:=$(sort $(target_dirs))

# install is default target
install: $(target_dirs) $(INSTALL_LOG)
      @echo $@ done

# create necessary dirs
$(target_dirs):
      mkdir -p $@

# install files by creating symlinks
$(DEST)% : $(SOURCE)%
ifeq "$(shell uname)" "Windows_NT"
      @set -e; if test ! -d $? ; then $(LN) $? $@; echo $@ >> $
(INSTALL_LOG).tmp; fi
else
      @set -e; if test ! -d $? ; then rm -f $@; $(LN) $? $@; echo $@ >> $
(INSTALL_LOG).tmp; fi
endif
      @echo installed $@

# this target is identical to the one above except it accomodates situation
# where dest has a double /
$(DEST)/% : $(SOURCE)%
ifeq "$(shell uname)" "Windows_NT"
      @set -e; if test ! -d $? ; then $(LN) $? $@; echo $@ >> $
(INSTALL_LOG).tmp; fi
else
      @set -e; if test ! -d $? ; then rm -f $@; $(LN) $? $@; echo $@ >> $
(INSTALL_LOG).tmp; fi
endif
      @echo installed $@

# keep track of what files/dirs were installed at INSTALL_LOG file
$(INSTALL_LOG) : $(target_files)
      touch $@
      cat $@ >> $(INSTALL_LOG).tmp
      sort -u $(INSTALL_LOG).tmp > $@
      rm -f $(INSTALL_LOG).tmp


# to uninstall we remove all files listed in INSTALL_LOG
uninstall:
      @set -e ; if test -f $(INSTALL_LOG); then cat $(INSTALL_LOG) | while
read file; do echo rm -f $$file ; rm -f $$file; done ; fi
      rm -f $(INSTALL_LOG)


Here I am calling make LN=cp install

The DIR_OR_FILES have files with long PATH, the target is supposed to
create the DEST and copy DIR_OR_FILES from SOURCE.

Also if this is the problem with windows, FYI the same code works for
Windows2008



Thanks & Regards,
Dhiraj



                                                                                
                                      
  From:       Eli Zaretskii <address@hidden>                                    
                                        
                                                                                
                                      
  To:         address@hidden                                                    
                                
                                                                                
                                      
  Cc:         address@hidden                                                    
                                    
                                                                                
                                      
  Date:       06/26/2009 12:52 PM                                               
                                      
                                                                                
                                      
  Subject:    Re: Error with make 3.79 on Windows XP                            
                                      
                                                                                
                                      





> Cc: address@hidden,
>            address@hidden
> From: address@hidden
> Date: Fri, 26 Jun 2009 10:02:05 +0530
>
> Thanks for you reply, Actually I tried with 3.81 also, it gives same
error.
>
> The error is seen in mkdir, but actually it's due to following list of
> files which were supposed to
> be copied after mkdir command in the newly created directory

Sorry, I don't understand.  Your original report clearly shows that
the mkdir command failed:

    mkdir -p

z:/gui/8.0.0/Windows_NT_32bit/opt/classes/com/versant/vfc/general/images
    process_begin: CreateProcess(E:\PROGRA~1\MKSTOO~1\mksnt\mkdir.exe,
mkdir -p

z:/gui/8.0.0/Windows_NT_32bit/opt/classes/com/versant/vfc/general/images, ...)

     failed.
    make (e=234): More data is available.

Are you saying that the command line that began with "mkdir -p" went
on to copy the long list of files, all on the same command line?  If
not, where does the file copying come into play?

Could you please show the relevant portion(s) of your Makefile, so the
problem could be better understood?

Anyway, the Windows CreateProcess API is documented to have a limit of
32K characters for the command line.  If the command line you are
passing is longer than that, then you are just hitting an OS limit.
Same goes for the size of the environment.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]