aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2016-10-07 22:06:29 +0200
committertomsmeding <tom.smeding@gmail.com>2016-10-07 22:06:29 +0200
commit70a7537584889cf612ddea83eb65fd42818f6e5e (patch)
tree7d84990995b5d3163b193078058736a46d62b089 /Makefile
parent241518f369efce64046be36a15fcb722b00e9477 (diff)
Make code work on Linux and older compilers
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 14220de..5778290 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,14 @@
CXX = g++
-CXXFLAGS = -Wall -Wextra -std=c++11 -fwrapv
+CXXFLAGS = -Wall -Wextra -std=c++0x -fwrapv
+LDFLAGS =
ifneq ($(DEBUG),)
CXXFLAGS += -g
else
CXXFLAGS += -O2
endif
+ifeq ($(shell uname),Linux)
+ LDFLAGS += -lbsd
+endif
BIN = main
.PHONY: all clean remake
@@ -18,7 +22,7 @@ remake: clean all
$(BIN): $(patsubst %.cpp,%.o,$(wildcard *.cpp))
- $(CXX) -o $@ $^
+ $(CXX) -o $@ $^ $(LDFLAGS)
%.o: %.cpp $(wildcard *.h)
$(CXX) $(CXXFLAGS) -c -o $@ $<