📄 main.mk
字号:
################################################################################ The following macros should be defined before this script is# invoked:## TOP The toplevel directory of the source tree. This is the# directory that contains this "Makefile.in" and the# "configure.in" script.## BCC C Compiler and options for use in building executables that# will run on the platform that is doing the build.## USLEEP If the target operating system supports the "usleep()" system# call, then define the HAVE_USLEEP macro for all C modules.## THREADSAFE If you want the SQLite library to be safe for use within a # multi-threaded program, then define the following macro# appropriately:## THREADLIB Specify any extra linker options needed to make the library# thread safe## OPTS Extra compiler command-line options.## EXE The suffix to add to executable files. ".exe" for windows# and "" for Unix.## TCC C Compiler and options for use in building executables that # will run on the target platform. This is usually the same# as BCC, unless you are cross-compiling.## AR Tools used to build a static library.# RANLIB## TCL_FLAGS Extra compiler options needed for programs that use the# TCL library.## LIBTCL Linker options needed to link against the TCL library.## READLINE_FLAGS Compiler options needed for programs that use the# readline() library.## LIBREADLINE Linker options needed by programs using readline() must# link against.## NAWK Nawk compatible awk program. Older (obsolete?) solaris# systems need this to avoid using the original AT&T AWK.## Once the macros above are defined, the rest of this make script will# build the SQLite library and testing tools.################################################################################# This is how we compile#TCCX = $(TCC) $(OPTS) $(THREADSAFE) $(USLEEP) -I. -I$(TOP)/src# Object files for the SQLite library.#LIBOBJ+= alter.o analyze.o attach.o auth.o btree.o build.o \ callback.o complete.o date.o delete.o \ expr.o func.o hash.o insert.o loadext.o \ main.o malloc.o opcodes.o os.o os_os2.o os_unix.o os_win.o \ pager.o parse.o pragma.o prepare.o printf.o random.o \ select.o table.o tclsqlite.o tokenize.o trigger.o \ update.o util.o vacuum.o \ vdbe.o vdbeapi.o vdbeaux.o vdbeblob.o vdbefifo.o vdbemem.o \ where.o utf.o legacy.o vtab.oEXTOBJ = icu.o fts2.o fts2_hash.o fts2_icu.o fts2_porter.o \ fts2_tokenizer.o fts2_tokenizer1.o# All of the source code files.#SRC = \ $(TOP)/src/alter.c \ $(TOP)/src/analyze.c \ $(TOP)/src/attach.c \ $(TOP)/src/auth.c \ $(TOP)/src/btree.c \ $(TOP)/src/btree.h \ $(TOP)/src/build.c \ $(TOP)/src/callback.c \ $(TOP)/src/complete.c \ $(TOP)/src/date.c \ $(TOP)/src/delete.c \ $(TOP)/src/expr.c \ $(TOP)/src/func.c \ $(TOP)/src/hash.c \ $(TOP)/src/hash.h \ $(TOP)/src/insert.c \ $(TOP)/src/legacy.c \ $(TOP)/src/loadext.c \ $(TOP)/src/main.c \ $(TOP)/src/malloc.c \ $(TOP)/src/os.c \ $(TOP)/src/os_os2.c \ $(TOP)/src/os_unix.c \ $(TOP)/src/os_win.c \ $(TOP)/src/pager.c \ $(TOP)/src/pager.h \ $(TOP)/src/parse.y \ $(TOP)/src/pragma.c \ $(TOP)/src/prepare.c \ $(TOP)/src/printf.c \ $(TOP)/src/random.c \ $(TOP)/src/select.c \ $(TOP)/src/shell.c \ $(TOP)/src/sqlite.h.in \ $(TOP)/src/sqlite3ext.h \ $(TOP)/src/sqliteInt.h \ $(TOP)/src/table.c \ $(TOP)/src/tclsqlite.c \ $(TOP)/src/tokenize.c \ $(TOP)/src/trigger.c \ $(TOP)/src/utf.c \ $(TOP)/src/update.c \ $(TOP)/src/util.c \ $(TOP)/src/vacuum.c \ $(TOP)/src/vdbe.c \ $(TOP)/src/vdbe.h \ $(TOP)/src/vdbeapi.c \ $(TOP)/src/vdbeaux.c \ $(TOP)/src/vdbeblob.c \ $(TOP)/src/vdbefifo.c \ $(TOP)/src/vdbemem.c \ $(TOP)/src/vdbeInt.h \ $(TOP)/src/vtab.c \ $(TOP)/src/where.c# Source code for extensions#SRC += \ $(TOP)/ext/fts1/fts1.c \ $(TOP)/ext/fts1/fts1.h \ $(TOP)/ext/fts1/fts1_hash.c \ $(TOP)/ext/fts1/fts1_hash.h \ $(TOP)/ext/fts1/fts1_porter.c \ $(TOP)/ext/fts1/fts1_tokenizer.h \ $(TOP)/ext/fts1/fts1_tokenizer1.cSRC += \ $(TOP)/ext/fts2/fts2.c \ $(TOP)/ext/fts2/fts2.h \ $(TOP)/ext/fts2/fts2_hash.c \ $(TOP)/ext/fts2/fts2_hash.h \ $(TOP)/ext/fts2/fts2_porter.c \ $(TOP)/ext/fts2/fts2_tokenizer.h \ $(TOP)/ext/fts2/fts2_tokenizer1.cSRC += \ $(TOP)/ext/icu/icu.c# Generated source code files#SRC += \ keywordhash.h \ opcodes.c \ opcodes.h \ parse.c \ parse.h \ sqlite3.h# Source code to the test files.#TESTSRC = \ $(TOP)/src/btree.c \ $(TOP)/src/date.c \ $(TOP)/src/func.c \ $(TOP)/src/insert.c \ $(TOP)/src/main.c \ $(TOP)/src/malloc.c \ $(TOP)/src/os.c \ $(TOP)/src/os_os2.c \ $(TOP)/src/os_unix.c \ $(TOP)/src/os_win.c \ $(TOP)/src/pager.c \ $(TOP)/src/pragma.c \ $(TOP)/src/printf.c \ $(TOP)/src/test1.c \ $(TOP)/src/test2.c \ $(TOP)/src/test3.c \ $(TOP)/src/test4.c \ $(TOP)/src/test5.c \ $(TOP)/src/test6.c \ $(TOP)/src/test7.c \ $(TOP)/src/test8.c \ $(TOP)/src/test9.c \ $(TOP)/src/test_autoext.c \ $(TOP)/src/test_async.c \ $(TOP)/src/test_btree.c \ $(TOP)/src/test_config.c \ $(TOP)/src/test_hexio.c \ $(TOP)/src/test_md5.c \ $(TOP)/src/test_schema.c \ $(TOP)/src/test_server.c \ $(TOP)/src/test_tclvar.c \ $(TOP)/src/utf.c \ $(TOP)/src/util.c \ $(TOP)/src/vdbe.c \ $(TOP)/src/vdbeaux.c \ $(TOP)/src/where.c \ $(TOP)/ext/fts2/fts2_tokenizer.c# Header files used by all library source files.#HDR = \ sqlite3.h \ $(TOP)/src/btree.h \ $(TOP)/src/btreeInt.h \ $(TOP)/src/hash.h \ $(TOP)/src/sqliteLimit.h \ opcodes.h \ $(TOP)/src/os.h \ $(TOP)/src/os_common.h \ $(TOP)/src/sqlite3ext.h \ $(TOP)/src/sqliteInt.h \ $(TOP)/src/vdbe.h \ parse.h# Header files used by extensions#EXTHDR += \ $(TOP)/ext/fts1/fts1.h \ $(TOP)/ext/fts1/fts1_hash.h \ $(TOP)/ext/fts1/fts1_tokenizer.hEXTHDR += \ $(TOP)/ext/fts2/fts2.h \ $(TOP)/ext/fts2/fts2_hash.h \ $(TOP)/ext/fts2/fts2_tokenizer.h# Header files used by the VDBE submodule#VDBEHDR = \ $(TOP)/src/vdbeInt.h# This is the default Makefile target. The objects listed here# are what get build when you type just "make" with no arguments.#all: sqlite3.h libsqlite3.a sqlite3$(EXE)# Generate the file "last_change" which contains the date of change# of the most recently modified source code file#last_change: $(SRC) cat $(SRC) | grep '$$Id: ' | sort -k 5 | tail -1 \ | $(NAWK) '{print $$5,$$6}' >last_changelibsqlite3.a: $(LIBOBJ) $(EXTOBJ) $(AR) libsqlite3.a $(LIBOBJ) $(EXTOBJ) $(RANLIB) libsqlite3.asqlite3$(EXE): $(TOP)/src/shell.c libsqlite3.a sqlite3.h $(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) \ $(TOP)/src/shell.c \ libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)objects: $(LIBOBJ_ORIG)# This target creates a directory named "tsrc" and fills it with# copies of all of the C source code and header files needed to# build on the target system. Some of the C source code and header# files are automatically generated. This target takes care of# all that automatic generation.#target_source: $(SRC) rm -rf tsrc mkdir tsrc cp -f $(SRC) $(TOP)/src/*.h tsrc 2>/dev/null rm tsrc/sqlite.h.in tsrc/parse.ysqlite3.c: target_source $(TOP)/tool/mksqlite3c.tcl tclsh $(TOP)/tool/mksqlite3c.tcl cp sqlite3.c tclsqlite3.c cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c tclsh $(TOP)/tool/mksqlite3internalh.tcl# Rules to build the LEMON compiler generator#lemon: $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c $(BCC) -o lemon $(TOP)/tool/lemon.c cp $(TOP)/tool/lempar.c .# Rules to build individual files#alter.o: $(TOP)/src/alter.c $(HDR) $(TCCX) -c $(TOP)/src/alter.canalyze.o: $(TOP)/src/analyze.c $(HDR) $(TCCX) -c $(TOP)/src/analyze.cattach.o: $(TOP)/src/attach.c $(HDR) $(TCCX) -c $(TOP)/src/attach.cauth.o: $(TOP)/src/auth.c $(HDR) $(TCCX) -c $(TOP)/src/auth.cbtree.o: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h $(TCCX) -c $(TOP)/src/btree.cbuild.o: $(TOP)/src/build.c $(HDR) $(TCCX) -c $(TOP)/src/build.ccallback.o: $(TOP)/src/callback.c $(HDR) $(TCCX) -c $(TOP)/src/callback.ccomplete.o: $(TOP)/src/complete.c $(HDR) $(TCCX) -c $(TOP)/src/complete.cdate.o: $(TOP)/src/date.c $(HDR) $(TCCX) -c $(TOP)/src/date.cdelete.o: $(TOP)/src/delete.c $(HDR) $(TCCX) -c $(TOP)/src/delete.cexpr.o: $(TOP)/src/expr.c $(HDR) $(TCCX) -c $(TOP)/src/expr.cfunc.o: $(TOP)/src/func.c $(HDR) $(TCCX) -c $(TOP)/src/func.chash.o: $(TOP)/src/hash.c $(HDR) $(TCCX) -c $(TOP)/src/hash.cinsert.o: $(TOP)/src/insert.c $(HDR) $(TCCX) -c $(TOP)/src/insert.clegacy.o: $(TOP)/src/legacy.c $(HDR) $(TCCX) -c $(TOP)/src/legacy.cloadext.o: $(TOP)/src/loadext.c $(HDR) $(TCCX) -c $(TOP)/src/loadext.cmain.o: $(TOP)/src/main.c $(HDR) $(TCCX) -c $(TOP)/src/main.cmalloc.o: $(TOP)/src/malloc.c $(HDR) $(TCCX) -c $(TOP)/src/malloc.cpager.o: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h $(TCCX) -c $(TOP)/src/pager.copcodes.o: opcodes.c $(TCCX) -c opcodes.copcodes.c: opcodes.h $(TOP)/mkopcodec.awk sort -n -b -k 3 opcodes.h | $(NAWK) -f $(TOP)/mkopcodec.awk >opcodes.copcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk cat parse.h $(TOP)/src/vdbe.c | $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.hos.o: $(TOP)/src/os.c $(HDR)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -