i need help with my makefile. This is my first time dealing with one.I have ,ll.C and main.C, and one header file called ll.h
main.C has the header file ll.h included and some other libraries
ll.C has the header file also.
and when i compile it i get this error:
g++ -c -g -Wall ll.C
g++ -g -Wall -o mylink ll.o -L. -lm
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [mylink] Error 1
and this is my makefile
###################################
#
###################################
CC = g++
CFLAGS = -g -Wall
LIB = -lm
LDFLAGS = -L.
PROG = mylink
OBJ = main.o
OBJ = ll.o
SRC = main.C
SRC = ll.C
all : $(PROG)
$(PROG): $(OBJ)
$(CC) -c $(CFLAGS) $(SRC)
$(CC) $(CFLAGS) -o $(PROG) $(OBJ) $(LDFLAGS) $(LIB)
# cleanup
clean:
/bin/rm -f *.o $(PROG)
any help on how to fix this? and i do have a main function on main.C.