summaryrefslogtreecommitdiffhomepage
path: root/src/Makefile
diff options
context:
space:
mode:
authorRoland Reichwein <rr@reichwein.it>2018-02-28 09:35:07 +0100
committerRoland Reichwein <rr@reichwein.it>2018-02-28 09:35:07 +0100
commitbc9181917182e27324ff0437cf0d10abd91fa581 (patch)
tree4c3141f0ab45235fc7bc2492f5090a96b3f11dfe /src/Makefile
parent1fb8bf91a6a796c307e31338cc9b850c41d6dd6d (diff)
Compatibility for different build OSes
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Makefile b/src/Makefile
index 0a8ab19..482e986 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,16 +1,18 @@
ARCH=$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
TARGET=query
-CPPFLAGS=-Wall -O2 -fPIC -std=gnu++17 -I/usr/include/$(ARCH)/qt5 -I/usr/include/$(ARCH)/qt5/QtCore
-LDFLAGS=-Wall -O2 -fPIC -std=gnu++17 -lstdc++ -lfcgi -lQt5Core
+# gnu++17 since gcc 5
+STANDARD=$(shell g++ -std=gnu++17 -E -x c++ - < /dev/null > /dev/null 2>/dev/null && echo "-std=gnu++17" || echo "-std=gnu++14")
+CPPFLAGS=-Wall -O2 $(STANDARD) -fPIC -I/usr/include/$(ARCH)/qt5 -I/usr/include/$(ARCH)/qt5/QtCore
+LDFLAGS=-Wall -O2 $(STANDARD) -fPIC -lstdc++ -lfcgi -lQt5Core
OBJS=webbox.o
all: $(TARGET)
$(TARGET): $(OBJS)
- gcc $(LDFLAGS) -o $@ $^
+ g++ $(LDFLAGS) -o $@ $^
%.o: %.cpp
- gcc $(CPPFLAGS) -c -o $@ $<
+ g++ $(CPPFLAGS) -c -o $@ $<
clean:
-rm -rf $(TARGET) $(OBJS)