-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.am
93 lines (76 loc) · 2.71 KB
/
Makefile.am
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
# Makefile.am for building libjumphash
# Copyright (C) 2018 Eric Herman <[email protected]>
#
# This work is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 2.1 of the License, or (at
# your option) any later version.
#
# This work is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
# License for more details.
#
# https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
lib_LTLIBRARIES=libjumphash.la
CSTD_CFLAGS=-std=c89
# DEBUG_CFLAGS=-ggdb -O0 -DDEBUG \
# -fsanitize=address,leak,undefined
DEBUG_CFLAGS=-ggdb -O3 -DNDEBUG -Wno-unused-parameter -fomit-frame-pointer
NOISY_CFLAGS=-Wall -Wextra -Wpedantic -Wcast-qual -Wc++-compat
LESS_PEDANTIC_CFLAGS=-Wno-format -Wno-long-long
AM_CFLAGS=\
-I./src \
$(CSTD_CFLAGS) \
$(DEBUG_CFLAGS) \
$(NOISY_CFLAGS) \
$(LESS_PEDANTIC_CFLAGS) \
-pipe
# extracted from https://github.com/torvalds/linux/blob/master/scripts/Lindent
LINDENT=indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1 -il0
ACLOCAL_AMFLAGS=-I m4 --install
EXTRA_DIST=misc
check_PROGRAMS=\
test_jumphash_rebucket \
test_jumphash_equivalence
tidy:
patch -Np1 -i misc/pre-tidy.patch
$(LINDENT) \
-T FILE \
-T size_t \
-T int32_t \
-T uint64_t \
`find src tests -name '*.h' -o -name '*.c'`
patch -Rp1 -i misc/pre-tidy.patch
spotless:
rm -rf `cat .gitignore | sed -e 's/#.*//'`
pushd src && rm -rf `cat ../.gitignore | sed -e 's/#.*//'`; popd
pushd tests && rm -rf `cat ../.gitignore | sed -e 's/#.*//'`; popd
test: $(check_PROGRAMS)
./test_jumphash_equivalence
./test_jumphash_rebucket 1 2 1
./test_jumphash_rebucket 2 4 1
./test_jumphash_rebucket 3 7 1
./test_jumphash_rebucket 4 8 1
./test_jumphash_rebucket 5 11 1
./test_jumphash_rebucket 6 12 1
./test_jumphash_rebucket 7 13 1
./test_jumphash_rebucket 8 16 1
./test_jumphash_rebucket 16 8 1
./test_jumphash_rebucket 5 4 1
./test_jumphash_rebucket 3 2 1
./test_jumphash_rebucket 1 8 1 10000000 0 0
./test_jumphash_rebucket 1 8 1 10000000 0 6364136223846793005ULL
./test_jumphash_rebucket 3 7 1 100000 0 6364136223846793005ULL 0.0000001
libjumphash_la_SOURCES=src/jumphash.c
include_HEADERS=src/jumphash.h
TESTS=$(check_PROGRAMS)
T_COMMON_SOURCES=\
$(include_HEADERS)
T_COMMON_LDADD=libjumphash.la
test_jumphash_rebucket_SOURCES=tests/test_jumphash_rebucket.c \
$(T_COMMON_SOURCES)
test_jumphash_rebucket_LDADD=$(T_COMMON_LDADD)
test_jumphash_equivalence_SOURCES=tests/test_jumphash_equivalence.c \
$(T_COMMON_SOURCES)
test_jumphash_equivalence_LDADD=$(T_COMMON_LDADD)