I have seen the given two makefiles as follows:
all: thread1 thread2 thread3
CFLAGS=-I/usr/include/nptl -D_REENTRANT
LDFLAGS=-L/usr/lib/nptl -lpthread
clean:
rm -f thread1 thread2 thread3
######################
all: thread1 thread2 thread3
CFLAGS=-D_REENTRANT
LDFLAGS=-lpthread
clean:
rm -f thread1 thread2 thread3
Without using makefile, what is the correct command line to compile the thread1.c with gcc?
gcc -o thread1 CFLAGS=-I/usr/include/nptl -D_REENTRANT LDFLAGS=-L/usr/lib/nptl -lpthread thread1.c
-I
and-L
flags or not? That's not something anyone here can answer for you. – Howells