kjuliff@xxxxxxxxx schrieb:
Can someone tell me why the second object file in the code never gets
made?
I have only two to link.
What do you want?
How do you call make?
But whatever I complile second does not get made. No errors occur till
inkage.
In the example below, print_error will not compile - it is ignored. If
I change the order ity is compiled but the other file is not.
C=cc -m32 -B/usr/lib/i386-redhat-linux3E/lib/
INSTALLPATH=/usr/local
EXTRALIBS=-lesrpc -lessupp -lesextra
LDPATH=-L ${INSTALLPATH}/easysoft/lib
-L${INSTALLPATH}/easysoft/oob/client -L${I
NSTALLPATH}/easysoft/unixODBC/lib
missing \
INCPATH=${INSTALLPATH}/easysoft/oob/client/include
OBJS=readisam.o print_error.o
CFLAGS=-g -I${INCPATH}
all : print_error readisam
readisamfile
This is almost certainly not what you want.
readisam: readisam.o
${CC} ${CFLAGS} -o readisam readisam.o ${LDPATH} \
-lesoobclient ${EXTRALIBS}
print_error: print_error.o
${CC} ${CFLAGS} -o print_errorprint_error.o ${LDPATH} \
You are missing a space here. If this is just typed from memory:
Don't. Give us a working example.
-lesoobclient ${EXTRALIBS}
readisamfile: readisam.o print_error.o
What do you define OBJS for?
${CC} ${CFLAGS} -o readisamfile ${OBJS) ${LDPATH} \
-lodbc
Where is your rule to obtain .o from .c?
It is not clear to me what you want to do.
Another question: Why you write down some things explicitly
that you can get automatically?
Consider:
foo : ${OBJS}
${CC} $(CFLAGS) -o $@ $^
Have a look at
http://www.gnu.org/software/make/manual/make.html
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
|