Makefile Error


2 posts
by karrotsrkool » Wed Aug 01, 2012 4:09 pm
Hi, I'm relatively new to make files and this is really bugging me, to be quick about it, here is the code:
Code: Select all
# Straight forward Makefile to compile all examples in a row

# If cross-compiling, you may wish to set the following environment variable to the root location of
# your 'sdk'
# SDKSTAGE=/home/foo/raspberrypi

INCDIR=-I./Common -I$(SDKSTAGE)/opt/vc/include -I$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads
LIBS=-lGLESv2 -lEGL -lm -lbcm_host -L$(SDKSTAGE)/opt/vc/lib

CFLAGS+=-DRPI_NO_X

# CFLAGS+=-DRPI_NO_X -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -ftree-vectorize -pipe -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM -Wno-psabi -I$(SDKSTAGE)/opt/vc/include/ -I./ -I$(SDKSTAGE)/opt/vc/lib



COMMONSRC=./Common/esShader.c    \
          ./Common/esTransform.c \
          ./Common/esShapes.c    \
          ./Common/esUtil.c
COMMONHRD=esUtil.h

CH02SRC=./main.c

default: all

all: main.c

clean:
   find . -name "CH??_*" | xargs rm -f

main.c: ${COMMONSRC} ${COMMONHDR} ${CH02SRC}
   gcc $(CFLAGS) ${COMMONSRC} ${CH02SRC} -o ./$@ ${INCDIR} ${LIBS}

and the error I keep getting is:
make: Circular main.c <- main.c dependency dropped.
make: Nothing to be done for `default'.
I honestly have no idea so any help would be nice.
Thanks in advance.
Posts: 23
Joined: Sun Jul 29, 2012 9:47 pm
by karrotsrkool » Wed Aug 01, 2012 7:08 pm
Worked it out, needed to change a main.c to main.o.
Posts: 23
Joined: Sun Jul 29, 2012 9:47 pm