aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/nrvo_by_default/Makefile
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-10-25 05:25:12 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-10-25 05:25:12 +0300
commit4c0f75c2f634803d325f18df5f5a90f35905e3cc (patch)
tree1f7bd45aa827c74745f319b55adb0e4015413845 /nrvo_by_default/Makefile
parentfix license text (diff)
downloadblog-4c0f75c2f634803d325f18df5f5a90f35905e3cc.tar.gz
blog-4c0f75c2f634803d325f18df5f5a90f35905e3cc.zip
add nrvo_by_default/
Diffstat (limited to '')
-rw-r--r--nrvo_by_default/Makefile26
1 files changed, 26 insertions, 0 deletions
diff --git a/nrvo_by_default/Makefile b/nrvo_by_default/Makefile
new file mode 100644
index 0000000..f9fd487
--- /dev/null
+++ b/nrvo_by_default/Makefile
@@ -0,0 +1,26 @@
+# Builds rvo.cpp on various optimization levels supported by GCC.
+# The compiler is `g++` by default.
+# You can change the compiler to be used using the CXX variable.
+# For example, if you want to compile using `x86_64-w64-mingw32-g++`, run
+#
+# > make CXX=x86_64-w64-mingw32-g++
+
+CXXFLAGS = -Wall -Wextra -DNDEBUG -std=c++11 -static-libgcc -static-libstdc++ -s
+
+optimization_levels = 0 1 2 3
+
+all::
+
+define make_target
+rvo.$(CXX).O$(1).exe: rvo.cpp
+ $(CXX) $(CXXFLAGS) -O$(1) $$< -o $$@
+
+all:: rvo.$(CXX).O$(1).exe
+endef
+
+$(foreach i,$(optimization_levels),$(eval $(call make_target,$(i))))
+
+.PHONY: clean-all
+
+clean-all:
+ $(RM) $(wildcard rvo.$(CXX).*.exe)