dbda8d6ce9 2007-07-21 drh: #!/usr/bin/tclsh dbda8d6ce9 2007-07-21 drh: # dbda8d6ce9 2007-07-21 drh: # Run this TCL script to generate the "main.mk" makefile. dbda8d6ce9 2007-07-21 drh: # dbda8d6ce9 2007-07-21 drh: 4ee9e31a2d 2008-02-13 drh: # Basenames of all source files that get preprocessed using 4ee9e31a2d 2008-02-13 drh: # "translate" and "makeheaders" dbda8d6ce9 2007-07-21 drh: # dbda8d6ce9 2007-07-21 drh: set src { dbda8d6ce9 2007-07-21 drh: add 007d1ce44f 2008-02-07 drh: admin e15fe43153 2007-08-31 drh: bag dbda8d6ce9 2007-07-21 drh: blob b8a8959ec5 2007-09-23 jnc: branch e487b77b1a 2008-02-04 drh: browse dbda8d6ce9 2007-07-21 drh: cgi dbda8d6ce9 2007-07-21 drh: checkin dbda8d6ce9 2007-07-21 drh: checkout e37451d9c2 2007-08-01 drh: clearsign dbda8d6ce9 2007-07-21 drh: clone dbda8d6ce9 2007-07-21 drh: comformat e06ae9f6d2 2008-05-22 drh: configure b616c3d8c3 2007-08-29 drh: construct dbda8d6ce9 2007-07-21 drh: content dbda8d6ce9 2007-07-21 drh: db dbda8d6ce9 2007-07-21 drh: delta dbda8d6ce9 2007-07-21 drh: deltacmd 6458f020fc 2008-05-14 drh: descendants dbda8d6ce9 2007-07-21 drh: diff dbda8d6ce9 2007-07-21 drh: diffcmd 5cf1206dfa 2008-05-15 drh: doc dbda8d6ce9 2007-07-21 drh: encode dbda8d6ce9 2007-07-21 drh: file dbda8d6ce9 2007-07-21 drh: http dbda8d6ce9 2007-07-21 drh: info dbda8d6ce9 2007-07-21 drh: login dbda8d6ce9 2007-07-21 drh: main dbda8d6ce9 2007-07-21 drh: manifest dbda8d6ce9 2007-07-21 drh: md5 dbda8d6ce9 2007-07-21 drh: merge dbda8d6ce9 2007-07-21 drh: merge3 334f8e6e2f 2008-02-03 stephan: my_page dbda8d6ce9 2007-07-21 drh: name dbda8d6ce9 2007-07-21 drh: pivot abce5105e2 2007-09-01 drh: pqueue dbda8d6ce9 2007-07-21 drh: printf dbda8d6ce9 2007-07-21 drh: rebuild 55342eb9fb 2008-05-17 drh: report 07eaead5dc 2007-09-23 jnc: rss dbda8d6ce9 2007-07-21 drh: schema dbda8d6ce9 2007-07-21 drh: setup dbda8d6ce9 2007-07-21 drh: sha1 a48474bc75 2008-05-29 drh: shun e71e4d3193 2008-02-25 drh: stat dbda8d6ce9 2007-07-21 drh: style dbda8d6ce9 2007-07-21 drh: sync 2bc0e2c565 2007-09-21 drh: tag 02d1ed6ad2 2008-02-02 stephan: tagview 13e16c824a 2008-02-13 drh: th_main dbda8d6ce9 2007-07-21 drh: timeline a3e4a5d27d 2007-10-03 drh: tkt 0edee97370 2007-10-03 drh: tktsetup a36177bcce 2007-09-11 drh: undo dbda8d6ce9 2007-07-21 drh: update dbda8d6ce9 2007-07-21 drh: url dbda8d6ce9 2007-07-21 drh: user dbda8d6ce9 2007-07-21 drh: verify dbda8d6ce9 2007-07-21 drh: vfile dbda8d6ce9 2007-07-21 drh: wiki dbda8d6ce9 2007-07-21 drh: wikiformat e2e016c31f 2008-05-17 drh: winhttp dbda8d6ce9 2007-07-21 drh: xfer 9b780d220b 2007-07-31 drh: zip dbda8d6ce9 2007-07-21 drh: } dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: # Name of the final application dbda8d6ce9 2007-07-21 drh: # dbda8d6ce9 2007-07-21 drh: set name fossil dbda8d6ce9 2007-07-21 drh: b616c3d8c3 2007-08-29 drh: puts {# DO NOT EDIT b616c3d8c3 2007-08-29 drh: # b616c3d8c3 2007-08-29 drh: # This file is automatically generated. Instead of editing this b616c3d8c3 2007-08-29 drh: # file, edit "makemake.tcl" then run "tclsh makemake.tcl >main.mk" b616c3d8c3 2007-08-29 drh: # to regenerate this file. b616c3d8c3 2007-08-29 drh: # b616c3d8c3 2007-08-29 drh: # This file is included by linux-gcc.mk or linux-mingw.mk or possible dbda8d6ce9 2007-07-21 drh: # some other makefiles. This file contains the rules that are common dbda8d6ce9 2007-07-21 drh: # to building regardless of the target. dbda8d6ce9 2007-07-21 drh: # dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: XTCC = $(TCC) $(CFLAGS) -I. -I$(SRCDIR) dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: } dbda8d6ce9 2007-07-21 drh: puts -nonewline "SRC =" dbda8d6ce9 2007-07-21 drh: foreach s [lsort $src] { dbda8d6ce9 2007-07-21 drh: puts -nonewline " \\\n \$(SRCDIR)/$s.c" dbda8d6ce9 2007-07-21 drh: } dbda8d6ce9 2007-07-21 drh: puts "\n" dbda8d6ce9 2007-07-21 drh: puts -nonewline "TRANS_SRC =" dbda8d6ce9 2007-07-21 drh: foreach s [lsort $src] { dbda8d6ce9 2007-07-21 drh: puts -nonewline " \\\n ${s}_.c" dbda8d6ce9 2007-07-21 drh: } dbda8d6ce9 2007-07-21 drh: puts "\n" dbda8d6ce9 2007-07-21 drh: puts -nonewline "OBJ =" dbda8d6ce9 2007-07-21 drh: foreach s [lsort $src] { dbda8d6ce9 2007-07-21 drh: puts -nonewline " \\\n $s.o" dbda8d6ce9 2007-07-21 drh: } dbda8d6ce9 2007-07-21 drh: puts "\n" dbda8d6ce9 2007-07-21 drh: puts "APPNAME = $name\$(E)" dbda8d6ce9 2007-07-21 drh: puts "\n" dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: puts { dbda8d6ce9 2007-07-21 drh: all: $(APPNAME) dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: install: $(APPNAME) dbda8d6ce9 2007-07-21 drh: mv $(APPNAME) $(INSTALLDIR) dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: translate: $(SRCDIR)/translate.c dbda8d6ce9 2007-07-21 drh: $(BCC) -o translate $(SRCDIR)/translate.c dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: makeheaders: $(SRCDIR)/makeheaders.c dbda8d6ce9 2007-07-21 drh: $(BCC) -o makeheaders $(SRCDIR)/makeheaders.c dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: mkindex: $(SRCDIR)/mkindex.c dbda8d6ce9 2007-07-21 drh: $(BCC) -o mkindex $(SRCDIR)/mkindex.c dbda8d6ce9 2007-07-21 drh: 5f83d2720e 2007-08-29 aku: # WARNING. DANGER. Running the testsuite modifies the repository the 5f83d2720e 2007-08-29 aku: # build is done from, i.e. the checkout belongs to. Do not sync/push 5f83d2720e 2007-08-29 aku: # the repository after running the tests. 5f83d2720e 2007-08-29 aku: test: $(APPNAME) 5f83d2720e 2007-08-29 aku: $(TCLSH) test/tester.tcl $(APPNAME) 5f83d2720e 2007-08-29 aku: c2d1e3c70a 2007-09-22 drh: VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest def4449a87 2007-08-25 drh: awk '{ printf "#define MANIFEST_UUID \"%s\"\n", $$1}' \ def4449a87 2007-08-25 drh: $(SRCDIR)/../manifest.uuid >VERSION.h c2d1e3c70a 2007-09-22 drh: awk '{ printf "#define MANIFEST_VERSION \"[%.10s]\"\n", $$1}' \ c2d1e3c70a 2007-09-22 drh: $(SRCDIR)/../manifest.uuid >>VERSION.h c2d1e3c70a 2007-09-22 drh: awk '$$1=="D"{printf "#define MANIFEST_DATE \"%s %s\"\n",\ c2d1e3c70a 2007-09-22 drh: substr($$2,1,10),substr($$2,12)}' \ c2d1e3c70a 2007-09-22 drh: $(SRCDIR)/../manifest >>VERSION.h c2d1e3c70a 2007-09-22 drh: 4ee9e31a2d 2008-02-13 drh: $(APPNAME): headers $(OBJ) sqlite3.o th.o th_lang.o 4ee9e31a2d 2008-02-13 drh: $(TCC) -o $(APPNAME) $(OBJ) sqlite3.o th.o th_lang.o $(LIB) def4449a87 2007-08-25 drh: 1b52d1306e 2008-02-01 drh: # This rule prevents make from using its default rules to try build 1b52d1306e 2008-02-01 drh: # an executable named "manifest" out of the file named "manifest.c" 1b52d1306e 2008-02-01 drh: # 1b52d1306e 2008-02-01 drh: $(SRCDIR)/../manifest: 1b52d1306e 2008-02-01 drh: # noop dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: clean: b4571bb75e 2007-08-25 drh: rm -f *.o *_.c $(APPNAME) VERSION.h dbda8d6ce9 2007-07-21 drh: rm -f translate makeheaders mkindex page_index.h headers} dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: set hfiles {} dbda8d6ce9 2007-07-21 drh: foreach s [lsort $src] {lappend hfiles $s.h} dbda8d6ce9 2007-07-21 drh: puts "\trm -f $hfiles\n" dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: set mhargs {} dbda8d6ce9 2007-07-21 drh: foreach s [lsort $src] { dbda8d6ce9 2007-07-21 drh: append mhargs " ${s}_.c:$s.h" dbda8d6ce9 2007-07-21 drh: set extra_h($s) {} dbda8d6ce9 2007-07-21 drh: } dbda8d6ce9 2007-07-21 drh: append mhargs " \$(SRCDIR)/sqlite3.h" 4ee9e31a2d 2008-02-13 drh: append mhargs " \$(SRCDIR)/th.h" e243a8dfa4 2008-07-30 cle: append mhargs " VERSION.h" c699c491df 2008-09-19 stephan: puts "page_index.h: mkindex" c699c491df 2008-09-19 stephan: puts "\t./mkindex \$(TRANS_SRC) >$@" c699c491df 2008-09-19 stephan: puts "headers:\tpage_index.h makeheaders \$(TRANS_SRC) VERSION.h" dbda8d6ce9 2007-07-21 drh: puts "\t./makeheaders $mhargs" c699c491df 2008-09-19 stephan: puts "\ttouch headers" c699c491df 2008-09-19 stephan: puts "headers: Makefile" c699c491df 2008-09-19 stephan: puts "Makefile:" dbda8d6ce9 2007-07-21 drh: set extra_h(main) page_index.h dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: foreach s [lsort $src] { dbda8d6ce9 2007-07-21 drh: puts "${s}_.c:\t\$(SRCDIR)/$s.c \$(SRCDIR)/VERSION translate" dbda8d6ce9 2007-07-21 drh: puts "\t./translate \$(SRCDIR)/$s.c | sed -f \$(SRCDIR)/VERSION >${s}_.c\n" dbda8d6ce9 2007-07-21 drh: puts "$s.o:\t${s}_.c $s.h $extra_h($s) \$(SRCDIR)/config.h" dbda8d6ce9 2007-07-21 drh: puts "\t\$(XTCC) -o $s.o -c ${s}_.c\n" c699c491df 2008-09-19 stephan: puts "$s.h:\theaders" c699c491df 2008-09-19 stephan: # puts "\t./makeheaders $mhargs\n\ttouch headers\n" c699c491df 2008-09-19 stephan: # puts "\t./makeheaders ${s}_.c:${s}.h\n" dbda8d6ce9 2007-07-21 drh: } dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: puts "sqlite3.o:\t\$(SRCDIR)/sqlite3.c" dbda8d6ce9 2007-07-21 drh: set opt {-DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_PRIVATE=} f394d84560 2007-11-25 drh: append opt " -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4" f394d84560 2007-11-25 drh: append opt " -DSQLITE_ENABLE_FTS3=1" dbda8d6ce9 2007-07-21 drh: puts "\t\$(XTCC) $opt -c \$(SRCDIR)/sqlite3.c -o sqlite3.o\n" 4ee9e31a2d 2008-02-13 drh: 4ee9e31a2d 2008-02-13 drh: puts "th.o:\t\$(SRCDIR)/th.c" 4ee9e31a2d 2008-02-13 drh: puts "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th.c -o th.o\n" 4ee9e31a2d 2008-02-13 drh: 4ee9e31a2d 2008-02-13 drh: puts "th_lang.o:\t\$(SRCDIR)/th_lang.c" 4ee9e31a2d 2008-02-13 drh: puts "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th_lang.c -o th_lang.o\n" c699c491df 2008-09-19 stephan: