tags:

views:

39

answers:

1

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)
+1  A: 

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)
Beta