| | @@ -1015,54 +1015,78 @@ |
| 1015 | 1015 | # Uncomment to enable JSON API |
| 1016 | 1016 | # FOSSIL_ENABLE_JSON = 1 |
| 1017 | 1017 | |
| 1018 | 1018 | # Uncomment to enable SSL support |
| 1019 | 1019 | # FOSSIL_ENABLE_SSL = 1 |
| 1020 | + |
| 1021 | +# Uncomment to enable Tcl support |
| 1022 | +# FOSSIL_ENABLE_TCL = 1 |
| 1020 | 1023 | |
| 1021 | 1024 | !ifdef FOSSIL_ENABLE_SSL |
| 1022 | 1025 | SSLINCDIR = $(B)\compat\openssl-1.0.1f\include |
| 1023 | 1026 | SSLLIBDIR = $(B)\compat\openssl-1.0.1f\out32 |
| 1024 | 1027 | SSLLIB = ssleay32.lib libeay32.lib user32.lib gdi32.lib |
| 1025 | 1028 | !endif |
| 1029 | + |
| 1030 | +!ifdef FOSSIL_ENABLE_TCL |
| 1031 | +TCLDIR = $(B)\compat\tcl-8.6 |
| 1032 | +TCLSRCDIR = $(TCLDIR) |
| 1033 | +TCLINCDIR = $(TCLSRCDIR)\generic |
| 1034 | +!endif |
| 1026 | 1035 | |
| 1027 | 1036 | # zlib options |
| 1028 | 1037 | ZINCDIR = $(B)\compat\zlib |
| 1029 | 1038 | ZLIBDIR = $(B)\compat\zlib |
| 1030 | 1039 | ZLIB = zlib.lib |
| 1031 | 1040 | |
| 1032 | | -INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR) |
| 1041 | +INCL = /I. /I$(SRCDIR) /I$B\win\include /I$(ZINCDIR) |
| 1033 | 1042 | |
| 1034 | 1043 | !ifdef FOSSIL_ENABLE_SSL |
| 1035 | | -INCL = $(INCL) -I$(SSLINCDIR) |
| 1044 | +INCL = $(INCL) /I$(SSLINCDIR) |
| 1045 | +!endif |
| 1046 | + |
| 1047 | +!ifdef FOSSIL_ENABLE_TCL |
| 1048 | +INCL = $(INCL) /I$(TCLINCDIR) |
| 1036 | 1049 | !endif |
| 1037 | 1050 | |
| 1038 | | -CFLAGS = -nologo |
| 1051 | +CFLAGS = /nologo |
| 1039 | 1052 | LDFLAGS = /NODEFAULTLIB:msvcrt /MANIFEST:NO |
| 1040 | 1053 | |
| 1041 | 1054 | !ifdef DEBUG |
| 1042 | | -CFLAGS = $(CFLAGS) -Zi -MTd -Od |
| 1055 | +CFLAGS = $(CFLAGS) /Zi /MTd /Od |
| 1043 | 1056 | LDFLAGS = $(LDFLAGS) /DEBUG |
| 1044 | 1057 | !else |
| 1045 | | -CFLAGS = $(CFLAGS) -MT -O2 |
| 1058 | +CFLAGS = $(CFLAGS) /MT /O2 |
| 1046 | 1059 | !endif |
| 1047 | 1060 | |
| 1048 | 1061 | BCC = $(CC) $(CFLAGS) |
| 1049 | | -TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(INCL) |
| 1050 | | -RCC = rc -D_WIN32 -D_MSC_VER $(MSCDEF) $(INCL) |
| 1062 | +TCC = $(CC) /c $(CFLAGS) $(MSCDEF) $(INCL) |
| 1063 | +RCC = rc /D_WIN32 /D_MSC_VER $(MSCDEF) $(INCL) |
| 1051 | 1064 | LIBS = $(ZLIB) ws2_32.lib advapi32.lib |
| 1052 | | -LIBDIR = -LIBPATH:$(ZLIBDIR) |
| 1065 | +LIBDIR = /LIBPATH:$(ZLIBDIR) |
| 1053 | 1066 | |
| 1054 | 1067 | !ifdef FOSSIL_ENABLE_JSON |
| 1055 | | -TCC = $(TCC) -DFOSSIL_ENABLE_JSON=1 |
| 1056 | | -RCC = $(RCC) -DFOSSIL_ENABLE_JSON=1 |
| 1068 | +TCC = $(TCC) /DFOSSIL_ENABLE_JSON=1 |
| 1069 | +RCC = $(RCC) /DFOSSIL_ENABLE_JSON=1 |
| 1057 | 1070 | !endif |
| 1058 | 1071 | |
| 1059 | 1072 | !ifdef FOSSIL_ENABLE_SSL |
| 1060 | | -TCC = $(TCC) -DFOSSIL_ENABLE_SSL=1 |
| 1061 | | -RCC = $(RCC) -DFOSSIL_ENABLE_SSL=1 |
| 1073 | +TCC = $(TCC) /DFOSSIL_ENABLE_SSL=1 |
| 1074 | +RCC = $(RCC) /DFOSSIL_ENABLE_SSL=1 |
| 1062 | 1075 | LIBS = $(LIBS) $(SSLLIB) |
| 1063 | | -LIBDIR = $(LIBDIR) -LIBPATH:$(SSLLIBDIR) |
| 1076 | +LIBDIR = $(LIBDIR) /LIBPATH:$(SSLLIBDIR) |
| 1077 | +!endif |
| 1078 | + |
| 1079 | +!ifdef FOSSIL_ENABLE_TCL |
| 1080 | +TCC = $(TCC) /DFOSSIL_ENABLE_TCL=1 |
| 1081 | +RCC = $(RCC) /DFOSSIL_ENABLE_TCL=1 |
| 1082 | +TCC = $(TCC) /DFOSSIL_ENABLE_TCL_STUBS=1 |
| 1083 | +RCC = $(RCC) /DFOSSIL_ENABLE_TCL_STUBS=1 |
| 1084 | +TCC = $(TCC) /DFOSSIL_ENABLE_TCL_PRIVATE_STUBS=1 |
| 1085 | +RCC = $(RCC) /DFOSSIL_ENABLE_TCL_PRIVATE_STUBS=1 |
| 1086 | +TCC = $(TCC) /DUSE_TCL_STUBS=1 |
| 1087 | +RCC = $(RCC) /DUSE_TCL_STUBS=1 |
| 1064 | 1088 | !endif |
| 1065 | 1089 | } |
| 1066 | 1090 | regsub -all {[-]D} [join $SQLITE_OPTIONS { }] {/D} MSC_SQLITE_OPTIONS |
| 1067 | 1091 | set j " \\\n " |
| 1068 | 1092 | writeln "SQLITE_OPTIONS = [join $MSC_SQLITE_OPTIONS $j]\n" |
| | @@ -1090,11 +1114,14 @@ |
| 1090 | 1114 | writeln -nonewline " " |
| 1091 | 1115 | } |
| 1092 | 1116 | writeln -nonewline "\$(OX)\\$s\$O"; incr i |
| 1093 | 1117 | } |
| 1094 | 1118 | writeln " \\" |
| 1095 | | -writeln -nonewline " \$(OX)\\fossil.res\n" |
| 1119 | +writeln -nonewline " \$(OX)\\fossil.res\n\n" |
| 1120 | +writeln "!ifdef FOSSIL_ENABLE_TCL" |
| 1121 | +writeln "OBJ = \$(OBJ) \$(OX)\\th_tcl\$O" |
| 1122 | +writeln "!endif" |
| 1096 | 1123 | writeln { |
| 1097 | 1124 | APPNAME = $(OX)\fossil$(E) |
| 1098 | 1125 | PDBNAME = $(OX)\fossil$(P) |
| 1099 | 1126 | |
| 1100 | 1127 | all: $(OX) $(APPNAME) |
| | @@ -1103,22 +1130,24 @@ |
| 1103 | 1130 | @echo Building zlib from "$(ZLIBDIR)"... |
| 1104 | 1131 | @pushd "$(ZLIBDIR)" && nmake /f win32\Makefile.msc $(ZLIB) && popd |
| 1105 | 1132 | |
| 1106 | 1133 | $(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts zlib |
| 1107 | 1134 | cd $(OX) |
| 1108 | | - link $(LDFLAGS) -OUT:$@ $(LIBDIR) Wsetargv.obj fossil.res @linkopts |
| 1135 | + link $(LDFLAGS) /OUT:$@ $(LIBDIR) Wsetargv.obj fossil.res @linkopts |
| 1109 | 1136 | |
| 1110 | 1137 | $(OX)\linkopts: $B\win\Makefile.msc} |
| 1111 | 1138 | set redir {>} |
| 1112 | 1139 | foreach s [lsort [concat $src $AdditionalObj]] { |
| 1113 | 1140 | writeln "\techo \$(OX)\\$s.obj $redir \$@" |
| 1114 | 1141 | set redir {>>} |
| 1115 | 1142 | } |
| 1116 | | -writeln "\techo \$(LIBS) >> \$@\n\n" |
| 1117 | | - |
| 1143 | +writeln "!ifdef FOSSIL_ENABLE_TCL" |
| 1144 | +writeln "\techo \$(OX)\\th_tcl.obj $redir \$@" |
| 1145 | +set redir {>>} |
| 1146 | +writeln "!endif" |
| 1147 | +writeln "\techo \$(LIBS) $redir \$@" |
| 1118 | 1148 | writeln { |
| 1119 | | - |
| 1120 | 1149 | $(OX): |
| 1121 | 1150 | @-mkdir $@ |
| 1122 | 1151 | |
| 1123 | 1152 | translate$E: $(SRCDIR)\translate.c |
| 1124 | 1153 | $(BCC) $** |
| | @@ -1141,15 +1170,20 @@ |
| 1141 | 1170 | $(OX)\th$O : $(SRCDIR)\th.c |
| 1142 | 1171 | $(TCC) /Fo$@ -c $** |
| 1143 | 1172 | |
| 1144 | 1173 | $(OX)\th_lang$O : $(SRCDIR)\th_lang.c |
| 1145 | 1174 | $(TCC) /Fo$@ -c $** |
| 1175 | + |
| 1176 | +!ifdef FOSSIL_ENABLE_TCL |
| 1177 | +$(OX)\th_tcl$O : $(SRCDIR)\th_tcl.c |
| 1178 | + $(TCC) /Fo$@ -c $** |
| 1179 | +!endif |
| 1146 | 1180 | |
| 1147 | 1181 | VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION |
| 1148 | 1182 | $** > $@ |
| 1149 | 1183 | $(OX)\cson_amalgamation$O : $(SRCDIR)\cson_amalgamation.c |
| 1150 | | - $(TCC) /Fo$@ -c $** |
| 1184 | + $(TCC) /Fo$@ /c $** |
| 1151 | 1185 | |
| 1152 | 1186 | page_index.h: mkindex$E $(SRC) |
| 1153 | 1187 | $** > $@ |
| 1154 | 1188 | |
| 1155 | 1189 | clean: |
| | @@ -1184,21 +1218,20 @@ |
| 1184 | 1218 | $(OBJDIR)\json_status$O : $(SRCDIR)\json_detail.h |
| 1185 | 1219 | $(OBJDIR)\json_tag$O : $(SRCDIR)\json_detail.h |
| 1186 | 1220 | $(OBJDIR)\json_timeline$O : $(SRCDIR)\json_detail.h |
| 1187 | 1221 | $(OBJDIR)\json_user$O : $(SRCDIR)\json_detail.h |
| 1188 | 1222 | $(OBJDIR)\json_wiki$O : $(SRCDIR)\json_detail.h |
| 1189 | | - |
| 1190 | 1223 | } |
| 1191 | 1224 | foreach s [lsort $src] { |
| 1192 | 1225 | writeln "\$(OX)\\$s\$O : ${s}_.c ${s}.h" |
| 1193 | 1226 | writeln "\t\$(TCC) /Fo\$@ -c ${s}_.c\n" |
| 1194 | 1227 | writeln "${s}_.c : \$(SRCDIR)\\$s.c" |
| 1195 | 1228 | writeln "\ttranslate\$E \$** > \$@\n" |
| 1196 | 1229 | } |
| 1197 | 1230 | |
| 1198 | 1231 | writeln "fossil.res : \$B\\win\\fossil.rc" |
| 1199 | | -writeln "\t\$(RCC) -fo \$@ \$**" |
| 1232 | +writeln "\t\$(RCC) /fo \$@ \$**\n" |
| 1200 | 1233 | |
| 1201 | 1234 | writeln "headers: makeheaders\$E page_index.h VERSION.h" |
| 1202 | 1235 | writeln -nonewline "\tmakeheaders\$E " |
| 1203 | 1236 | set i 0 |
| 1204 | 1237 | foreach s [lsort $src] { |
| 1205 | 1238 | |