help-make
[Top][All Lists]
Advanced

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

Problems with empty macros.


From: Malayambakkam, Ravi [IT]
Subject: Problems with empty macros.
Date: Fri, 19 Sep 2003 10:32:31 -0400

Hi,

I am using the follwoing makefile.  What the makefile is trying to do is to
read the contents from the 2nd line of the 
file filename.dat.  The file basically contains a list of file objects.  The
install target is trying to move the 
files to the install directory.  I am having a problem when the file
filename.dat is empty.  SRC_FILES macro now
becomes null and the install target is failing for the cp command.

Could you pls tell me if there is any fix for this.  I cannot add any dummy
entry in the file filename.dat.

Thank you,

Ravi Malayambakkam.


FILELIST = filename.dat

FILES = tail +2 $(FILELIST)

all install install_MtrxDDL get_files := SRC_FILES = $(FILES:sh)

install: install_target1

install_target1: $(SRC_FILES)
        $(INS)  -d  -o $(OWNER) -g $(GROUP) -m 755 $$i $(INSDIR)/target1/
        for i in $(SRC_FILES) ; \
        do \
                echo "Installing $$i"; \
                cp -p $$i $(INSDIR)/target1 \; ; \
                chmod 644 $(INSDIR)/target1/$$i; \
        done




reply via email to

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