Ticket #29622: fossil-configure.optflags.diff

File fossil-configure.optflags.diff, 23.3 KB (added by ci42, 13 years ago)

set ${configure.optflags} to -Os

  • Portfile

    diff -urN orig/Portfile new/Portfile
    old new  
    55
    66name                fossil
    77version             20110523151112
     8revision            1
    89categories          devel
    910platforms           darwin
    1011license             BSD
     
    3334depends_lib         port:zlib \
    3435                    port:openssl
    3536
    36 patchfiles          patch-Makefile.diff
     37patchfiles          patch-Makefile.diff \
     38                    patch-src-main.mk.diff \
     39                    patch-src-makemake.tcl.diff
     40
     41configure.optflags  -Os
    3742
    3843post-extract {
    3944    reinplace s|\$\(INSTALLDIR\)|\$(DESTDIR)/${prefix}/bin|g ${worksrcpath}/src/makemake.tcl
  • files/patch-src-main.mk.diff

    diff -urN orig/files/patch-src-main.mk.diff new/files/patch-src-main.mk.diff
    old new  
     1--- src/main.mk.orig    2011-05-28 21:39:46.000000000 +0200
     2+++ src/main.mk 2011-05-28 21:39:51.000000000 +0200
     3@@ -894,7 +894,7 @@
     4        $(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_STAT2 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o
     5 
     6 $(OBJDIR)/shell.o:     $(SRCDIR)/shell.c
     7-       $(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -Dfopen=fossil_fopen -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o
     8+       $(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o
     9 
     10 $(OBJDIR)/th.o:        $(SRCDIR)/th.c
     11        $(XTCC) -I$(SRCDIR) -c $(SRCDIR)/th.c -o $(OBJDIR)/th.o
  • files/patch-src-makemake.tcl.diff

    diff -urN orig/files/patch-src-makemake.tcl.diff new/files/patch-src-makemake.tcl.diff
    old new  
     1--- src/makemake.tcl.orig       2011-05-28 21:40:51.000000000 +0200
     2+++ src/makemake.tcl    2011-05-28 21:40:58.000000000 +0200
     3@@ -252,219 +252,7 @@
     4 writeln "\$(OBJDIR)/shell.o:\t\$(SRCDIR)/shell.c"
     5 set opt {-Dmain=sqlite3_shell}
     6 append opt " -DSQLITE_OMIT_LOAD_EXTENSION=1"
     7-append opt " -Dfopen=fossil_fopen"
     8-writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/shell.c -o \$(OBJDIR)/shell.o\n"
     9-
     10-writeln "\$(OBJDIR)/th.o:\t\$(SRCDIR)/th.c"
     11-writeln "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th.c -o \$(OBJDIR)/th.o\n"
     12-
     13-writeln "\$(OBJDIR)/th_lang.o:\t\$(SRCDIR)/th_lang.c"
     14-writeln "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th_lang.c -o \$(OBJDIR)/th_lang.o\n"
     15-
     16-close $output_file
     17-#
     18-# End of the main.mk output
     19-##############################################################################
     20-##############################################################################
     21-##############################################################################
     22-# Begin win/Makefile.mingw
     23-#
     24-puts "building ../win/Makefile.mingw"
     25-set output_file [open ../win/Makefile.mingw w]
     26-fconfigure $output_file -translation binary
     27-
     28-writeln {#!/usr/bin/make
     29-#
     30-# This is a makefile for us on windows using mingw.
     31-#
     32-#### The toplevel directory of the source tree.  Fossil can be built
     33-#    in a directory that is separate from the source tree.  Just change
     34-#    the following to point from the build directory to the src/ folder.
     35-#
     36-SRCDIR = src
     37-
     38-#### The directory into which object code files should be written.
     39-#
     40-#
     41-OBJDIR = wbld
     42-
     43-#### C Compiler and options for use in building executables that
     44-#    will run on the platform that is doing the build.  This is used
     45-#    to compile code-generator programs as part of the build process.
     46-#    See TCC below for the C compiler for building the finished binary.
     47-#
     48-BCC = gcc
     49-
     50-#### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
     51-#
     52-# FOSSIL_ENABLE_SSL=1
     53-
     54-#### The directory in which the zlib compression library is installed.
     55-#
     56-#
     57-ZLIBDIR = /programs/gnuwin32
     58-
     59-#### C Compile and options for use in building executables that
     60-#    will run on the target platform.  This is usually the same
     61-#    as BCC, unless you are cross-compiling.  This C compiler builds
     62-#    the finished binary for fossil.  The BCC compiler above is used
     63-#    for building intermediate code-generator tools.
     64-#
     65-TCC = gcc -Os -Wall -L$(ZLIBDIR)/lib -I$(ZLIBDIR)/include
     66-
     67-# With HTTPS support
     68-ifdef FOSSIL_ENABLE_SSL
     69-TCC += -static -DFOSSIL_ENABLE_SSL=1
     70-endif
     71-
     72-#### Extra arguments for linking the finished binary.  Fossil needs
     73-#    to link against the Z-Lib compression library.  There are no
     74-#    other dependencies.  We sometimes add the -static option here
     75-#    so that we can build a static executable that will run in a
     76-#    chroot jail.
     77-#
     78-#LIB = -lz -lws2_32
     79-# OpenSSL:
     80-ifdef FOSSIL_ENABLE_SSL
     81-LIB += -lssl -lcrypto -lgdi32
     82-endif
     83-LIB += -lmingwex -lz -lws2_32
     84-
     85-#### Tcl shell for use in running the fossil testsuite.  This is only
     86-#    used for testing.  If you do not run
     87-#
     88-TCLSH = tclsh
     89-
     90-#### Nullsoft installer makensis location
     91-#
     92-MAKENSIS = "c:\Program Files\NSIS\makensis.exe"
     93-
     94-#### Include a configuration file that can override any one of these settings.
     95-#
     96--include config.w32
     97-
     98-# STOP HERE
     99-# You should not need to change anything below this line
     100-#--------------------------------------------------------
     101-XTCC = $(TCC) $(CFLAGS) -I. -I$(SRCDIR)
     102-}
     103-writeln -nonewline "SRC ="
     104-foreach s [lsort $src] {
     105-  writeln -nonewline " \\\n  \$(SRCDIR)/$s.c"
     106-}
     107-writeln "\n"
     108-writeln -nonewline "TRANS_SRC ="
     109-foreach s [lsort $src] {
     110-  writeln -nonewline " \\\n  \$(OBJDIR)/${s}_.c"
     111-}
     112-writeln "\n"
     113-writeln -nonewline "OBJ ="
     114-foreach s [lsort $src] {
     115-  writeln -nonewline " \\\n \$(OBJDIR)/$s.o"
     116-}
     117-writeln "\n"
     118-writeln "APPNAME = ${name}.exe"
     119-writeln {TRANSLATE   = $(subst /,\\,$(OBJDIR)/translate.exe)
     120-MAKEHEADERS = $(subst /,\\,$(OBJDIR)/makeheaders.exe)
     121-MKINDEX     = $(subst /,\\,$(OBJDIR)/mkindex.exe)
     122-VERSION     = $(subst /,\\,$(OBJDIR)/version.exe)
     123-}
     124-
     125-writeln {
     126-all:   $(OBJDIR) $(APPNAME)
     127-
     128-$(OBJDIR)/icon.o:      $(SRCDIR)/../win/icon.rc
     129-       cp $(SRCDIR)/../win/icon.rc $(OBJDIR)
     130-       windres $(OBJDIR)/icon.rc -o $(OBJDIR)/icon.o
     131-
     132-install:       $(APPNAME)
     133-       mv $(APPNAME) $(DESTDIR)//opt/local/bin
     134 
     135-$(OBJDIR):
     136-       mkdir $(OBJDIR)
     137-
     138-$(OBJDIR)/translate:   $(SRCDIR)/translate.c
     139-       $(BCC) -o $(OBJDIR)/translate $(SRCDIR)/translate.c
     140-
     141-$(OBJDIR)/makeheaders: $(SRCDIR)/makeheaders.c
     142-       $(BCC) -o $(OBJDIR)/makeheaders $(SRCDIR)/makeheaders.c
     143-
     144-$(OBJDIR)/mkindex:     $(SRCDIR)/mkindex.c
     145-       $(BCC) -o $(OBJDIR)/mkindex $(SRCDIR)/mkindex.c
     146-
     147-$(VERSION): $(SRCDIR)/../win/version.c
     148-       $(BCC) -o $(OBJDIR)/version $(SRCDIR)/../win/version.c
     149-
     150-# WARNING. DANGER. Running the testsuite modifies the repository the
     151-# build is done from, i.e. the checkout belongs to. Do not sync/push
     152-# the repository after running the tests.
     153-test:  $(APPNAME)
     154-       $(TCLSH) test/tester.tcl $(APPNAME)
     155-
     156-$(OBJDIR)/VERSION.h:   $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(VERSION)
     157-       $(VERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest >$(OBJDIR)/VERSION.h
     158-
     159-EXTRAOBJ = \
     160-  $(OBJDIR)/sqlite3.o \
     161-  $(OBJDIR)/shell.o \
     162-  $(OBJDIR)/th.o \
     163-  $(OBJDIR)/th_lang.o
     164-
     165-$(APPNAME):    $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/icon.o
     166-       $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/icon.o
     167-
     168-# This rule prevents make from using its default rules to try build
     169-# an executable named "manifest" out of the file named "manifest.c"
     170-#
     171-$(SRCDIR)/../manifest:
     172-       # noop
     173-
     174-# Requires msys to be installed in addition to the mingw, for the "rm"
     175-# command.  "del" will not work here because it is not a separate command
     176-# but a MSDOS-shell builtin.
     177-#
     178-clean:
     179-       rm -rf $(OBJDIR) $(APPNAME)
     180-
     181-setup: $(OBJDIR) $(APPNAME)
     182-       $(MAKENSIS) ./fossil.nsi
     183-
     184-}
     185-
     186-set mhargs {}
     187-foreach s [lsort $src] {
     188-  append mhargs " \$(OBJDIR)/${s}_.c:\$(OBJDIR)/$s.h"
     189-  set extra_h($s) {}
     190-}
     191-append mhargs " \$(SRCDIR)/sqlite3.h"
     192-append mhargs " \$(SRCDIR)/th.h"
     193-append mhargs " \$(OBJDIR)/VERSION.h"
     194-writeln "\$(OBJDIR)/page_index.h: \$(TRANS_SRC) \$(OBJDIR)/mkindex"
     195-writeln "\t\$(MKINDEX) \$(TRANS_SRC) >$@"
     196-writeln "\$(OBJDIR)/headers:\t\$(OBJDIR)/page_index.h \$(OBJDIR)/makeheaders \$(OBJDIR)/VERSION.h"
     197-writeln "\t\$(MAKEHEADERS) $mhargs"
     198-writeln "\techo Done >\$(OBJDIR)/headers"
     199-writeln ""
     200-writeln "\$(OBJDIR)/headers: Makefile"
     201-writeln "Makefile:"
     202-set extra_h(main) \$(OBJDIR)/page_index.h
     203-
     204-foreach s [lsort $src] {
     205-  writeln "\$(OBJDIR)/${s}_.c:\t\$(SRCDIR)/$s.c \$(OBJDIR)/translate"
     206-  writeln "\t\$(TRANSLATE) \$(SRCDIR)/$s.c >\$(OBJDIR)/${s}_.c\n"
     207-  writeln "\$(OBJDIR)/$s.o:\t\$(OBJDIR)/${s}_.c \$(OBJDIR)/$s.h $extra_h($s) \$(SRCDIR)/config.h"
     208-  writeln "\t\$(XTCC) -o \$(OBJDIR)/$s.o -c \$(OBJDIR)/${s}_.c\n"
     209-  writeln "$s.h:\t\$(OBJDIR)/headers"
     210-}
     211-
     212-
     213-writeln "\$(OBJDIR)/sqlite3.o:\t\$(SRCDIR)/sqlite3.c"
     214-set opt $SQLITE_OPTIONS
     215-writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/sqlite3.c -o \$(OBJDIR)/sqlite3.o\n"
     216-
     217-writeln "\$(OBJDIR)/shell.o:\t\$(SRCDIR)/shell.c"
     218-set opt {-Dmain=sqlite3_shell}
     219-append opt " -DSQLITE_OMIT_LOAD_EXTENSION=1"
     220 writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/shell.c -o \$(OBJDIR)/shell.o\n"
     221 
     222 writeln "\$(OBJDIR)/th.o:\t\$(SRCDIR)/th.c"
     223@@ -473,471 +261,9 @@
     224 writeln "\$(OBJDIR)/th_lang.o:\t\$(SRCDIR)/th_lang.c"
     225 writeln "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th_lang.c -o \$(OBJDIR)/th_lang.o\n"
     226 
     227-
     228 close $output_file
     229 #
     230 # End of the main.mk output
     231 ##############################################################################
     232 ##############################################################################
     233 ##############################################################################
     234-# Begin win/Makefile.dmc
     235-#
     236-puts "building ../win/Makefile.dmc"
     237-set output_file [open ../win/Makefile.dmc w]
     238-fconfigure $output_file -translation binary
     239-
     240-writeln {# DO NOT EDIT
     241-#
     242-# This file is automatically generated.  Instead of editing this
     243-# file, edit "makemake.tcl" then run "tclsh src/makemake.tcl"
     244-# to regenerate this file.
     245-B      = ..
     246-SRCDIR = $B\src
     247-OBJDIR = .
     248-O      = .obj
     249-E      = .exe
     250-
     251-
     252-# Maybe DMDIR, SSL or INCL needs adjustment
     253-DMDIR  = c:\DM
     254-INCL   = -I. -I$(SRCDIR) -I$B\win\include -I$(DMDIR)\extra\include
     255-
     256-#SSL   =  -DFOSSIL_ENABLE_SSL=1
     257-SSL    =
     258-
     259-CFLAGS = -o
     260-BCC    = $(DMDIR)\bin\dmc $(CFLAGS)
     261-TCC    = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL)
     262-LIBS   = $(DMDIR)\extra\lib\ zlib wsock32
     263-}
     264-writeln "SQLITE_OPTIONS = $SQLITE_OPTIONS\n"
     265-writeln -nonewline "SRC   = "
     266-foreach s [lsort $src] {
     267-  writeln -nonewline "${s}_.c "
     268-}
     269-writeln "\n"
     270-writeln -nonewline "OBJ   = "
     271-foreach s [lsort $src] {
     272-  writeln -nonewline "\$(OBJDIR)\\$s\$O "
     273-}
     274-writeln "\$(OBJDIR)\\shell\$O \$(OBJDIR)\\sqlite3\$O \$(OBJDIR)\\th\$O \$(OBJDIR)\\th_lang\$O "
     275-writeln {
     276-
     277-RC=$(DMDIR)\bin\rcc
     278-RCFLAGS=-32 -w1 -I$(SRCDIR) /D__DMC__
     279-
     280-APPNAME = $(OBJDIR)\fossil$(E)
     281-
     282-all: $(APPNAME)
     283-
     284-$(APPNAME) : translate$E mkindex$E headers  $(OBJ) $(OBJDIR)\link
     285-       cd $(OBJDIR)
     286-       $(DMDIR)\bin\link @link
     287-
     288-$(OBJDIR)\fossil.res:  $B\win\fossil.rc
     289-       $(RC) $(RCFLAGS) -o$@ $**
     290-
     291-$(OBJDIR)\link: $B\win\Makefile.dmc $(OBJDIR)\fossil.res}
     292-writeln -nonewline "\t+echo "
     293-foreach s [lsort $src] {
     294-  writeln -nonewline "$s "
     295-}
     296-writeln "shell sqlite3 th th_lang > \$@"
     297-writeln "\t+echo fossil >> \$@"
     298-writeln "\t+echo fossil >> \$@"
     299-writeln "\t+echo \$(LIBS) >> \$@"
     300-writeln "\t+echo. >> \$@"
     301-writeln "\t+echo fossil >> \$@"
     302-
     303-writeln {
     304-translate$E: $(SRCDIR)\translate.c
     305-       $(BCC) -o$@ $**
     306-
     307-makeheaders$E: $(SRCDIR)\makeheaders.c
     308-       $(BCC) -o$@ $**
     309-
     310-mkindex$E: $(SRCDIR)\mkindex.c
     311-       $(BCC) -o$@ $**
     312-
     313-version$E: $B\win\version.c
     314-       $(BCC) -o$@ $**
     315-
     316-$(OBJDIR)\shell$O : $(SRCDIR)\shell.c
     317-       $(TCC) -o$@ -c -Dmain=sqlite3_shell $(SQLITE_OPTIONS) $**
     318-
     319-$(OBJDIR)\sqlite3$O : $(SRCDIR)\sqlite3.c
     320-       $(TCC) -o$@ -c $(SQLITE_OPTIONS) $**
     321-
     322-$(OBJDIR)\th$O : $(SRCDIR)\th.c
     323-       $(TCC) -o$@ -c $**
     324-
     325-$(OBJDIR)\th_lang$O : $(SRCDIR)\th_lang.c
     326-       $(TCC) -o$@ -c $**
     327-
     328-VERSION.h : version$E $B\manifest.uuid $B\manifest
     329-       +$** > $@
     330-
     331-page_index.h: mkindex$E $(SRC)
     332-       +$** > $@
     333-
     334-clean:
     335-       -del $(OBJDIR)\*.obj
     336-       -del *.obj *_.c *.h *.map
     337-
     338-realclean:
     339-       -del $(APPNAME) translate$E mkindex$E makeheaders$E version$E
     340-
     341-}
     342-foreach s [lsort $src] {
     343-  writeln "\$(OBJDIR)\\$s\$O : ${s}_.c ${s}.h"
     344-  writeln "\t\$(TCC) -o\$@ -c ${s}_.c\n"
     345-  writeln "${s}_.c : \$(SRCDIR)\\$s.c"
     346-  writeln "\t+translate\$E \$** > \$@\n"
     347-}
     348-
     349-writeln -nonewline "headers: makeheaders\$E page_index.h VERSION.h\n\t +makeheaders\$E "
     350-foreach s [lsort $src] {
     351-  writeln -nonewline "${s}_.c:$s.h "
     352-}
     353-writeln "\$(SRCDIR)\\sqlite3.h \$(SRCDIR)\\th.h VERSION.h"
     354-writeln "\t@copy /Y nul: headers"
     355-
     356-close $output_file
     357-#
     358-# End of the win/Makefile.dmc output
     359-##############################################################################
     360-##############################################################################
     361-##############################################################################
     362-# Begin win/Makefile.msc
     363-#
     364-puts "building ../win/Makefile.msc"
     365-set output_file [open ../win/Makefile.msc w]
     366-fconfigure $output_file -translation binary
     367-
     368-writeln {# DO NOT EDIT
     369-#
     370-# This file is automatically generated.  Instead of editing this
     371-# file, edit "makemake.tcl" then run "tclsh src/makemake.tcl"
     372-# to regenerate this file.
     373-B      = ..
     374-SRCDIR = $B\src
     375-OBJDIR = .
     376-OX     = .
     377-O      = .obj
     378-E      = .exe
     379-
     380-# Maybe MSCDIR, SSL, ZLIB, or INCL needs adjustment
     381-MSCDIR = c:\msc
     382-
     383-# Uncomment below for SSL support
     384-SSL =
     385-SSLLIB =
     386-#SSL = -DFOSSIL_ENABLE_SSL=1
     387-#SSLLIB  = ssleay32.lib libeay32.lib user32.lib gdi32.lib advapi32.lib
     388-
     389-# zlib options
     390-# When using precompiled from http://zlib.net/zlib125-dll.zip
     391-#ZINCDIR = C:\zlib125-dll\include
     392-#ZLIBDIR = C:\zlib125-dll\lib
     393-#ZLIB    = zdll.lib
     394-ZINCDIR = $(MSCDIR)\extra\include
     395-ZLIBDIR = $(MSCDIR)\extra\lib
     396-ZLIB    = zlib.lib
     397-
     398-INCL   = -I. -I$(SRCDIR) -I$B\win\include -I$(MSCDIR)\extra\include -I$(ZINCDIR)
     399-
     400-CFLAGS = -nologo -MT -O2
     401-BCC    = $(CC) $(CFLAGS)
     402-TCC    = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
     403-LIBS   = $(ZLIB) ws2_32.lib $(SSLLIB)
     404-LIBDIR = -LIBPATH:$(MSCDIR)\extra\lib -LIBPATH:$(ZLIBDIR)
     405-}
     406-regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS
     407-writeln "SQLITE_OPTIONS = $MSC_SQLITE_OPTIONS\n"
     408-writeln -nonewline "SRC   = "
     409-foreach s [lsort $src] {
     410-  writeln -nonewline "${s}_.c "
     411-}
     412-writeln "\n"
     413-writeln -nonewline "OBJ   = "
     414-foreach s [lsort $src] {
     415-  writeln -nonewline "\$(OX)\\$s\$O "
     416-}
     417-writeln "\$(OX)\\shell\$O \$(OX)\\sqlite3\$O \$(OX)\\th\$O \$(OX)\\th_lang\$O "
     418-writeln {
     419-
     420-APPNAME = $(OX)\fossil$(E)
     421-
     422-all: $(OX) $(APPNAME)
     423-
     424-$(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts
     425-       cd $(OX)
     426-       link -LINK -OUT:$@ $(LIBDIR) @linkopts
     427-
     428-$(OX)\linkopts: $B\win\Makefile.msc}
     429-writeln -nonewline "\techo "
     430-foreach s [lsort $src] {
     431-  writeln -nonewline "$s "
     432-}
     433-writeln "sqlite3 th th_lang > \$@"
     434-writeln "\techo \$(LIBS) >> \$@\n\n"
     435-
     436-writeln {
     437-
     438-$(OX):
     439-       @-mkdir $@
     440-
     441-translate$E: $(SRCDIR)\translate.c
     442-       $(BCC) $**
     443-
     444-makeheaders$E: $(SRCDIR)\makeheaders.c
     445-       $(BCC) $**
     446-
     447-mkindex$E: $(SRCDIR)\mkindex.c
     448-       $(BCC) $**
     449-
     450-version$E: $B\win\version.c
     451-       $(BCC) $**
     452-
     453-$(OX)\shell$O : $(SRCDIR)\shell.c
     454-       $(TCC) /Fo$@ /Dmain=sqlite3_shell $(SQLITE_OPTIONS) -c shell_.c
     455-
     456-$(OX)\sqlite3$O : $(SRCDIR)\sqlite3.c
     457-       $(TCC) /Fo$@ -c $(SQLITE_OPTIONS) $**
     458-
     459-$(OX)\th$O : $(SRCDIR)\th.c
     460-       $(TCC) /Fo$@ -c $**
     461-
     462-$(OX)\th_lang$O : $(SRCDIR)\th_lang.c
     463-       $(TCC) /Fo$@ -c $**
     464-
     465-VERSION.h : version$E $B\manifest.uuid $B\manifest
     466-       $** > $@
     467-
     468-page_index.h: mkindex$E $(SRC)
     469-       $** > $@
     470-
     471-clean:
     472-       -del $(OX)\*.obj
     473-       -del *.obj *_.c *.h *.map
     474-       -del headers linkopts
     475-
     476-realclean:
     477-       -del $(APPNAME) translate$E mkindex$E makeheaders$E version$E
     478-
     479-}
     480-foreach s [lsort $src] {
     481-  writeln "\$(OX)\\$s\$O : ${s}_.c ${s}.h"
     482-  writeln "\t\$(TCC) /Fo\$@ -c ${s}_.c\n"
     483-  writeln "${s}_.c : \$(SRCDIR)\\$s.c"
     484-  writeln "\ttranslate\$E \$** > \$@\n"
     485-}
     486-
     487-writeln -nonewline "headers: makeheaders\$E page_index.h VERSION.h\n\tmakeheaders\$E "
     488-foreach s [lsort $src] {
     489-  writeln -nonewline "${s}_.c:$s.h "
     490-}
     491-writeln "\$(SRCDIR)\\sqlite3.h \$(SRCDIR)\\th.h VERSION.h"
     492-writeln "\t@copy /Y nul: headers"
     493-
     494-
     495-close $output_file
     496-#
     497-# End of the win/Makefile.msc output
     498-##############################################################################
     499-##############################################################################
     500-##############################################################################
     501-# Begin win/Makefile.PellesCGMake
     502-#
     503-puts "building ../win/Makefile.PellesCGMake"
     504-set output_file [open ../win/Makefile.PellesCGMake w]
     505-fconfigure $output_file -translation binary
     506-
     507-writeln {# DO NOT EDIT
     508-#
     509-# This file is automatically generated.  Instead of editing this
     510-# file, edit "makemake.tcl" then run "tclsh src/makemake.tcl"
     511-# to regenerate this file.
     512-#
     513-# HowTo
     514-# -----
     515-#
     516-# This is a Makefile to compile fossil with PellesC from
     517-#  http://www.smorgasbordet.com/pellesc/index.htm
     518-# In addition to the Compiler envrionment, you need
     519-#  gmake from http://sourceforge.net/projects/unxutils/, Pelles make version
     520-#        couldn't handle the complex dependencies in this build
     521-#  zlib sources
     522-# Then you do
     523-# 1. create a directory PellesC in the project root directory
     524-# 2. Change the variables PellesCDir/ZLIBSRCDIR to the path of your installation
     525-# 3. open a dos prompt window and change working directory into PellesC (step 1)
     526-# 4. run gmake -f ..\win\Makefile.PellesCGMake
     527-#
     528-# this file is tested with
     529-#   PellesC         5.00.13
     530-#   gmake           3.80
     531-#   zlib sources    1.2.5
     532-#   Windows XP SP 2
     533-# and
     534-#   PellesC         6.00.4
     535-#   gmake           3.80
     536-#   zlib sources    1.2.5
     537-#   Windows 7 Home Premium
     538-# 
     539-
     540-# 
     541-PellesCDir=c:\Programme\PellesC
     542-
     543-# Select between 32/64 bit code, default is 32 bit
     544-#TARGETVERSION=64
     545-
     546-ifeq ($(TARGETVERSION),64)
     547-# 64 bit version
     548-TARGETMACHINE_CC=amd64
     549-TARGETMACHINE_LN=amd64
     550-TARGETEXTEND=64
     551-else
     552-# 32 bit version
     553-TARGETMACHINE_CC=x86
     554-TARGETMACHINE_LN=ix86
     555-TARGETEXTEND=
     556-endif
     557-
     558-# define the project directories
     559-B=..
     560-SRCDIR=$(B)/src/
     561-WINDIR=$(B)/win/
     562-ZLIBSRCDIR=../../zlib/
     563-
     564-# define linker command and options
     565-LINK=$(PellesCDir)/bin/polink.exe
     566-LINKFLAGS=-subsystem:console -machine:$(TARGETMACHINE_LN) /LIBPATH:$(PellesCDir)\lib\win$(TARGETEXTEND) /LIBPATH:$(PellesCDir)\lib kernel32.lib advapi32.lib delayimp$(TARGETEXTEND).lib Wsock32.lib Crtmt$(TARGETEXTEND).lib
     567-
     568-# define standard C-compiler and flags, used to compile
     569-# the fossil binary. Some special definitions follow for
     570-# special files follow
     571-CC=$(PellesCDir)\bin\pocc.exe
     572-DEFINES=-D_pgmptr=g.argv[0]
     573-CCFLAGS=-T$(TARGETMACHINE_CC)-coff -Ot -W2 -Gd -Go -Ze -MT $(DEFINES)
     574-INCLUDE=/I $(PellesCDir)\Include\Win /I $(PellesCDir)\Include /I $(ZLIBSRCDIR) /I $(SRCDIR)
     575-
     576-# define commands for building the windows resource files
     577-RESOURCE=fossil.res
     578-RC=$(PellesCDir)\bin\porc.exe
     579-RCFLAGS=$(INCLUDE) -D__POCC__=1 -D_M_X$(TARGETVERSION)
     580-
     581-# define the special utilities files, needed to generate
     582-# the automatically generated source files
     583-UTILS=translate.exe mkindex.exe makeheaders.exe
     584-UTILS_OBJ=$(UTILS:.exe=.obj)
     585-UTILS_SRC=$(foreach uf,$(UTILS),$(SRCDIR)$(uf:.exe=.c))
     586-
     587-# define the sqlite files, which need special flags on compile
     588-SQLITESRC=sqlite3.c
     589-ORIGSQLITESRC=$(foreach sf,$(SQLITESRC),$(SRCDIR)$(sf))
     590-SQLITEOBJ=$(foreach sf,$(SQLITESRC),$(sf:.c=.obj))
     591-SQLITEDEFINES=-DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0
     592-
     593-# define the sqlite shell files, which need special flags on compile
     594-SQLITESHELLSRC=shell.c
     595-ORIGSQLITESHELLSRC=$(foreach sf,$(SQLITESHELLSRC),$(SRCDIR)$(sf))
     596-SQLITESHELLOBJ=$(foreach sf,$(SQLITESHELLSRC),$(sf:.c=.obj))
     597-SQLITESHELLDEFINES=-Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1
     598-
     599-# define the th scripting files, which need special flags on compile
     600-THSRC=th.c th_lang.c
     601-ORIGTHSRC=$(foreach sf,$(THSRC),$(SRCDIR)$(sf))
     602-THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj))
     603-
     604-# define the zlib files, needed by this compile
     605-ZLIBSRC=adler32.c compress.c crc32.c deflate.c gzclose.c gzlib.c gzread.c gzwrite.c infback.c inffast.c inflate.c inftrees.c trees.c uncompr.c zutil.c
     606-ORIGZLIBSRC=$(foreach sf,$(ZLIBSRC),$(ZLIBSRCDIR)$(sf))
     607-ZLIBOBJ=$(foreach sf,$(ZLIBSRC),$(sf:.c=.obj))
     608-
     609-# define all fossil sources, using the standard compile and
     610-# source generation. These are all files in SRCDIR, which are not
     611-# mentioned as special files above:
     612-ORIGSRC=$(filter-out $(UTILS_SRC) $(ORIGTHSRC) $(ORIGSQLITESRC) $(ORIGSQLITESHELLSRC),$(wildcard $(SRCDIR)*.c))
     613-SRC=$(subst $(SRCDIR),,$(ORIGSRC))
     614-TRANSLATEDSRC=$(SRC:.c=_.c)
     615-TRANSLATEDOBJ=$(TRANSLATEDSRC:.c=.obj)
     616-
     617-# main target file is the application
     618-APPLICATION=fossil.exe
     619-
     620-# define the standard make target
     621-.PHONY:        default
     622-default:       page_index.h headers $(APPLICATION)
     623-
     624-# symbolic target to generate the source generate utils
     625-.PHONY:        utils
     626-utils: $(UTILS)
     627-
     628-# link utils
     629-$(UTILS) version.exe:  %.exe:  %.obj
     630-       $(LINK) $(LINKFLAGS) -out:"$@" $<
     631-
     632-# compiling standard fossil utils
     633-$(UTILS_OBJ):  %.obj:  $(SRCDIR)%.c
     634-       $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
     635-
     636-# compile special windows utils
     637-version.obj:   $(WINDIR)version.c
     638-       $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
     639-
     640-# generate the translated c-source files
     641-$(TRANSLATEDSRC):      %_.c:   $(SRCDIR)%.c translate.exe
     642-       translate.exe $< >$@
     643-
     644-# generate the index source, containing all web references,..
     645-page_index.h:  $(TRANSLATEDSRC) mkindex.exe
     646-       mkindex.exe $(TRANSLATEDSRC) >$@
     647-
     648-# extracting version info from manifest
     649-VERSION.h:     version.exe ..\manifest.uuid ..\manifest
     650-       version.exe ..\manifest.uuid ..\manifest  > $@
     651-
     652-# generate the simplified headers
     653-headers: makeheaders.exe page_index.h VERSION.h ../src/sqlite3.h ../src/th.h VERSION.h
     654-       makeheaders.exe $(foreach ts,$(TRANSLATEDSRC),$(ts):$(ts:_.c=.h)) ../src/sqlite3.h ../src/th.h VERSION.h
     655-       echo Done >$@
     656-
     657-# compile C sources with relevant options
     658-
     659-$(TRANSLATEDOBJ):      %_.obj: %_.c %.h
     660-       $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
     661-
     662-$(SQLITEOBJ):  %.obj:  $(SRCDIR)%.c $(SRCDIR)%.h
     663-       $(CC) $(CCFLAGS) $(SQLITEDEFINES) $(INCLUDE) "$<" -Fo"$@"
     664-
     665-$(SQLITESHELLOBJ):     %.obj:  $(SRCDIR)%.c
     666-       $(CC) $(CCFLAGS) $(SQLITESHELLDEFINES) $(INCLUDE) "$<" -Fo"$@"
     667-
     668-$(THOBJ):      %.obj:  $(SRCDIR)%.c $(SRCDIR)th.h
     669-       $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
     670-
     671-$(ZLIBOBJ):    %.obj:  $(ZLIBSRCDIR)%.c
     672-       $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
     673-
     674-# create the windows resource with icon and version info
     675-$(RESOURCE):   %.res:  ../win/%.rc ../win/*.ico
     676-       $(RC) $(RCFLAGS) $< -Fo"$@"
     677-
     678-# link the application
     679-$(APPLICATION):        $(TRANSLATEDOBJ) $(SQLITEOBJ) $(SQLITESHELLOBJ) $(THOBJ) $(ZLIBOBJ) headers $(RESOURCE)
     680-       $(LINK) $(LINKFLAGS) -out:"$@" $(TRANSLATEDOBJ) $(SQLITEOBJ) $(SQLITESHELLOBJ) $(THOBJ) $(ZLIBOBJ) $(RESOURCE)
     681-
     682-# cleanup
     683-
     684-.PHONY: clean
     685-clean:
     686-       del /F $(TRANSLATEDOBJ) $(SQLITEOBJ) $(THOBJ) $(ZLIBOBJ) $(UTILS_OBJ) version.obj
     687-       del /F $(TRANSLATEDSRC)
     688-       del /F *.h headers
     689-       del /F $(RESOURCE)
     690-
     691-.PHONY: clobber
     692-clobber: clean
     693-       del /F *.exe
     694-}