I am trying to create a makefile for my project, but while running it I am getting an error like:
make: Circular database.cpp <- database.cpp dependency dropped
make: database.cpp' is up to date.
Here is my Makefile:
HEADERFILES = $(wildcard *.h)
CPPFILES = $(wildcard *.cpp)
OBJFILES = $(patsubst %.cpp ,%.o ,$(wildcard *.cpp))
$(OBJFILES): $(CPPFILES) $(HEADERFILES)
g++ -c -o $(OBJFILES) $(CPPFILES)
ar rvs libdatabase.a $(OBJFILES)
I have only one .cpp
and .h
file. Please someone correct it.