Fossil SCM

fossil-scm / Makefile.classic
Source Blame History 111 lines
75f0294… drh 1 #!/usr/bin/make
75f0294… drh 2 #
75f0294… drh 3 # This is the top-level makefile for Fossil when the build is occurring
75f0294… drh 4 # on a unix platform. This works out-of-the-box on most unix platforms.
75f0294… drh 5 # But you are free to vary some of the definitions if desired.
75f0294… drh 6 #
75f0294… drh 7 #### The toplevel directory of the source tree. Fossil can be built
75f0294… drh 8 # in a directory that is separate from the source tree. Just change
75f0294… drh 9 # the following to point from the build directory to the src/ folder.
75f0294… drh 10 #
75f0294… drh 11 SRCDIR = ./src
6c3d398… stephan 12 #### Upstream source files included directly in this repository.
6c3d398… stephan 13 #
6c3d398… stephan 14 SRCDIR_extsrc = ./extsrc
6c3d398… stephan 15 #### In-tree tools such as code generators and translators:
6c3d398… stephan 16 #
6c3d398… stephan 17 SRCDIR_tools = ./tools
75f0294… drh 18
75f0294… drh 19 #### The directory into which object code files should be written.
75f0294… drh 20 #
75f0294… drh 21 #
75f0294… drh 22 OBJDIR = ./bld
75f0294… drh 23
75f0294… drh 24 #### C Compiler and options for use in building executables that
75f0294… drh 25 # will run on the platform that is doing the build. This is used
75f0294… drh 26 # to compile code-generator programs as part of the build process.
75f0294… drh 27 # See TCC below for the C compiler for building the finished binary.
75f0294… drh 28 #
75f0294… drh 29 BCC = gcc
09f4188… ashepilko 30 BCCFLAGS = $(CFLAGS)
75f0294… drh 31
75f0294… drh 32 #### The suffix to add to final executable file. When cross-compiling
75f0294… drh 33 # to windows, make this ".exe". Otherwise leave it blank.
75f0294… drh 34 #
75f0294… drh 35 E =
75f0294… drh 36
b575811… mistachkin 37 #### C Compile and options for use in building executables that
75f0294… drh 38 # will run on the target platform. This is usually the same
75f0294… drh 39 # as BCC, unless you are cross-compiling. This C compiler builds
75f0294… drh 40 # the finished binary for fossil. The BCC compiler above is used
75f0294… drh 41 # for building intermediate code-generator tools.
75f0294… drh 42 #
75f0294… drh 43 #TCC = gcc -O6
75f0294… drh 44 #TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage
75f0294… drh 45 TCC = gcc -g -Os -Wall
75f0294… drh 46
75f0294… drh 47 # To add support for HTTPS
75f0294… drh 48 TCC += -DFOSSIL_ENABLE_SSL
75f0294… drh 49
7932cb3… mistachkin 50 #### We sometimes add the -static option here so that we can build a
7932cb3… mistachkin 51 # static executable that will run in a chroot jail.
7932cb3… mistachkin 52 #LIB = -static
7932cb3… mistachkin 53 TCC += -DFOSSIL_DYNAMIC_BUILD=1
7932cb3… mistachkin 54
09f4188… ashepilko 55 TCCFLAGS = $(CFLAGS)
09f4188… ashepilko 56
f08a09c… wyoung 57 # We don't attempt to use libedit or libreadline in this simplified
f08a09c… wyoung 58 # build system (contrast auto.def and Makefile.in) so use the included
f08a09c… wyoung 59 # copy of linenoise. MinGW can't make use of this, but linenoise is
f08a09c… wyoung 60 # ifdef'd out elsewhere for that platform. Note that this is a make
f08a09c… wyoung 61 # flag handled in src/main.mk, not a C preprocessor flag.
f08a09c… wyoung 62 USE_LINENOISE := 1
f08a09c… wyoung 63
75f0294… drh 64 #### Extra arguments for linking the finished binary. Fossil needs
6c3d398… stephan 65 # to link against the Z-Lib compression library. There are no
6c3d398… stephan 66 # other required dependencies.
6c3d398… stephan 67 ZLIB_LIB = -lz
66ae70a… drh 68
66ae70a… drh 69 # If using zlib:
6c3d398… stephan 70 LIB += $(ZLIB_LIB) $(LDFLAGS)
75f0294… drh 71
75f0294… drh 72 # If using HTTPS:
75f0294… drh 73 LIB += -lcrypto -lssl
ba71b35… wyoung 74
ba71b35… wyoung 75 # Many platforms put cos() needed by src/piechart.c in libm, rather than
729360e… wyoung 76 # in libc. We cannot enable this by default because libm doesn't exist
729360e… wyoung 77 # everywhere.
729360e… wyoung 78 #LIB += -lm
75f0294… drh 79
75f0294… drh 80 #### Tcl shell for use in running the fossil testsuite. If you do not
75f0294… drh 81 # care about testing the end result, this can be blank.
75f0294… drh 82 #
75f0294… drh 83 TCLSH = tclsh
729360e… wyoung 84
6c3d398… stephan 85 CFLAGS += -fPIE
6c3d398… stephan 86 CPPFLAGS += -I. -I$(SRCDIR_extsrc) -I$(SRCDIR)
6c3d398… stephan 87 LIB = -lm -lz -lssl
6c3d398… stephan 88 INSTALLDIR = $(DESTDIR)$(prefix)/bin
6c3d398… stephan 89 SQLITE3_ORIGINAL = 0
6c3d398… stephan 90 USE_LINENOISE = 1
6c3d398… stephan 91
6c3d398… stephan 92
75f0294… drh 93 # You should not need to change anything below this line
75f0294… drh 94 ###############################################################################
75f0294… drh 95 #
75f0294… drh 96 # Automatic platform-specific options.
75f0294… drh 97 HOST_OS_CMD = uname -s
75f0294… drh 98 HOST_OS = $(HOST_OS_CMD:sh)
75f0294… drh 99
3bff7b9… drh 100 LIB.SunOS= -lsocket -lnsl -lrt
75f0294… drh 101 LIB += $(LIB.$(HOST_OS))
75f0294… drh 102
75f0294… drh 103 TCC.DragonFly += -DUSE_PREAD
75f0294… drh 104 TCC.FreeBSD += -DUSE_PREAD
75f0294… drh 105 TCC.NetBSD += -DUSE_PREAD
75f0294… drh 106 TCC.OpenBSD += -DUSE_PREAD
75f0294… drh 107 TCC += $(TCC.$(HOST_OS))
75f0294… drh 108
a6ee6ad… stephan 109 APPNAME = fossil$(E)
6c3d398… stephan 110 .PHONY: all tags
75f0294… drh 111 include $(SRCDIR)/main.mk

Keyboard Shortcuts

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