| | @@ -308,11 +308,11 @@ |
| 308 | 308 | writeln "\t\$(XTCC) -c \$(SRCDIR)/th_tcl.c -o \$(OBJDIR)/th_tcl.o\n" |
| 309 | 309 | |
| 310 | 310 | set opt {} |
| 311 | 311 | writeln { |
| 312 | 312 | $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c |
| 313 | | - $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE |
| 313 | + $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o |
| 314 | 314 | |
| 315 | 315 | # |
| 316 | 316 | # The list of all the targets that do not correspond to real files. This stops |
| 317 | 317 | # 'make' from getting confused when someone makes an error in a rule. |
| 318 | 318 | # |
| | @@ -751,11 +751,11 @@ |
| 751 | 751 | set opt $SQLITE_OPTIONS |
| 752 | 752 | writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/sqlite3.c -o \$(OBJDIR)/sqlite3.o\n" |
| 753 | 753 | |
| 754 | 754 | set opt {} |
| 755 | 755 | writeln "\$(OBJDIR)/cson_amalgamation.o:\t\$(SRCDIR)/cson_amalgamation.c" |
| 756 | | -writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/cson_amalgamation.c -o \$(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE\n" |
| 756 | +writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/cson_amalgamation.c -o \$(OBJDIR)/cson_amalgamation.o\n" |
| 757 | 757 | writeln "\$(OBJDIR)/json.o \$(OBJDIR)/json_artifact.o \$(OBJDIR)/json_branch.o \$(OBJDIR)/json_config.o \$(OBJDIR)/json_diff.o \$(OBJDIR)/json_dir.o \$(OBJDIR)/jsos_finfo.o \$(OBJDIR)/json_login.o \$(OBJDIR)/json_query.o \$(OBJDIR)/json_report.o \$(OBJDIR)/json_tag.o \$(OBJDIR)/json_timeline.o \$(OBJDIR)/json_user.o \$(OBJDIR)/json_wiki.o : \$(SRCDIR)/json_detail.h\n" |
| 758 | 758 | |
| 759 | 759 | writeln "\$(OBJDIR)/shell.o:\t\$(SRCDIR)/shell.c \$(SRCDIR)/sqlite3.h" |
| 760 | 760 | set opt {-Dmain=sqlite3_shell} |
| 761 | 761 | append opt " -DSQLITE_OMIT_LOAD_EXTENSION=1" |
| | @@ -959,18 +959,35 @@ |
| 959 | 959 | |
| 960 | 960 | # zlib options |
| 961 | 961 | ZINCDIR = $(B)\compat\zlib |
| 962 | 962 | ZLIBDIR = $(B)\compat\zlib |
| 963 | 963 | ZLIB = zlib.lib |
| 964 | + |
| 965 | +# Uncomment to enable JSON API |
| 966 | +# FOSSIL_ENABLE_JSON = 1 |
| 967 | + |
| 968 | +# Uncomment to enable markdown support |
| 969 | +# FOSSIL_ENABLE_MARKDOWN = 1 |
| 964 | 970 | |
| 965 | 971 | INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR) |
| 966 | 972 | |
| 967 | 973 | CFLAGS = -nologo -MT -O2 |
| 968 | 974 | BCC = $(CC) $(CFLAGS) |
| 969 | 975 | TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL) |
| 976 | +RCC = rc -D_WIN32 -D_MSC_VER $(INCL) |
| 970 | 977 | LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB) |
| 971 | 978 | LIBDIR = -LIBPATH:$(ZLIBDIR) |
| 979 | + |
| 980 | +!ifdef FOSSIL_ENABLE_JSON |
| 981 | +TCC = $(TCC) -DFOSSIL_ENABLE_JSON |
| 982 | +RCC = $(RCC) -DFOSSIL_ENABLE_JSON |
| 983 | +!endif |
| 984 | + |
| 985 | +!ifdef FOSSIL_ENABLE_MARKDOWN |
| 986 | +TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN |
| 987 | +RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN |
| 988 | +!endif |
| 972 | 989 | } |
| 973 | 990 | regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS |
| 974 | 991 | set j " \\\n " |
| 975 | 992 | writeln "SQLITE_OPTIONS = [join $MSC_SQLITE_OPTIONS $j]\n" |
| 976 | 993 | writeln -nonewline "SRC = " |
| | @@ -981,24 +998,22 @@ |
| 981 | 998 | writeln -nonewline " " |
| 982 | 999 | } |
| 983 | 1000 | writeln -nonewline "${s}_.c"; incr i |
| 984 | 1001 | } |
| 985 | 1002 | writeln "\n" |
| 1003 | +set AdditionalObj [list shell sqlite3 th th_lang cson_amalgamation] |
| 986 | 1004 | writeln -nonewline "OBJ = " |
| 987 | 1005 | set i 0 |
| 988 | | -foreach s [lsort $src] { |
| 1006 | +foreach s [lsort [concat $src $AdditionalObj]] { |
| 989 | 1007 | if {$i > 0} { |
| 990 | 1008 | writeln " \\" |
| 991 | 1009 | writeln -nonewline " " |
| 992 | 1010 | } |
| 993 | 1011 | writeln -nonewline "\$(OX)\\$s\$O"; incr i |
| 994 | 1012 | } |
| 995 | 1013 | writeln " \\" |
| 996 | | -writeln " \$(OX)\\shell\$O \\" |
| 997 | | -writeln " \$(OX)\\sqlite3\$O \\" |
| 998 | | -writeln " \$(OX)\\th\$O \\" |
| 999 | | -writeln " \$(OX)\\th_lang\$O" |
| 1014 | +writeln -nonewline " \$(OX)\\fossil.res\n" |
| 1000 | 1015 | writeln { |
| 1001 | 1016 | APPNAME = $(OX)\fossil$(E) |
| 1002 | 1017 | |
| 1003 | 1018 | all: $(OX) $(APPNAME) |
| 1004 | 1019 | |
| | @@ -1006,15 +1021,15 @@ |
| 1006 | 1021 | @echo Building zlib from "$(ZLIBDIR)"... |
| 1007 | 1022 | @pushd "$(ZLIBDIR)" && nmake /f win32\Makefile.msc $(ZLIB) && popd |
| 1008 | 1023 | |
| 1009 | 1024 | $(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts zlib |
| 1010 | 1025 | cd $(OX) |
| 1011 | | - link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj @linkopts |
| 1026 | + link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj fossil.res @linkopts |
| 1012 | 1027 | |
| 1013 | 1028 | $(OX)\linkopts: $B\win\Makefile.msc} |
| 1014 | 1029 | set redir {>} |
| 1015 | | -foreach s [lsort [concat $src {shell sqlite3 th th_lang}]] { |
| 1030 | +foreach s [lsort [concat $src $AdditionalObj]] { |
| 1016 | 1031 | writeln "\techo \$(OX)\\$s.obj $redir \$@" |
| 1017 | 1032 | set redir {>>} |
| 1018 | 1033 | } |
| 1019 | 1034 | writeln "\techo \$(LIBS) >> \$@\n\n" |
| 1020 | 1035 | |
| | @@ -1047,12 +1062,12 @@ |
| 1047 | 1062 | $(OX)\th_lang$O : $(SRCDIR)\th_lang.c |
| 1048 | 1063 | $(TCC) /Fo$@ -c $** |
| 1049 | 1064 | |
| 1050 | 1065 | VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION |
| 1051 | 1066 | $** > $@ |
| 1052 | | -$(OBJDIR)\cson_amalgamation.h : $(SRCDIR)\cson_amalgamation.h |
| 1053 | | - cp $(SRCDIR)\cson_amalgamation.h $@ |
| 1067 | +$(OX)\cson_amalgamation$O : $(SRCDIR)\cson_amalgamation.c |
| 1068 | + $(TCC) /Fo$@ -c $** |
| 1054 | 1069 | |
| 1055 | 1070 | page_index.h: mkindex$E $(SRC) |
| 1056 | 1071 | $** > $@ |
| 1057 | 1072 | |
| 1058 | 1073 | clean: |
| | @@ -1062,10 +1077,11 @@ |
| 1062 | 1077 | -del *.h |
| 1063 | 1078 | -del *.map |
| 1064 | 1079 | -del *.manifest |
| 1065 | 1080 | -del headers |
| 1066 | 1081 | -del linkopts |
| 1082 | + -del *.res |
| 1067 | 1083 | |
| 1068 | 1084 | realclean: clean |
| 1069 | 1085 | -del $(APPNAME) |
| 1070 | 1086 | -del translate$E |
| 1071 | 1087 | -del mkindex$E |
| | @@ -1092,10 +1108,13 @@ |
| 1092 | 1108 | writeln "\$(OX)\\$s\$O : ${s}_.c ${s}.h" |
| 1093 | 1109 | writeln "\t\$(TCC) /Fo\$@ -c ${s}_.c\n" |
| 1094 | 1110 | writeln "${s}_.c : \$(SRCDIR)\\$s.c" |
| 1095 | 1111 | writeln "\ttranslate\$E \$** > \$@\n" |
| 1096 | 1112 | } |
| 1113 | + |
| 1114 | +writeln "fossil.res : ..\\win\\fossil.rc" |
| 1115 | +writeln "\t\$(RCC) -fo \$@ \$**" |
| 1097 | 1116 | |
| 1098 | 1117 | writeln "headers: makeheaders\$E page_index.h VERSION.h" |
| 1099 | 1118 | writeln -nonewline "\tmakeheaders\$E " |
| 1100 | 1119 | set i 0 |
| 1101 | 1120 | foreach s [lsort $src] { |
| 1102 | 1121 | |