forked from stellar/stellar-core
-
Notifications
You must be signed in to change notification settings - Fork 1
/
make-mks
executable file
·61 lines (48 loc) · 2.01 KB
/
make-mks
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
#!/bin/sh -e
case "$0" in
*/*)
cd $(dirname $0)
;;
esac
# Bail if not under git
git rev-parse
trap 'rm -f src/src.mk lib/medida.mk lib/lib.mk' 0
message="# This file was generated by make-mks; don't edit it by hand."
# Use only files git knows about, to avoid picking up autogenrated
# files or other random cruft. When adding a new file foo.cpp, you
# must run "git add -N foo.cpp" before running this script.
(cd src
echo "$message"
echo "SRC_H_FILES" = $(git ls-files '*.h' '*.[ih]pp' | tr " " "\n" | sort | uniq | egrep -v '(test|simulation)/' | tr "\n" " ")
echo "SRC_CXX_FILES" = $(git ls-files '*.cpp' | tr " " "\n" | sort | uniq | egrep -v '(test|simulation)/' | tr "\n" " ")
echo "SRC_X_FILES" = $(git ls-files '*.x' | tr " " "\n" | sort | uniq | tr "\n" " ")
echo "SRC_TEST_H_FILES" = $(git ls-files '*.h' '*.[ih]pp' | tr " " "\n" | egrep '(test|simulation)/' | tr "\n" " ")
echo "SRC_TEST_CXX_FILES" = $(git ls-files '*.cpp' | tr " " "\n" | sort | uniq | egrep '(test|simulation)/' | tr "\n" " ")
) > src/src.mk
# Hacks for shell third-party libraries without autoconf. You may
# need to re-run this after updating submodules.
listall() {
find "$@" -type f \
\( -name '*.[ch]' -o -name '*.[chi]pp' -o -name '*.cc' \) -print
}
(cd lib
if test -f libmedida/src/medida/medida.h; then
echo "$message"
echo INTERNAL_MEDIDA_FILES = $(listall libmedida/src/medida)
fi) > lib/medida.mk
(cd lib
echo "$message"
echo SOCI_FILES = $(listall soci/src/backends/sqlite3 soci/src/core)
echo SOCI_PG_FILES = $(listall soci/src/backends/postgresql)
echo SQLITE3_FILES = $(listall sqlite)
echo UTIL_FILES = $(listall util http)
echo ASIO_H_FILES = $(listall asio/asio/include)
# The following does not work without boost or -DASIO_STANDALONE=1
#echo ASIO_CXX_FILES = asio/src/*.cpp
echo ASIO_CXX_FILES = asio.cpp
echo TRACY_CXX_FILES = tracy/TracyClient.cpp
echo JSON_FILES = $(listall json)
echo SPDLOG_FILES = spdlog.cpp
echo MISC_H_FILES = *.hpp $(listall autocheck cereal fmt)
) > lib/lib.mk
trap '' 0