help-make
[Top][All Lists]
Advanced

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

make loosing value of variable set by shell command


From: Spilker, Jörg
Subject: make loosing value of variable set by shell command
Date: Tue, 3 Feb 2004 15:29:07 +0100

Hello,

maybe you can help me with the following strange problem. When compiling
some Informix 4GL code, i want to give the full path of the source module to
the compiler (reason is that we have source code with same file names in
different modules and error reports from informix only show the file name
which doesn´t really help when the module name is not know). So i used the
shell command to get the current working dir and changed command lines to
build the target as follows:

 

VPATH=../OBJ:../C.SRC:.

curdir := $(shell pwd)

 

glsrc:=                         $(patsubst %.4gl,%.o,$(wildcard *.4gl))

csrc:=                          $(patsubst ../C.SRC/%.c,%.o,$(wildcard
../C.SRC/*.c))               
 

all:                            ../../bin/libGLOB.so

 

../../bin/libGLOB.so:           $(glsrc) $(csrc)

                                $(CC) -shared -expect_unresolved '*' -o $@
$(addprefix ../OBJ/, $(glsrc) $(csrc))

 

$(glsrc): %.o: %.4gl            ../GO_P_GLOBALS.M/g_globals.4gl

                                $(C4GL) -o ../OBJ/$@ $(CCDEFS) $(curdir)/$<

 

$(csrc): %.o: %.c

                                $(CC) -o ../OBJ/$@ $(CCDEFS) $(curdir)/$<

 

.PHONY: clean

clean:

                                -rm -f $(addprefix ../OBJ/,$(glsrc) $(csrc))

However something strange happened:

 c4gl -o ../OBJ/m_afa_sperre.o -c -a -pthread -compress -localcurs -shared
-arch host -taso -w1 -std1
 -I/usr/informix/incl -I/usr/informix/incl/tools -I/usr/informix/incl/esql
-DR4 /work/cvsbuild/4GL_i
nvekos_alt/GO_L_GLOBLIB.M/4GL.SRC/m_afa_sperre.4gl

c4gl -o ../OBJ/m_aktion.o -c -a -pthread -compress -localcurs -shared -arch
host -taso -w1 -std1 -I/
usr/informix/incl -I/usr/informix/incl/tools -I/usr/informix/incl/esql -DR4
/work/cvsbuild/4GL_invek
os_alt/GO_L_GLOBLIB.M/4GL.SRC/m_aktion.4gl

c4gl -o ../OBJ/m_alb.o -c -a -pthread -compress -localcurs -shared -arch
host -taso -w1 -std1 -I/usr
/informix/incl -I/usr/informix/incl/tools -I/usr/informix/incl/esql -DR4
/work/cvsbuild/4GL_invekos_
alt/GO_L_GLOBLIB.M/4GL.SRC/m_alb.4gl

c4gl -o ../OBJ/m_anrede.o -c -a -pthread -compress -localcurs -shared -arch
host -taso -w1 -std1 -I/
usr/informix/incl -I/usr/informix/incl/tools -I/usr/informix/incl/esql -DR4
/work/cvsbuild/4GL_invek
os_alt/GO_L_GLOBLIB.M/4GL.SRC/m_anrede.4gl

c4gl -o ../OBJ/m_anteil.o -c -a -pthread -compress -localcurs -shared -arch
host -taso -w1 -std1 -I/
usr/informix/incl -I/usr/informix/incl/tools -I/usr/informix/incl/esql -DR4
/m_anteil.4gl

for some strange reason the value of curdir is lost. GNU make is running on
OSF1 V4.0 1229 alpha alpha unknown Tru64 and compiled freshly from sources.
Help is greatly appreciated.

Greetings, Joerg                          




reply via email to

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