LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   URGENT: help with Makefile (https://www.linuxquestions.org/questions/linux-software-2/urgent-help-with-makefile-136734/)

rmhaddad 01-20-2004 11:41 AM

URGENT: help with Makefile
 
Hello all,

I have this Makefile (see the bottom of this message) that works fine in Unix, but is giving me problems in Linux. The message that I keep getting is:

/home/informix/bin/esql -O -o DbUpdate_inf -I. -I/home/informix/incl/esql -I/homes/rogerh/dbupdate/inflib/rel6.1 main.o error.o inf/DbUpdate.o inf/db_err.o inf/DbUpdate_6.o inf/create_procedure.o -L /homes/rogerh/dbupdate/inflib/rel6.1 -ldb_genlib -lm
/usr/bin/ld: cannot find -ldb_genlib
collect2: ld returned 1 exit status
make: *** [linux] Error 1


Although db_genlib.a is found in ${IDSDBLIB}/inflib/rel6.1
(IDSDBLIB is defined, verified and all that. ls -l ${IDSDBLIB}/inflib/rel6.1/db_genlib.a produces the right file with read/write permissions to all).
And it's driving me nuts.. I tried copying the library (db_genlib.a) to the current directory and typing -l./db_genlib, still didn't work. Tried all combinations (db_genlib, db_genlib.a).

What is missing here?!

Thank you so much!!!
RH


EXEC_PATH=/home/rmhaddad/work/bin
ESQLC = ${INFORMIXDIR}/bin/esql
GCC = cc

INC = -I. -I${INFORMIXDIR}/incl/esql -I${IDSDBLIB}/inflib/rel6.1
INF_DB_LIB = -L ${IDSDBLIB}/inflib/rel6.1 -ldb_genlib -lm

FLAGS = -O

.SUFFIXES:
.SUFFIXES: .ec .c .o

.ec.c:
@echo
${ESQLC} $(FLAGS) -e $(INC) $*.ec
mv `basename $*.c` $*.c
@echo

.c.o:
@echo
${GCC} $(SP_FLG) -c $(FLAGS) $(INC) $< -o $*.o
@echo

C_FILES = main.c error.c
EC_FILES = inf/DbUpdate.ec inf/db_err.ec inf/DbUpdate_6.ec inf/create_procedure.ec
INF_O_FILES = $(C_FILES:.c=.o) $(EC_FILES:.ec=.o)
INF_TMP_FILES = $(EC_FILES:.ec=.c)

H_FILES = error.h db_err.h DbUpdate_proto.h

INF_PROG = DbUpdate_inf

default: linux

linux: $(INF_TMP_FILES) $(H_FILES) $(INF_O_FILES)
$(ESQLC) $(FLAGS) $(SP_FLG) -o $(INF_PROG) $(INC) $(INF_O_FILES) $(INF_DB_LIB)
chatr +s enable +b disable $(INF_PROG) > /dev/null 2>&1

clean: clean_inf clean_ora
\rm -f *.jnk *.log core
\rm -f $(INF_PROG) $(INF_O_FILES) $(INF_TMP_FILES)

rmhaddad 01-20-2004 12:37 PM

Found the problem in the gcc man page. The library name should be prefix with 'lib'.

So if you have a line: -ldb_genlib

the the filename should be: libdb_genlib.a

Thanks to all!
RH


All times are GMT -5. The time now is 06:35 PM.