1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
CXXFLAGS = -O -g
CFLAGS = -O -g
ASPELL_WRAP = # valgrind
export ASPELL = ${CURDIR}/inst/bin/aspell
export PREZIP = ${CURDIR}/inst/bin/prezip-bin
EXTRA_CONFIG_FLAGS =
ifdef SLOPPY
EXTRA_CONFIG_FLAGS += --enable-sloppy-null-term-strings
endif
.PHONY: all prep sanity filter-test suggest wide cxx_warnings
all: prep sanity filter-test suggest wide cxx_warnings
cat test-res
# warning-settings.mk defines EXTRA_CXXFLAGS
warning-settings.mk: warning-settings.cpp
$(CXX) warning-settings.cpp -o warning-settings
./warning-settings > warning-settings.mk
include warning-settings.mk
prep: inst/bin/aspell inst/lib/aspell-0.60/en.multi tmp
rm -f test-res
tmp:
mkdir tmp
sanity: prep
./sanity
echo "all ok (sanity)" >> test-res
filter-test: prep
./filter-test "${ASPELL_WRAP} ${ASPELL}" < markdown.dat
echo "all ok (markdown filter-test)" >> test-res
inst/bin/aspell: build/Makefile phony
$(MAKE) -C build aspell && ( cmp -s build/aspell inst/bin/aspell || $(MAKE) -s -C build install )
inst/lib/aspell-0.60/en.multi: inst/bin/aspell aspell6-en-2018.04.16-0.tar.bz2
tar xf aspell6-en-2018.04.16-0.tar.bz2
cp en_phonet.dat aspell6-en-2018.04.16-0
cd aspell6-en-2018.04.16-0 && ./configure
$(MAKE) -C aspell6-en-2018.04.16-0 install
cp en.dat en.prepl en_repl.dat en_phonet.dat inst/lib/aspell-0.60
echo 'add en_US.multi' > inst/lib/aspell-0.60/en_US-w_repl.multi
echo 'add en.prepl' >> inst/lib/aspell-0.60/en_US-w_repl.multi
build/Makefile:
mkdir -p build
cd build && ../../configure "CXXFLAGS=${CXXFLAGS} ${EXTRA_CXXFLAGS}" "CFLAGS=${CFLAGS}" -q --enable-silent-rules --disable-shared --disable-pspell-compatibility --prefix="${CURDIR}/inst" $(EXTRA_CONFIG_FLAGS)
aspell6-en-2018.04.16-0.tar.bz2:
curl -O https://ftp.gnu.org/gnu/aspell/dict/en/aspell6-en-2018.04.16-0.tar.bz2
.PHONY: clean
clean:
rm -rf warning-settings warning-settings.mk inst build tmp aspell6-en-2018.04.16-0
suggest.mk: suggest/mkmk
suggest/mkmk > suggest.mk
include suggest.mk
.PHONY: wide_test_invalid wide_test_invalid-but_ok wide_test_valid
wide: wide_test_invalid wide_test_invalid-but_ok wide_test_valid
wide_test_invalid: wide_test_invalid.c prep
$(CC) $(CFLAGS) -Iinst/include -c $< -o tmp/$@.o
$(CXX) $(CXXFLAGS) tmp/$@.o inst/lib/libaspell.a -ldl -o $@
ifdef SLOPPY
./$@
echo "ok ($@ SLOPPY)" >> test-res
else
./$@ 2> tmp/$@.log || true
fgrep -q 'Null-terminated wide-character strings unsupported when used this way.' tmp/$@.log
echo "ok ($@)" >> test-res
endif
wide_test_valid: wide_test_valid.c prep
$(CC) $(CFLAGS) -Iinst/include -c $< -o tmp/$@.o
$(CXX) $(CXXFLAGS) tmp/$@.o inst/lib/libaspell.a -ldl -o $@
./$@
echo "ok ($@)" >> test-res
wide_test_invalid-but_ok: wide_test_invalid.c prep
$(CC) $(CFLAGS) -DASPELL_ENCODE_SETTING_SECURE -Iinst/include -c $< -o tmp/$@.o
$(CXX) $(CXXFLAGS) tmp/$@.o inst/lib/libaspell.a -ldl -o $@
./$@
echo "ok ($@)" >> test-res
cxx_warnings: cxx_warnings_test.cpp prep
$(CXX) $(CXXFLAGS) -Wall -Wconversion -Werror -Iinst/include -c $<
echo "ok ($@)" >> test-res
.PHONY: phony
phony:
|