Fossil SCM

fossil-scm / Makefile.in
Blame History Raw 178 lines
1
#!/usr/bin/make
2
#
3
# This is the top-level makefile for Fossil when the build is occurring
4
# on a unix platform. This works out-of-the-box on most unix platforms.
5
# But you are free to vary some of the definitions if desired.
6
#
7
#### The toplevel directory of the source tree. Fossil can be built
8
# in a directory that is separate from the source tree. Just change
9
# the following to point from the build directory to the src/ folder.
10
#
11
SRCDIR = @srcdir@/src
12
TOPDIR = @srcdir@
13
#### Upstream source files included directly in this repository.
14
#
15
SRCDIR_extsrc = @srcdir@/extsrc
16
#### In-tree tools such as code generators and translators:
17
#
18
SRCDIR_tools = @srcdir@/tools
19
20
#### The directory into which object code files should be written.
21
# Having a "./" prefix in the value of this variable breaks our use of the
22
# "makeheaders" tool when running make on the MinGW platform, apparently
23
# due to some command line argument manipulation performed automatically
24
# by the shell.
25
#
26
#
27
OBJDIR = bld
28
29
#### C Compiler and options for use in building executables that
30
# will run on the platform that is doing the build. This is used
31
# to compile code-generator programs as part of the build process.
32
# See TCC below for the C compiler for building the finished binary.
33
#
34
BCC = @CC_FOR_BUILD@
35
36
#### The suffix to add to final executable file. When cross-compiling
37
# to windows, make this ".exe". Otherwise leave it blank.
38
#
39
E = @EXEEXT@
40
41
TCC = @CC@
42
43
#### Tcl shell for use in running the fossil testsuite. If you do not
44
# care about testing the end result, this can be blank.
45
#
46
TCLSH = @TCLSH@
47
48
CFLAGS = @CFLAGS@
49
CFLAGS_INCLUDE = @CFLAGS_INCLUDE@
50
LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
51
BCCFLAGS = @CPPFLAGS@ $(CFLAGS)
52
TCCFLAGS = @EXTRA_CFLAGS@ @CPPFLAGS@ $(CFLAGS) -DHAVE_AUTOCONFIG_H
53
#
54
# Fuzzing may be enable by appending -fsanitize=fuzzer -DFOSSIL_FUZZ
55
# to the TCCFLAGS variable.
56
# For more thorough (but also slower) investigation
57
# -fsanitize=fuzzer,undefined,address
58
# might be more useful.
59
60
INSTALLDIR = $(DESTDIR)@prefix@/bin
61
USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@
62
SQLITE3_SRC.2 = @SQLITE3_SRC.2@
63
SQLITE3_OBJ.2 = @SQLITE3_OBJ.2@
64
SQLITE3_SHELL_SRC.2 = @SQLITE3_SHELL_SRC.2@
65
SQLITE3_ORIGIN = @SQLITE3_ORIGIN@
66
# SQLITE3_ORIGIN changes...
67
# SQLITE3_SRC:
68
# 0=src/sqlite3.c, 1=src/sqlite3-see.c, 2=$(SQLITE3_SRC.2)
69
# SQLITE3_SHELL_SRC:
70
# 0=src/shell.c, 1=src/shell-see.c, 2=$(SQLITE3_SHELL_SRC.2)
71
USE_LINENOISE = @USE_LINENOISE@
72
USE_MMAN_H = @USE_MMAN_H@
73
USE_SEE = @USE_SEE@
74
APPNAME = fossil
75
#
76
# APPNAME = fossil-fuzz
77
# may be more appropriate for fuzzing.
78
79
#### Emscripten stuff for optionally doing in-tree builds
80
# of any WASM components. We store precompiled WASM in the SCM, so
81
# this is only useful for people who actively work on WASM
82
# components. EMSDK_ENV refers to the "environment" script which comes
83
# with the Emscripten SDK package:
84
# https://emscripten.org/docs/getting_started/downloads.html
85
EMSDK_HOME = @EMSDK_HOME@
86
EMSDK_ENV = @EMSDK_ENV@
87
EMCC_OPT = @EMCC_OPT@
88
EMCC_WRAPPER = $(SRCDIR_tools)/emcc.sh
89
90
# MAKE_COMPILATION_DB (yes/no) determines whether or not the
91
# compile_commands.json file will be generated.
92
MAKE_COMPILATION_DB = @MAKE_COMPILATION_DB@
93
94
.PHONY: all tags
95
96
include $(SRCDIR)/main.mk
97
SQLITE_OPTIONS += @SQLITE_OPTIONS_EXT@
98
SHELL_OPTIONS += @SQLITE_OPTIONS_EXT@
99
# ^^^ must come after main.mk is included
100
101
distclean: clean
102
-rm -f autoconfig.h config.log Makefile
103
-rm -f cscope.out tags
104
-rm -f $(EMCC_WRAPPER)
105
106
reconfig:
107
@AUTOREMAKE@
108
109
tags:
110
ctags -R @srcdir@/src
111
@COLLECT_CSCOPE_DATA@
112
113
# Automatically reconfigure whenever an autosetup file or one of the
114
# make source files change.
115
#
116
# The "touch" is necessary to avoid a make loop due to a new upstream
117
# feature in autosetup (GH 0a71e3c3b7) which rewrites *.in outputs only
118
# if doing so will write different contents; otherwise, it leaves them
119
# alone so the mtime doesn't change. This means that if you change one
120
# of our dependencies besides Makefile.in, we'll reconfigure but Makefile
121
# won't change, so this rule will remain out of date, so we'll reconfig
122
# but Makefile won't change, so we'll reconfig but... endlessly.
123
#
124
# This is also why we repeat the reconfig target's command here instead
125
# of delegating to it with "$(MAKE) reconfig": having children running
126
# around interfering makes this failure mode even worse.
127
Makefile: @srcdir@/Makefile.in $(SRCDIR)/main.mk @AUTODEPS@
128
@AUTOREMAKE@
129
touch @builddir@/Makefile
130
131
# Container stuff
132
SRCTB := src-@[email protected]
133
IMGVER := fossil:@FOSSIL_CI_PFX@
134
CNTVER := fossil-@FOSSIL_CI_PFX@
135
CENGINE := docker
136
container:
137
$(CENGINE) image inspect $(IMGVER) > /dev/null 2>&1 || \
138
$(MAKE) container-image
139
$(CENGINE) container inspect $(CNTVER) > /dev/null 2>&1 || \
140
$(CENGINE) create \
141
--name $(CNTVER) \
142
--cap-drop AUDIT_WRITE \
143
--cap-drop CHOWN \
144
--cap-drop FSETID \
145
--cap-drop KILL \
146
--cap-drop MKNOD \
147
--cap-drop NET_BIND_SERVICE \
148
--cap-drop NET_RAW \
149
--cap-drop SETFCAP \
150
--cap-drop SETPCAP \
151
--publish 8080:8080 \
152
$(DCFLAGS) $(IMGVER) $(DCCMD)
153
154
container-clean:
155
-$(CENGINE) container kill $(CNTVER)
156
-$(CENGINE) container rm $(CNTVER)
157
-$(CENGINE) image rm $(IMGVER)
158
159
container-image:
160
$(APPNAME) tarball --name src @FOSSIL_CI_PFX@ $(SRCTB)
161
$(CENGINE) buildx build \
162
--load \
163
--tag $(IMGVER) \
164
--build-arg FSLURL=$(SRCTB) \
165
$(DBFLAGS) @srcdir@
166
rm -f $(SRCTB)
167
168
container-run container-start: container
169
$(CENGINE) start $(DSFLAGS) $(CNTVER)
170
@sleep 1 # decrease likelihood of logging race condition
171
$(CENGINE) container logs $(CNTVER)
172
173
container-stop:
174
$(CENGINE) stop $(CNTVER)
175
176
container-version:
177
@echo $(CNTVER)
178

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button