diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1,3 +1,5 @@ +# references: +# BUILD_DIR and per-.cpp file https://spin.atomicobject.com/2016/08/26/makefile-c-projects/ awkbin :=$(shell which awk) cpbin :=$(shell which cp) echobin :=$(shell which echo) @@ -20,13 +22,15 @@ LDFLAGS = -g src = $(wildcard *.cpp) obj = $(src:.cpp=.o) -OUTEXE = helloworld +BUILD_DIR ?= . + +OUTEXE = mine all: $(OUTEXE) -# compile -$(obj): $(src) - $(CXX) -c $(CXXFLAGS) $< +# compile, which is not actually used? +$(BUILD_DIR)%.o: %.cpp + $(CXX) -c $(CXXFLAGS) $+ # link $(OUTEXE): $(obj) |