0

I'm trying to compile the whole folder with gcc.

Made some makefile (partially copied from different sources).

So I have my project root directory and I need to compile all the C files inside root dir. Makefile configuration:

all: server

CC = gcc
LDFLAGS = -lmysqlclient -lwebsockets
CFLAGS= -Wall -g

src = $(wildcard *.c)
obj = $(src:.c=.o)

server: $(obj)
    $(CC) -o $@ $^ $(LDFLAGS)
clean:
    rm -f build/server
    rm -rf build/server.dSYM

The error is:

Makefile:11: *** missing separator. Stop.

What am I doing wrong?

featureoffuture
  • 783
  • 1
  • 7
  • 22

0 Answers0