Reputation: 55469
Instead of executable code all it does is create files that don't do anything, even if the files are made executable.
TARGETS = load list show add delete btree
all: $(TARGETS)
%: %.cpp
g++ $< -g -o $@ -MM -MF [email protected]
sed "s/$@\.o:/$@:/" [email protected] > [email protected]
-@rm [email protected]
DEPS=$(TARGETS:%=%.d)
-include $(DEPS)
Upvotes: 0
Views: 176
Reputation: 99084
You are running g++ with the -MM
option, to create the dependency file. But this option causes g++ to write a dependency file instead of a binary.
Try this:
TARGETS = load list show add delete btree
all: $(TARGETS)
%: %.cpp
g++ $< -g -o $@
g++ $< -g -MM -MF [email protected]
sed "s/$@\.o:/$@:/" [email protected] > [email protected]
-@rm [email protected]
DEPS=$(TARGETS:%=%.d)
-include $(DEPS)
Upvotes: 1