-
-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathparse_fpc_sources.sh
More file actions
executable file
·48 lines (42 loc) · 1.68 KB
/
parse_fpc_sources.sh
File metadata and controls
executable file
·48 lines (42 loc) · 1.68 KB
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
#!/usr/bin/env bash
set -eu
# --------------------------------------------------------------------
# Parse FPC source code.
# Edit SOURCES_DIR to point to the FPC source code on your system.
# --------------------------------------------------------------------
# Assume pasdoc is on $PATH, if PASDOC_BIN not set.
PASDOC_BIN="${PASDOC_BIN:-pasdoc}"
SOURCES_DIR="$HOME/installed/fpclazarus/current/fpcsrc/"
OUTPUT_DIR="fpc_sources"
# OS and CPU which we should assume for parsing files.
# Note: This is not completely configurable by only these variables,
# below we also hardcode the assumption that it's Unix and some related defines.
# More work would be needed to make OS / CPU trivially and correctly switchable
# for this test.
OS='linux'
CPU='x86_64'
mkdir -p "${OUTPUT_DIR}"
# Non-recursive searching, to only account for single OS/CPU in RTL.
find "${SOURCES_DIR}/rtl" \
"${SOURCES_DIR}/rtl/unix" \
"${SOURCES_DIR}/rtl/objpas" \
"${SOURCES_DIR}/rtl/${OS}" \
"${SOURCES_DIR}/rtl/${CPU}" \
"${SOURCES_DIR}/rtl/${OS}/${CPU}" \
-maxdepth 1 \
-type f '(' -name "*.pas" -o -name "*.pp" -')' > "${OUTPUT_DIR}/sources.txt"
"${PASDOC_BIN}" \
--define LINUX \
--define UNIX \
--define FPC_FULLVERSION=32200 \
--output="${OUTPUT_DIR}" \
--source="${OUTPUT_DIR}/sources.txt" \
--include "${SOURCES_DIR}/rtl/inc/" \
--include "${SOURCES_DIR}/rtl/unix/" \
--include "${SOURCES_DIR}/rtl/objpas/" \
--include "${SOURCES_DIR}/rtl/objpas/classes/" \
--include "${SOURCES_DIR}/rtl/objpas/sysutils/" \
--include "${SOURCES_DIR}/rtl/${OS}/" \
--include "${SOURCES_DIR}/rtl/${CPU}/" \
--include "${SOURCES_DIR}/rtl/${OS}/${CPU}/" \
| tee "${OUTPUT_DIR}/pasdoc.log"