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?

xercool
  • 883
  • 1
  • 8
  • 24

0 Answers0