Compare commits
2 Commits
77973fc026
...
1318c4983f
Author | SHA1 | Date | |
---|---|---|---|
1318c4983f | |||
c503954f44 |
21
Makefile
21
Makefile
@ -1,12 +1,19 @@
|
|||||||
|
.POSIX:
|
||||||
SHELL = /bin/sh
|
SHELL = /bin/sh
|
||||||
CXXFLAGS = -g -std=c++14 -Wall -Wextra -pedantic -static-libstdc++
|
CXXFLAGS = -g -std=c++14 -Wall -Wextra -pedantic
|
||||||
|
CPPFLAGS = `sed -ne 's/^project (\([^ )]*\).*/-DPROJECT_NAME="\1"/p' \
|
||||||
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`
|
-e 's/^set (version \([^ )]*\).*/-DPROJECT_VERSION="\1"/p' CMakeLists.txt`
|
||||||
|
|
||||||
|
sdn: sdn.cpp CMakeLists.txt
|
||||||
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $< -o sdn \
|
||||||
|
-lacl `pkg-config --libs --cflags ncursesw`
|
||||||
|
static: sdn.cpp CMakeLists.txt
|
||||||
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $< -o sdn \
|
||||||
|
-static-libstdc++ \
|
||||||
|
-Wl,--start-group,-Bstatic \
|
||||||
|
-lacl `pkg-config --static --libs --cflags ncursesw` \
|
||||||
|
-Wl,--end-group,-Bdynamic
|
||||||
clean:
|
clean:
|
||||||
rm -f sdn
|
rm -f sdn
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: static clean
|
||||||
|
7
sdn.cpp
7
sdn.cpp
@ -353,13 +353,6 @@ fun print (const ncstring &nc, int limit) -> int {
|
|||||||
return total_width;
|
return total_width;
|
||||||
}
|
}
|
||||||
|
|
||||||
fun compute_width (const wstring &w) -> int {
|
|
||||||
int total = 0;
|
|
||||||
for (const auto &c : w)
|
|
||||||
total += wcwidth (c);
|
|
||||||
return total;
|
|
||||||
}
|
|
||||||
|
|
||||||
fun compute_width (const ncstring &nc) -> int {
|
fun compute_width (const ncstring &nc) -> int {
|
||||||
int total = 0;
|
int total = 0;
|
||||||
for (const auto &c : nc)
|
for (const auto &c : nc)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user