diff options
| author | Přemysl Eric Janouch <p@janouch.name> | 2026-01-03 07:25:39 +0100 |
|---|---|---|
| committer | Přemysl Eric Janouch <p@janouch.name> | 2026-01-03 08:07:16 +0100 |
| commit | 0407c2abce01a2e94ecfa6f3a8ec4e247bae2c60 (patch) | |
| tree | cecc46c70414668e833df336f96c62ed35d47745 | |
| parent | 0a3224dd96df8e526fac6ffe9127363781e2e281 (diff) | |
| download | sdn-0407c2abce01a2e94ecfa6f3a8ec4e247bae2c60.tar.gz sdn-0407c2abce01a2e94ecfa6f3a8ec4e247bae2c60.tar.xz sdn-0407c2abce01a2e94ecfa6f3a8ec4e247bae2c60.zip | |
Tune up the static build rule
| -rw-r--r-- | Makefile | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -7,13 +7,20 @@ CPPFLAGS = `sed -ne '/^project (\([^ )]*\) VERSION \([^ )]*\).*/ \ 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++ \ + -static -lacl `pkg-config --static --libs --cflags ncursesw` + +# Works for Debian derivatives and Alpine, resulting in only a libc dependency. +sdn-portable: sdn.cpp CMakeLists.txt + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $< -o $@ \ + -static-libstdc++ -static-libgcc \ -Wl,--start-group,-Bstatic \ -lacl `pkg-config --static --libs --cflags ncursesw` \ -Wl,--end-group,-Bdynamic + clean: - rm -f sdn sdn-static + rm -f sdn sdn-static sdn-portable .PHONY: clean |
