diff options
author | tomsmeding <tom.smeding@gmail.com> | 2016-10-07 22:06:29 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2016-10-07 22:06:29 +0200 |
commit | 70a7537584889cf612ddea83eb65fd42818f6e5e (patch) | |
tree | 7d84990995b5d3163b193078058736a46d62b089 /Makefile | |
parent | 241518f369efce64046be36a15fcb722b00e9477 (diff) |
Make code work on Linux and older compilers
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 $@ $< |