I need help creating a Makefile.
My files:
g.c
v.h
v.c
main() is inside g.c, which includes v.h
My Makefile looks like this:
all: bin/v bin/g
bin/v: v.c
cc v.c -o bin/v -Wall
bin/g: g.c
cc g.c -o bin/g -D_REENTRANT -lpthread -Wall
PHONY: all
When running make all, I get tons of errors:
relocation X has invalid symbol index Y
followed by
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main' collect2: error: ld returned 1 exit status
What should my Makefile look like?
Thanks in advance!