aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authortomsmeding <hallo@tomsmeding.nl>2015-05-21 09:51:07 +0200
committertomsmeding <hallo@tomsmeding.nl>2015-05-21 09:51:07 +0200
commit648a47211578617d228c22fac44b1ccc1f8f521d (patch)
treeac25ad470f01140ab959608b500b3d1af83fb488 /Makefile
parentce356164bac0f739fea97b8bee61c066b9f2ae87 (diff)
FindQuery
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile33
1 files changed, 13 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 381b573..acef217 100644
--- a/Makefile
+++ b/Makefile
@@ -1,30 +1,23 @@
-CC=gcc
-CXX=g++
-CFLAGS=-Wall -O2
-CPPFLAGS=-Wall -O2 -std=c++11
+CXXFLAGS = -Wall -O2 -std=c++11
+CXX = g++
-BINARIES=engine
-OBJS=enginedata.o util.o
-DEPFILES=$(OBJS:.o=.d)
+BINARIES = engine
+CXX_FILES = $(shell echo *.cpp)
+H_FILES = *.h
+OBJ_FILES = $(CXX_FILES:.cpp=.o)
-
-.PHONY: all clean
+.PHONY: all clean remake
all: $(BINARIES)
clean:
- rm -f $(BINARIES) $(OBJS) $(DEPFILES)
-
-
--include $(OBJS:.o=.d)
-
+ rm -f $(BINARIES) $(OBJ_FILES)
-engine: engine.cpp enginedata.o util.o
- $(CXX) $(CPPFLAGS) -o $@ $^
+remake: clean all
-enginedata: enginedata.cpp enginedata.h util.o
- $(CXX) $(CPPFLAGS) -o %@ enginedata.cpp
+engine: $(OBJ_FILES)
+ $(CXX) $(CXXFLAGS) -o $@ $(OBJ_FILES)
+ strip $@
%.o: %.cpp %.h
- $(CXX) $(CPPFLAGS) $*.cpp -c -o $*.o
- $(CXX) -MM $(CPPFLAGS) $*.cpp > $*.d
+ $(CXX) $(CXXFLAGS) -c -o $*.o $*.cpp