So I created a rule to convert all .c files to .o files. I used variable $ to place the right hand side of the rule into the recipe. The left hand side is ok with $@, but the right hand side is empty. I remember I did a similar Makefile with $, and it worked.
CFLAGS =-c -g
all:server client
server:server.o
gcc -o server server.o
client:client.o
gcc -o client client.o
clean:
rm *.o server client
%.o:%.c
gcc ${CFLAGS} -o $@ $
server.o : server.c
client.o : client.c
Should be
$<, not simply$. Seeinfo "(make) Automatic Variables".