* Problem with modifying LDFLAGS in Makefile
@ 2001-02-27 2:20 Richard Dybowski
0 siblings, 0 replies; only message in thread
From: Richard Dybowski @ 2001-02-27 2:20 UTC (permalink / raw)
To: gcc-help
I want to run make on the following Makefile:
.SUFFIXES: .pl .cmp
LDFLAGS= -lm # -O2
CFLAGS= -O2 # -O2 -g -pg -f68881
CC= gcc
OBJECTS= main.o plg.o command.o init.o hash.o func.o set.o \
item.o list.o utils.o alloc.o terms.o clause.o lib.o \
integrat.o cost.o bits.o reduce.o sat.o sample.o \
interp.o deduce.o xy.o subsume.o chi.o
SOURCE= main.c plg.c command.c init.c hash.c func.c set.c \
item.c list.c utils.c alloc.c terms.c clause.c lib.c \
integrat.c cost.c bits.c reduce.c sat.c sample.c \
interp.c deduce.c xy.c subsume.c chi.c
progol: $(OBJECTS)
$(CC) $(CFLAGS) $(OBJECTS) -o progol $(LDFLAGS)
mem:
touch item.c init.c plg.c
make progol
count:
wc $(SOURCE)
clean:
-rm -f *.o
I have installed GCC under Linux 2.2.12 using the RPM
egcs-1.1.2-24.i386.rpm, and this has placed the "include" subdirectory at
/usr/i386-glibc20-linux/include and the "lib" subdirectory at
/usr/i386-glibc20-linux/lib. In order to have access to these
subdirectories via the Makefile, I have made the following changes to
LDFLAGS and CFLAGS:
LDFLAGS= -lm -L/usr/i386-glibc20-linux/lib # -O2
CFLAGS= -O2 -I/usr/i386-glibc20-linux/include # -O2 -g -pg -f68881
The modification to CFLAGS has enabled compilation of the OBJECTS to
proceed successfully, but I am still getting the linker error message
/usr/bin/ld: cannot open crt1.o: No such file or directory
collect2: ld returned 1 exit status
even though crt1.o is located in /usr/i386-glibc20-linux/lib
How do I modify the Makefile to enable the linker to proceed?
Richard
BTW: What does # in LDFLAGS and CFLAGS mean? I cannot find a definition
for it in any of my C/C++/Linux textbooks.
-------------------------------
Richard Dybowski, 143 Village Way, Pinner, Middlesex HA5 5AA, UK
Tel (mobile): 079 76 25 00 92
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-02-27 2:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-27 2:20 Problem with modifying LDFLAGS in Makefile Richard Dybowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).