aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 15 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 84ead83..0468a72 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,19 @@
+.POSIX:
SHELL = /bin/sh
-CXXFLAGS = -g -std=c++14 -Wall -Wextra -pedantic -static-libstdc++
+CXXFLAGS = -g -std=c++14 -Wall -Wextra -Wno-misleading-indentation -pedantic
+CPPFLAGS = `sed -ne '/^project (\([^ )]*\) VERSION \([^ )]*\).*/ \
+ s//-DPROJECT_NAME="\1" -DPROJECT_VERSION="\2"/p' CMakeLists.txt`
-all: sdn
-%: %.cpp CMakeLists.txt
- $(CXX) $(CXXFLAGS) $< -o $@ `pkg-config --libs --cflags ncursesw` -lacl \
- `sed -ne 's/^project (\([^ )]*\).*/-DPROJECT_NAME="\1"/p' \
- -e 's/^set (version \([^ )]*\).*/-DPROJECT_VERSION="\1"/p' CMakeLists.txt`
+sdn: sdn.cpp CMakeLists.txt
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) $< -o $@ \
+ -lacl `pkg-config --libs --cflags ncursesw`
+sdn-static: sdn.cpp CMakeLists.txt
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) $< -o $@ \
+ -static-libstdc++ \
+ -Wl,--start-group,-Bstatic \
+ -lacl `pkg-config --static --libs --cflags ncursesw` \
+ -Wl,--end-group,-Bdynamic
clean:
- rm -f sdn
+ rm -f sdn sdn-static
-.PHONY: all clean
+.PHONY: clean