xref: /sqlite-3.40.0/Makefile.linux-gcc (revision 7dc3547e)
176800328Sdrh#!/usr/make
276800328Sdrh#
376800328Sdrh# Makefile for SQLITE
476800328Sdrh#
576800328Sdrh# This is a template makefile for SQLite.  Most people prefer to
676800328Sdrh# use the autoconf generated "configure" script to generate the
776800328Sdrh# makefile automatically.  But that does not work for everybody
876800328Sdrh# and in every situation.  If you are having problems with the
976800328Sdrh# "configure" script, you might want to try this makefile as an
1076800328Sdrh# alternative.  Create a copy of this file, edit the parameters
1176800328Sdrh# below and type "make".
1276800328Sdrh#
1376800328Sdrh
1476800328Sdrh#### The toplevel directory of the source tree.  This is the directory
1576800328Sdrh#    that contains this "Makefile.in" and the "configure.in" script.
1676800328Sdrh#
1776800328SdrhTOP = ../sqlite
1876800328Sdrh
1976800328Sdrh#### C Compiler and options for use in building executables that
2076800328Sdrh#    will run on the platform that is doing the build.
2176800328Sdrh#
22*7dc3547eSdrhBCC = gcc -g -O0
2376800328Sdrh#BCC = /opt/ancic/bin/c89 -0
2476800328Sdrh
2576800328Sdrh#### If the target operating system supports the "usleep()" system
2676800328Sdrh#    call, then define the HAVE_USLEEP macro for all C modules.
2776800328Sdrh#
2876800328Sdrh#USLEEP =
2976800328SdrhUSLEEP = -DHAVE_USLEEP=1
3076800328Sdrh
3176800328Sdrh#### If you want the SQLite library to be safe for use within a
3276800328Sdrh#    multi-threaded program, then define the following macro
3376800328Sdrh#    appropriately:
3476800328Sdrh#
3576800328Sdrh#THREADSAFE = -DTHREADSAFE=1
3676800328SdrhTHREADSAFE = -DTHREADSAFE=0
3776800328Sdrh
3876800328Sdrh#### Specify any extra linker options needed to make the library
3976800328Sdrh#    thread safe
4076800328Sdrh#
41*7dc3547eSdrhTHREADLIB = -lpthread -lm -ldl
42*7dc3547eSdrh#THREADLIB =
4376800328Sdrh
44f1878b4aSdrh#### Specify any extra libraries needed to access required functions.
45f1878b4aSdrh#
46f1878b4aSdrh#TLIBS = -lrt    # fdatasync on Solaris 8
47f1878b4aSdrhTLIBS =
48f1878b4aSdrh
49faa57accSdrh#### Leave SQLITE_DEBUG undefined for maximum speed.  Use SQLITE_DEBUG=1
50faa57accSdrh#    to check for memory leaks.  Use SQLITE_DEBUG=2 to print a log of all
5176800328Sdrh#    malloc()s and free()s in order to track down memory leaks.
5276800328Sdrh#
5376800328Sdrh#    SQLite uses some expensive assert() statements in the inner loop.
5476800328Sdrh#    You can make the library go almost twice as fast if you compile
5576800328Sdrh#    with -DNDEBUG=1
5676800328Sdrh#
57*7dc3547eSdrhOPTS += -DSQLITE_DEBUG=1
58*7dc3547eSdrhOPTS += -DSQLITE_ENABLE_WHERETRACE
59*7dc3547eSdrhOPTS += -DSQLITE_ENABLE_SELECTTRACE
6076800328Sdrh
6176800328Sdrh#### The suffix to add to executable files.  ".exe" for windows.
6276800328Sdrh#    Nothing for unix.
6376800328Sdrh#
6476800328Sdrh#EXE = .exe
6576800328SdrhEXE =
6676800328Sdrh
6776800328Sdrh#### C Compile and options for use in building executables that
6876800328Sdrh#    will run on the target platform.  This is usually the same
6976800328Sdrh#    as BCC, unless you are cross-compiling.
7076800328Sdrh#
71*7dc3547eSdrhTCC = gcc -O0
7276800328Sdrh#TCC = gcc -g -O0 -Wall
7376800328Sdrh#TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage
7476800328Sdrh#TCC = /opt/mingw/bin/i386-mingw32-gcc -O6
7576800328Sdrh#TCC = /opt/ansic/bin/c89 -O +z -Wl,-a,archive
7676800328Sdrh
7776800328Sdrh#### Tools used to build a static library.
7876800328Sdrh#
7976800328SdrhAR = ar cr
8076800328Sdrh#AR = /opt/mingw/bin/i386-mingw32-ar cr
8176800328SdrhRANLIB = ranlib
8276800328Sdrh#RANLIB = /opt/mingw/bin/i386-mingw32-ranlib
8376800328Sdrh
8469e777f3Sdanielk1977MKSHLIB = gcc -shared
8569e777f3Sdanielk1977SO = so
8669e777f3Sdanielk1977SHPREFIX = lib
8769e777f3Sdanielk1977# SO = dll
8869e777f3Sdanielk1977# SHPREFIX =
8969e777f3Sdanielk1977
9076800328Sdrh#### Extra compiler options needed for programs that use the TCL library.
9176800328Sdrh#
92*7dc3547eSdrhTCL_FLAGS = -I/home/drh/tcl/include/tcl8.6
9376800328Sdrh
9476800328Sdrh#### Linker options needed to link against the TCL library.
9576800328Sdrh#
9676800328Sdrh#LIBTCL = -ltcl -lm -ldl
97*7dc3547eSdrhLIBTCL = /home/drh/tcl/lib/libtcl8.6.a -lm -lpthread -ldl -lz
9876800328Sdrh
9965d3c13cSchw#### Additional objects for SQLite library when TCL support is enabled.
10065d3c13cSchw#TCLOBJ =
10165d3c13cSchwTCLOBJ = tclsqlite.o
10265d3c13cSchw
10376800328Sdrh#### Compiler options needed for programs that use the readline() library.
10476800328Sdrh#
1059c2ba47eSdrhREADLINE_FLAGS =
1069c2ba47eSdrh#READLINE_FLAGS = -DHAVE_READLINE=1 -I/usr/include/readline
10776800328Sdrh
10876800328Sdrh#### Linker options needed by programs using readline() must link against.
10976800328Sdrh#
1109c2ba47eSdrhLIBREADLINE =
1119c2ba47eSdrh#LIBREADLINE = -static -lreadline -ltermcap
11276800328Sdrh
11376800328Sdrh# You should not have to change anything below this line
11476800328Sdrh###############################################################################
11576800328Sdrhinclude $(TOP)/main.mk
116