Artifact c389f88ac5eec4e91703d5380f7475c94ebed7f4:
File
Makefile.w32
part of check-in
[16f6fd904a]
- Add SSL support.
by
dmitry on
2009-11-09 15:32:32.
0000: 23 21 2f 75 73 72 2f 62 69 6e 2f 6d 61 6b 65 0a #!/usr/bin/make.
0010: 23 0a 23 23 23 23 20 54 68 65 20 74 6f 70 6c 65 #.#### The tople
0020: 76 65 6c 20 64 69 72 65 63 74 6f 72 79 20 6f 66 vel directory of
0030: 20 74 68 65 20 73 6f 75 72 63 65 20 74 72 65 65 the source tree
0040: 2e 20 20 46 6f 73 73 69 6c 20 63 61 6e 20 62 65 . Fossil can be
0050: 20 62 75 69 6c 74 0a 23 20 20 20 20 69 6e 20 61 built.# in a
0060: 20 64 69 72 65 63 74 6f 72 79 20 74 68 61 74 20 directory that
0070: 69 73 20 73 65 70 61 72 61 74 65 20 66 72 6f 6d is separate from
0080: 20 74 68 65 20 73 6f 75 72 63 65 20 74 72 65 65 the source tree
0090: 2e 20 20 4a 75 73 74 20 63 68 61 6e 67 65 0a 23 . Just change.#
00a0: 20 20 20 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e the followin
00b0: 67 20 74 6f 20 70 6f 69 6e 74 20 66 72 6f 6d 20 g to point from
00c0: 74 68 65 20 62 75 69 6c 64 20 64 69 72 65 63 74 the build direct
00d0: 6f 72 79 20 74 6f 20 74 68 65 20 73 72 63 2f 20 ory to the src/
00e0: 66 6f 6c 64 65 72 2e 0a 23 0a 53 52 43 44 49 52 folder..#.SRCDIR
00f0: 20 3d 20 2e 2f 73 72 63 0a 0a 23 23 23 23 20 43 = ./src..#### C
0100: 20 43 6f 6d 70 69 6c 65 72 20 61 6e 64 20 6f 70 Compiler and op
0110: 74 69 6f 6e 73 20 66 6f 72 20 75 73 65 20 69 6e tions for use in
0120: 20 62 75 69 6c 64 69 6e 67 20 65 78 65 63 75 74 building execut
0130: 61 62 6c 65 73 20 74 68 61 74 0a 23 20 20 20 20 ables that.#
0140: 77 69 6c 6c 20 72 75 6e 20 6f 6e 20 74 68 65 20 will run on the
0150: 70 6c 61 74 66 6f 72 6d 20 74 68 61 74 20 69 73 platform that is
0160: 20 64 6f 69 6e 67 20 74 68 65 20 62 75 69 6c 64 doing the build
0170: 2e 20 20 54 68 69 73 20 69 73 20 75 73 65 64 0a . This is used.
0180: 23 20 20 20 20 74 6f 20 63 6f 6d 70 69 6c 65 20 # to compile
0190: 63 6f 64 65 2d 67 65 6e 65 72 61 74 6f 72 20 70 code-generator p
01a0: 72 6f 67 72 61 6d 73 20 61 73 20 70 61 72 74 20 rograms as part
01b0: 6f 66 20 74 68 65 20 62 75 69 6c 64 20 70 72 6f of the build pro
01c0: 63 65 73 73 2e 0a 23 20 20 20 20 53 65 65 20 54 cess..# See T
01d0: 43 43 20 62 65 6c 6f 77 20 66 6f 72 20 74 68 65 CC below for the
01e0: 20 43 20 63 6f 6d 70 69 6c 65 72 20 66 6f 72 20 C compiler for
01f0: 62 75 69 6c 64 69 6e 67 20 74 68 65 20 66 69 6e building the fin
0200: 69 73 68 65 64 20 62 69 6e 61 72 79 2e 0a 23 0a ished binary..#.
0210: 42 43 43 20 3d 20 67 63 63 20 2d 67 20 2d 4f 32 BCC = gcc -g -O2
0220: 0a 0a 23 23 23 23 20 54 68 65 20 73 75 66 66 69 ..#### The suffi
0230: 78 20 74 6f 20 61 64 64 20 74 6f 20 65 78 65 63 x to add to exec
0240: 75 74 61 62 6c 65 20 66 69 6c 65 73 2e 20 20 22 utable files. "
0250: 2e 65 78 65 22 20 66 6f 72 20 77 69 6e 64 6f 77 .exe" for window
0260: 73 2e 0a 23 20 20 20 20 4e 6f 74 68 69 6e 67 20 s..# Nothing
0270: 66 6f 72 20 75 6e 69 78 2e 0a 23 0a 45 20 3d 20 for unix..#.E =
0280: 2e 65 78 65 0a 0a 23 23 23 23 20 45 6e 61 62 6c .exe..#### Enabl
0290: 65 20 48 54 54 50 53 20 73 75 70 70 6f 72 74 20 e HTTPS support
02a0: 76 69 61 20 4f 70 65 6e 53 53 4c 20 28 6c 69 6e via OpenSSL (lin
02b0: 6b 73 20 74 6f 20 6c 69 62 73 73 6c 20 61 6e 64 ks to libssl and
02c0: 20 6c 69 62 63 72 79 70 74 6f 29 0a 23 0a 23 20 libcrypto).#.#
02d0: 46 4f 53 53 49 4c 5f 45 4e 41 42 4c 45 5f 53 53 FOSSIL_ENABLE_SS
02e0: 4c 3d 31 0a 0a 23 23 23 23 20 43 20 43 6f 6d 70 L=1..#### C Comp
02f0: 69 6c 65 20 61 6e 64 20 6f 70 74 69 6f 6e 73 20 ile and options
0300: 66 6f 72 20 75 73 65 20 69 6e 20 62 75 69 6c 64 for use in build
0310: 69 6e 67 20 65 78 65 63 75 74 61 62 6c 65 73 20 ing executables
0320: 74 68 61 74 20 0a 23 20 20 20 20 77 69 6c 6c 20 that .# will
0330: 72 75 6e 20 6f 6e 20 74 68 65 20 74 61 72 67 65 run on the targe
0340: 74 20 70 6c 61 74 66 6f 72 6d 2e 20 20 54 68 69 t platform. Thi
0350: 73 20 69 73 20 75 73 75 61 6c 6c 79 20 74 68 65 s is usually the
0360: 20 73 61 6d 65 0a 23 20 20 20 20 61 73 20 42 43 same.# as BC
0370: 43 2c 20 75 6e 6c 65 73 73 20 79 6f 75 20 61 72 C, unless you ar
0380: 65 20 63 72 6f 73 73 2d 63 6f 6d 70 69 6c 69 6e e cross-compilin
0390: 67 2e 20 20 54 68 69 73 20 43 20 63 6f 6d 70 69 g. This C compi
03a0: 6c 65 72 20 62 75 69 6c 64 73 0a 23 20 20 20 20 ler builds.#
03b0: 74 68 65 20 66 69 6e 69 73 68 65 64 20 62 69 6e the finished bin
03c0: 61 72 79 20 66 6f 72 20 66 6f 73 73 69 6c 2e 20 ary for fossil.
03d0: 20 54 68 65 20 42 43 43 20 63 6f 6d 70 69 6c 65 The BCC compile
03e0: 72 20 61 62 6f 76 65 20 69 73 20 75 73 65 64 0a r above is used.
03f0: 23 20 20 20 20 66 6f 72 20 62 75 69 6c 64 69 6e # for buildin
0400: 67 20 69 6e 74 65 72 6d 65 64 69 61 74 65 20 63 g intermediate c
0410: 6f 64 65 2d 67 65 6e 65 72 61 74 6f 72 20 74 6f ode-generator to
0420: 6f 6c 73 2e 0a 23 0a 23 54 43 43 20 3d 20 67 63 ols..#.#TCC = gc
0430: 63 20 2d 4f 36 0a 23 54 43 43 20 3d 20 67 63 63 c -O6.#TCC = gcc
0440: 20 2d 67 20 2d 4f 30 20 2d 57 61 6c 6c 20 2d 66 -g -O0 -Wall -f
0450: 70 72 6f 66 69 6c 65 2d 61 72 63 73 20 2d 66 74 profile-arcs -ft
0460: 65 73 74 2d 63 6f 76 65 72 61 67 65 0a 23 54 43 est-coverage.#TC
0470: 43 20 3d 20 67 63 63 20 2d 67 20 2d 4f 73 20 2d C = gcc -g -Os -
0480: 57 61 6c 6c 0a 23 54 43 43 20 3d 20 67 63 63 20 Wall.#TCC = gcc
0490: 2d 67 20 2d 4f 73 20 2d 57 61 6c 6c 20 2d 44 46 -g -Os -Wall -DF
04a0: 4f 53 53 49 4c 5f 49 31 38 4e 3d 30 20 2d 4c 2f OSSIL_I18N=0 -L/
04b0: 75 73 72 2f 6c 6f 63 61 6c 2f 6c 69 62 20 2d 49 usr/local/lib -I
04c0: 2f 75 73 72 2f 6c 6f 63 61 6c 2f 69 6e 63 6c 75 /usr/local/inclu
04d0: 64 65 0a 54 43 43 20 3d 20 67 63 63 20 2d 4f 73 de.TCC = gcc -Os
04e0: 20 2d 57 61 6c 6c 20 2d 44 46 4f 53 53 49 4c 5f -Wall -DFOSSIL_
04f0: 49 31 38 4e 3d 30 20 2d 4c 2f 6d 69 6e 67 77 2f I18N=0 -L/mingw/
0500: 6c 69 62 20 2d 49 2f 6d 69 6e 67 77 2f 69 6e 63 lib -I/mingw/inc
0510: 6c 75 64 65 0a 0a 23 20 57 69 74 68 20 48 54 54 lude..# With HTT
0520: 50 53 20 73 75 70 70 6f 72 74 0a 69 66 64 65 66 PS support.ifdef
0530: 20 46 4f 53 53 49 4c 5f 45 4e 41 42 4c 45 5f 53 FOSSIL_ENABLE_S
0540: 53 4c 0a 54 43 43 20 2b 3d 20 2d 44 46 4f 53 53 SL.TCC += -DFOSS
0550: 49 4c 5f 45 4e 41 42 4c 45 5f 53 53 4c 3d 31 0a IL_ENABLE_SSL=1.
0560: 65 6e 64 69 66 0a 0a 23 23 23 23 20 45 78 74 72 endif..#### Extr
0570: 61 20 61 72 67 75 6d 65 6e 74 73 20 66 6f 72 20 a arguments for
0580: 6c 69 6e 6b 69 6e 67 20 74 68 65 20 66 69 6e 69 linking the fini
0590: 73 68 65 64 20 62 69 6e 61 72 79 2e 20 20 46 6f shed binary. Fo
05a0: 73 73 69 6c 20 6e 65 65 64 73 0a 23 20 20 20 20 ssil needs.#
05b0: 74 6f 20 6c 69 6e 6b 20 61 67 61 69 6e 73 74 20 to link against
05c0: 74 68 65 20 5a 2d 4c 69 62 20 63 6f 6d 70 72 65 the Z-Lib compre
05d0: 73 73 69 6f 6e 20 6c 69 62 72 61 72 79 2e 20 20 ssion library.
05e0: 54 68 65 72 65 20 61 72 65 20 6e 6f 0a 23 20 20 There are no.#
05f0: 20 20 6f 74 68 65 72 20 64 65 70 65 6e 64 65 6e other dependen
0600: 63 69 65 73 2e 20 20 57 65 20 73 6f 6d 65 74 69 cies. We someti
0610: 6d 65 73 20 61 64 64 20 74 68 65 20 2d 73 74 61 mes add the -sta
0620: 74 69 63 20 6f 70 74 69 6f 6e 20 68 65 72 65 0a tic option here.
0630: 23 20 20 20 20 73 6f 20 74 68 61 74 20 77 65 20 # so that we
0640: 63 61 6e 20 62 75 69 6c 64 20 61 20 73 74 61 74 can build a stat
0650: 69 63 20 65 78 65 63 75 74 61 62 6c 65 20 74 68 ic executable th
0660: 61 74 20 77 69 6c 6c 20 72 75 6e 20 69 6e 20 61 at will run in a
0670: 0a 23 20 20 20 20 63 68 72 6f 6f 74 20 6a 61 69 .# chroot jai
0680: 6c 2e 0a 23 0a 23 4c 49 42 20 3d 20 2d 6c 7a 0a l..#.#LIB = -lz.
0690: 23 4c 49 42 20 3d 20 2d 6c 7a 20 2d 6c 77 73 32 #LIB = -lz -lws2
06a0: 5f 33 32 0a 4c 49 42 20 3d 20 2d 6c 6d 69 6e 67 _32.LIB = -lming
06b0: 77 65 78 20 2d 6c 7a 20 2d 6c 77 73 32 5f 33 32 wex -lz -lws2_32
06c0: 0a 23 20 4f 70 65 6e 53 53 4c 3a 0a 69 66 64 65 .# OpenSSL:.ifde
06d0: 66 20 46 4f 53 53 49 4c 5f 45 4e 41 42 4c 45 5f f FOSSIL_ENABLE_
06e0: 53 53 4c 0a 4c 49 42 20 2b 3d 20 2d 6c 63 72 79 SSL.LIB += -lcry
06f0: 70 74 6f 20 2d 6c 73 73 6c 0a 65 6e 64 69 66 0a pto -lssl.endif.
0700: 0a 23 23 23 23 20 54 63 6c 20 73 68 65 6c 6c 20 .#### Tcl shell
0710: 66 6f 72 20 75 73 65 20 69 6e 20 72 75 6e 6e 69 for use in runni
0720: 6e 67 20 74 68 65 20 66 6f 73 73 69 6c 20 74 65 ng the fossil te
0730: 73 74 73 75 69 74 65 2e 0a 23 0a 54 43 4c 53 48 stsuite..#.TCLSH
0740: 20 3d 20 74 63 6c 73 68 0a 0a 23 20 59 6f 75 20 = tclsh..# You
0750: 73 68 6f 75 6c 64 20 6e 6f 74 20 6e 65 65 64 20 should not need
0760: 74 6f 20 63 68 61 6e 67 65 20 61 6e 79 74 68 69 to change anythi
0770: 6e 67 20 62 65 6c 6f 77 20 74 68 69 73 20 6c 69 ng below this li
0780: 6e 65 0a 23 23 23 23 23 23 23 23 23 23 23 23 23 ne.#############
0790: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
07a0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
07b0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
07c0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
07d0: 23 23 0a 69 6e 63 6c 75 64 65 20 24 28 53 52 43 ##.include $(SRC
07e0: 44 49 52 29 2f 6d 61 69 6e 2e 6d 6b 0a DIR)/main.mk.