How to fix this Makefile -


Instead of executable code, it is creating everything that does not do anything, even if the file is executable.

  TARGETS = Show list show delete delete btree all: $ (TARGETS)%:% .cpp g ++ $ & lt; -G-O $ @ -mm-mf $ @ DD sed "s / $ @ \. O: / $ @: /" $ @ DD " $ @ D - @ RM $ @ DD DEPS = $ (TARGETS:% =%. D) - Include $ (DEPS)  

You are running G ++ with the -MM option to create a dependency file, but this option G ++ is the binary instead of Dependency causes the reason for writing the file.

Try this:

  TARGETS = load list show add delete btree all: $ (TARGETS)%:% .cpp G ++ $ & lt; -G-O $ @ G ++ $ & lt; -G-MM-MF $ @ DD sed "s / $ @. O: / $ @: /" $ @ dd & gt; $ @ D - @ RM $ @ DD DEPS = $ (TARGETS:% =%. D) - $ (DEPS)  

Comments