I am trying to run a makefile that compiles these 'C' programs at the same time.
CC=gcc
CFLAGS=-I.
DEPS = queue.h
all: \threadss
threadss: thread.o queueImp.o
$(CC) thread.o queueImp.o -o threadss
thread.o: thread.c
$(CC) $(CFLAGS) threads.c
thread.o: queueImp.c
$(CC) $(CFLAGS) queueImp.c
clean:
rm -rf *o threadss
However the following error is returned:
Makefile:8: *** missing separator. Stop.
Please help me to solve this. I am using the unix environment.
Means that the makefile contains spaces instead of Tab's. The make utility is notoriously picky about the use of Space instead of Tab . So it's likely that the makefile contains Space at the beginning of rule stanzas within the file.
makefile needs a tab
before every command of a rule. Make sure there is a tab
[not spaces] before $(CC) thread.o queueImp.o -o threadss
and other commands.
Note: Usually, the clean command is used to remove object files having .o
extensions. maybe what you want is
rm -rf *.o threadss
^
|
to serve the actual purpose.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With