I am trying to compile a GTK+ example using make, but when I run it, the terminal says "make: *** No rule to make target 'all'. Stop."
However, when I compile by typing the following, it compiles successfully.
gcc -g -Wall -o exampleapp main.c exampleapp.c exampleapp.h exampleappwin.c exampleappwin.h -export-dynamic `pkg-config --cflags --libs gtk+-3.0`
Here's what I put in my make file:
NAME=exampleapp
CFLAGS=-g -Wall -o $(NAME)
GTKFLAGS=-export-dynamic `pkg-config --cflags --libs gtk+-3.0`
SRCS= \
main.c \
exampleapp.c exampleapp.h \
exampleappwin.c exampleappwin.h
CC=gcc
all: main
main: $(SRCS)
$(CC) $(CFLAGS) $(SRCS) $(GTKFLAGS)
clean:
/bin/rm -f $(NAME)
Is something wrong with my make file? If so, how can I correct it?