Hi
I think the way in which you are referring the dependencies it's not right.
You can try this and check
******************************************
PROGRAM = Astar
DEPENDENCIES = Maze.o Maze.h
all: $(PROGRAM)
%.o : %.cc %.h
g++ -c $<
$(PROGRAM): $(DEPENDENCIES)
g++ Maze.o Astar.cc -o $(PROGRAM)
clean:
rm *.o $(PROGRAM)
********************************************
-SG
On Fri, Oct 3, 2008 at 11:30 AM, parth <[EMAIL PROTECTED]> wrote:
>
> Hello guys,
>
> I have create a simple makefile as below.
>
> But Whenever i execute make command, it doesn't check if any of the files
> have modified time greater that the object file's creation time and just
> recompiles the all target.
> I have to do make clean everytime I want the Maze.cc to recompile
>
> ******************************************
> PROGRAM = Astar
> DEPENDENCIES = Maze.o Maze.h
>
> all: $(DEPENDENCIES) $(PROGRAM).cc
> g++ Maze.o Astar.cc -o $(PROGRAM)
>
> %.o : %.cc %.h
> g++ -c $<
>
> clean:
> rm *.o $(PROGRAM)
> ********************************************
>
> Can anyone tell me where am I making a mistake?
>
> regards,
> parth
>
>
>
> --
> View this message in context:
> http://www.nabble.com/how-to-make-%22gmake%22-recompile-the-files-based-on-their-dependencies%27-modified-time-tp19792569p19792569.html
> Sent from the Gnu - Make - Help mailing list archive at Nabble.com.
>
>
>
> _______________________________________________
> Help-make mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/help-make
>
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make