From 70a7537584889cf612ddea83eb65fd42818f6e5e Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Fri, 7 Oct 2016 22:06:29 +0200 Subject: Make code work on Linux and older compilers --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Makefile') 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 $@ $< -- cgit v1.2.3-70-g09d2