Some SlackBuild scripts for Slackware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
1.9 KiB

diff --git a/.gitignore b/.gitignore
index 8632252..b33bda3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,8 @@ lib
*.swp
*.swo
tmux-*.log
+native-src/zxcvbn/*.o
+native-src/zxcvbn/*.so
+native-src/zxcvbn/_frequency_lists.?pp
+native-src/zxcvbn/adjacency_graphs.?pp
+
diff --git a/native-src/zxcvbn/Makefile b/native-src/zxcvbn/Makefile
new file mode 100644
index 0000000..279c802
--- /dev/null
+++ b/native-src/zxcvbn/Makefile
@@ -0,0 +1,70 @@
+CXX = g++
+CXXFLAGS = -c -std=c++14 -Wall -Wextra -fPIC
+CPPFLAGS = -I..
+
+ifeq ($(DEBUG),yes)
+ CXXFLAGS += -g -O0
+else
+ CXXFLAGS += -O2
+ CPPFLAGS += -DNDEBUG
+endif
+
+PREFIX = /usr/local
+LIBDIR = $(PREFIX)/lib
+INCLUDEDIR = $(PREFIX)/include
+
+LIBRARY = libzxcvbncpp.so
+
+SCRIPTS_DIR = ../../data-scripts
+DATA_DIR = ../../data
+
+OBJS = _frequency_lists.o \
+ adjacency_graphs.o \
+ feedback.o \
+ frequency_lists.o \
+ matching.o \
+ scoring.o \
+ time_estimates.o \
+ util.o \
+ zxcvbn.o
+
+HEADERS = _frequency_lists.hpp \
+ adjacency_graphs.hpp \
+ common.hpp \
+ feedback.hpp \
+ frequency_lists.hpp \
+ frequency_lists_common.hpp \
+ matching.hpp \
+ optional.hpp \
+ scoring.hpp \
+ time_estimates.hpp \
+ util.hpp \
+ zxcvbn.h
+
+$(LIBRARY): $(OBJS)
+ $(CXX) -shared -Wl,-soname,$(LIBRARY) -o $(LIBRARY) $(OBJS)
+
+_frequency_lists.cpp:
+ $(SCRIPTS_DIR)/build_frequency_lists.py $(DATA_DIR) $@
+
+_frequency_lists.hpp:
+ $(SCRIPTS_DIR)/build_frequency_lists.py $(DATA_DIR) $@
+
+adjacency_graphs.cpp:
+ $(SCRIPTS_DIR)/build_keyboard_adjacency_graphs.py $@
+
+adjacency_graphs.hpp:
+ $(SCRIPTS_DIR)/build_keyboard_adjacency_graphs.py $@
+
+%.o: %.cpp $(HEADERS)
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
+
+install: $(LIBRARY)
+ install -s -m 755 -D $(LIBRARY) $(DESTDIR)$(LIBDIR)/$(LIBRARY)
+ mkdir -p $(DESTDIR)$(INCLUDEDIR)/zxcvbn
+ install -m 644 $(HEADERS) $(DESTDIR)$(INCLUDEDIR)/zxcvbn
+
+clean:
+ rm -f $(OBJS)
+
+.PHONY: clean