Makefile
上传用户:ycwykj01
上传日期:2007-01-04
资源大小:1819k
文件大小:14k
源码类别:

网络编程

开发平台:

Unix_Linux

  1. # Program: IMAP Toolkit Makefile
  2. #
  3. # Author: Mark Crispin
  4. # Networks and Distributed Computing
  5. # Computing & Communications
  6. # University of Washington
  7. # Administration Building, AG-44
  8. # Seattle, WA  98195
  9. # Internet: MRC@CAC.Washington.EDU
  10. #
  11. # Date: 7 December 1989
  12. # Last Edited: 15 November 1999
  13. #
  14. # Copyright 1999 by the University of Washington
  15. #
  16. #  Permission to use, copy, modify, and distribute this software and its
  17. # documentation for any purpose and without fee is hereby granted, provided
  18. # that the above copyright notice appears in all copies and that both the
  19. # above copyright notice and this permission notice appear in supporting
  20. # documentation, and that the name of the University of Washington not be
  21. # used in advertising or publicity pertaining to distribution of the software
  22. # without specific, written prior permission.  This software is made
  23. # available "as is", and
  24. # THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
  25. # WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
  26. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
  27. # NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
  28. # INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  29. # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
  30. # (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
  31. # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  32. #  The following ports are defined.  These refer to the *standard* compiler
  33. # on the given system.  This means, for example, that the sol port is for SUN's
  34. # compiler and not for a non-standard compiler such as gcc.
  35. #  If you are using gcc and it is not the standard compiler on your system, try
  36. # using an ANSI port that is close to what you have.  For example, if your
  37. # system is SVR4ish, try a32 or lnx; if it's more BSDish, try nxt, mct, or bsi.
  38. #
  39. # a32 AIX 3.2 for RS/6000
  40. # a41 AIX 4.1 for RS/6000
  41. # aix AIX/370 (not RS/6000!!)
  42. # ami AmigaDOS
  43. # am2 AmigaDOS with a 68020+
  44. # ama AmigaDOS using AS225R2
  45. # amn AmigaDOS with a 680x0 using "new" socket library
  46. # aos AOS for RT
  47. # art AIX 2.2.1 for RT
  48. # asv Altos SVR4
  49. # aux A/UX
  50. # bs3 BSD/i386 3.0 and higher
  51. # bsd generic BSD 4.3 (as in ancient 1980s version)
  52. # bsf FreeBSD
  53. # bsi BSD/i386
  54. # bso OpenBSD (yes, yet another one...)
  55. # cvx Convex
  56. # d-g Data General DG/UX prior to 5.4 (d41 port no longer exists)
  57. # d54 Data General DG/UX 5.4
  58. # do4 Apollo Domain/OS sr10.4
  59. # dpx Bull DPX/2 B.O.S.
  60. # drs ICL DRS/NX
  61. # dyn Dynix
  62. # epx EP/IX
  63. # gas GCC Altos SVR4
  64. # gh9   GCC HP-UX 9.x
  65. # ghp GCC HP-UX 10.x
  66. # gs5 GCC 2.7.1 (95q4 from Skunkware _not_ 98q2!) SCO Open Server 5.0.x
  67. # gso GCC Solaris
  68. # gsu GCC SUN-OS
  69. # gul GCC RISC Ultrix (DEC-5000)
  70. # hpp HP-UX 9.x (see gh9)
  71. # hpx HP-UX 10.x (see ghp, hxd, and shp)
  72. # hxd HP-UX 10.x with DCE security (see shp)
  73. # isc Interactive Systems
  74. # lnx Linux with traditional passwords and crypt() in the C library
  75. #  (see lnp, sl4, sl5, and slx)
  76. # lnp Linux with Pluggable Authentication Modules (PAM)
  77. # lyn LynxOS
  78. # mct MachTen
  79. # mnt Atari ST Mint (not MacMint)
  80. # neb NetBSD/FreeBSD
  81. # nxt NEXTSTEP
  82. # nx3 NEXTSTEP 3.x
  83. # osf OSF/1 (see sos, os4)
  84. # os4 OSF/1 (Digital UNIX) 4
  85. # ptx PTX
  86. # pyr Pyramid
  87. # qnx QNX 4
  88. # s40 SUN-OS 4.0 (*not* Solaris)
  89. # sc5 SCO Open Server 5.0.x (see gs5)
  90. # sco Santa Cruz Operation (see sc5, gs5)
  91. # shp HP-UX with Trusted Computer Base
  92. # sgi Silicon Graphics IRIX
  93. # sg6 Silicon Graphics IRIX 6.5
  94. # sl4 Linux using -lshadow to get the crypt() function
  95. # sl5 Linux with shadow passwords, no extra libraries
  96. # slx Linux using -lcrypt to get the crypt() function
  97. # snx Siemens Nixdorf SININX or Reliant UNIX
  98. # sol Solaris (won't work unless "ucbcc" works -- use gso instead)
  99. # sos OSF/1 with SecureWare
  100. # ssn SUN-OS with shadow password security
  101. # sun SUN-OS 4.1 or better (*not* Solaris) (see ssn)
  102. # sv2 SVR2 on AT&T PC-7300 (incomplete port)
  103. # sv4 generic SVR4
  104. # ult RISC Ultrix (DEC-5000)
  105. # uw2 UnixWare SVR4.2
  106. # vul VAX Ultrix
  107. # vu2 VAX Ultrix 2.3 (e.g. for VAXstation-2000 or similar old version)
  108. # *** TEMPORARY FOR PINE 4.10 BUILD ***
  109. GSSDIR=/usr/local
  110. # *** TEMPORARY FOR PINE 4.10 BUILD ***
  111. # Normal command to build IMAP toolkit:
  112. #  make <port> [EXTRAAUTHENTICATORS=xxx] [EXTRADRIVERS=xxx] [PASSWDTYPE=xxx]
  113. # Extra authenticators (e.g. OTP, Kerberos, etc.).  Adds linkage for
  114. # auth_xxx.c and executes Makefile.xxx, where xxx is the name of the
  115. # authenticator.  Some authenticators are only available from third parties.
  116. EXTRAAUTHENTICATORS=
  117. SPECIALAUTHENTICATORS=
  118. # The following extra drivers are defined:
  119. # mbox if file "mbox" exists on the home directory, automatically moves mail
  120. #  from the spool directory to "mbox" and uses "mbox" as INBOX.
  121. EXTRADRIVERS=mbox
  122. # The following plaintext login types are defined:
  123. # afs AFS authentication database
  124. # dce DCE authentication database
  125. # nul no plaintext authentication (note: this will break some secure
  126. #  authenticators -- don't use without checking first!!)
  127. # pam PAM authentication (note: for Linux, you should use the "lnp" port
  128. #  instead of setting this...also, you may have to modify PAMLDFLAGS
  129. #  in the imap-[]/src/osdep/unix/Makefile
  130. # pmb PAM authentication for broken implementations such as Solaris.
  131. #  you may have to modify PAMLDFLAGS
  132. # std system standard (typically passwd file), determined by port
  133. PASSWDTYPE=std
  134. # The following extra compilation flags are defined.  None of these flags are
  135. # recommended.
  136. #
  137. # -DDISABLE_POP_PROXY=1
  138. # By default, the ipop[23]d servers offer POP->IMAP proxy access,
  139. # which allow a POP client to access mail on an IMAP server by using the
  140. # POP server as a go-between.  Setting this option disables this
  141. # facility.
  142. #
  143. # -DDISABLE_REVERSE_DNS_LOOKUP=1
  144. # Never do gethostbyaddr() calls on sockets in the client and server.
  145. # By default, the servers (ipop[23]d and imapd) will do gethostbyaddr()
  146. # on the local and remote sockets so that imapd can identify itself
  147. # properly (this is important when the same CPU hosts multiple virtual
  148. # hosts on different IP addresss) and also includes the client's name
  149. # when it writes to the syslog.  There are also client gethostbyaddr()
  150. # calls, used primarily by authentication mechanisms.
  151. #
  152. # Setting this option disables all gethostbyaddr() calls.  The returned
  153. # "host name" string for the socket is just the bracketed [12.34.56.78]
  154. # form, as if the reverse DNS lookup failed.
  155. #
  156. # WARNING: Some authentication mechanisms, e.g. Kerberos V, depend upon
  157. # the host names being right, and if you set this option, it won't work.
  158. #
  159. # You should only do this if you are encountering server performance
  160. # problems due to a misconfigured DNS, e.g. long startup delays or
  161. # client timeouts.
  162. #
  163. # -DIGNORE_LOCK_EACCES_ERRORS=1
  164. # Disable the "Mailbox vulnerable -- directory must have 1777 protection"
  165. # warning which occurs if an attempt to create a mailbox lock file
  166. # fails due to an EACCES error.
  167. #
  168. # WARNING: If the mail delivery program uses mailbox lock files and the
  169. # mail spool directory is not protected 1777, there is no protection
  170. # against mail being delivered while the mailbox is being rewritten in a
  171. # checkpoint or an expunge.  The result is a corrupted mailbox file
  172. # and/or lost mail.  The warning message is the *ONLY* indication that
  173. # the user will receive that this could be happening.  Disabling the
  174. # warning just sweeps the problem under the rug.
  175. #
  176. # There are only a small minority of BSD-style systems in which the mail
  177. # delivery program does not use mailbox lock files.  Linux is *NOT* one
  178. # of these systems.  Do *NOT* set this option on Linux or SVR4.
  179. #
  180. # -DSVR4_DISABLE_FLOCK=1
  181. # Disable emulation of the BSD flock() system call on SVR4 systems in all
  182. # unconditionally.  By default, this only happens for NFS files (to avoid
  183. # problems with the broken "statd" and "lockd" daemons).
  184. #
  185. # WARNING: This disables protection against two processes accessing the
  186. # same mailbox file simultaneously, and can result in corrupted
  187. # mailboxes, aborted sessions, and core dumps.
  188. #
  189. # There should be no reason ever to do this, since the flock() emulation
  190. # checks for NFS files.
  191. #
  192. # -DOLDFILESUFFIX="xxx"
  193. # Change the default suffix appended to the backup .newsrc file from
  194. # "old".
  195. #
  196. # -DSTRICT_RFC822_TIMEZONES=1
  197. # Disable recognition of the UTC (0000), MET (+0100), EET (+0200),
  198. # JST (+0900), ADT (-0300), AST (-0400), YDT (-0800), YST (-0900), and
  199. # HST (-1000) symbolic timezones.
  200. #
  201. # -DBRITISH_SUMMER_TIME=1
  202. # Enables recognition of non-standard symbolic timezone BST as +0100.
  203. #
  204. # -DBERING_STANDARD_TIME=1
  205. # Enables recognition of non-standard symbolic timezone BST as -1100.
  206. #
  207. # -DNEWFOUNDLAND_STANDARD_TIME=1
  208. # Enables recognition of non-standard symbolic timezone NST as -0330.
  209. #
  210. # -DNOME_STANDARD_TIME=1
  211. # Enables recognition of non-standard symbolic timezone NST as -1100.
  212. #
  213. # -DSAMOA_STANDARD_TIME=1
  214. # Enables recognition of non-standard symbolic timezone SST as -1100.
  215. #
  216. # -DY4KBUGFIX=1
  217. # Turn on the Y4K bugfix (yes, that's year 4000).  It isn't well-known,
  218. # but century years evenly divisible by 4000 are *not* leap years in the
  219. # Gregorian calendar.  A lot of "Y2K compilant" software does not know
  220. # about this rule.  Remember to turn this on sometime in the next 2000
  221. # years.
  222. #
  223. # -DUSEORTHODOXCALENDAR=1
  224. # Use the more accurate Eastern Orthodox calendar instead of the
  225. # Gregorian calendar.  The century years which are leap years happen
  226. # at alternating 400 and 500 year intervals without shifts every 4000
  227. # years.  The Orthodox and Gregorian calendars diverge by 1 day for
  228. # gradually-increasing intervals, starting at 2800-2900, and becoming
  229. # permanent at 48,300.
  230. EXTRACFLAGS=
  231. # Extra linker flags (additional/alternative libraries, etc.)
  232. EXTRALDFLAGS=
  233. # Special make flags (e.g. to override make environment variables)
  234. EXTRASPECIALS=
  235. # Normal commands
  236. CAT=cat
  237. CD=cd
  238. LN=ln -s
  239. MAKE=make
  240. MKDIR=mkdir
  241. RM=rm -rf
  242. SH=sh
  243. SYSTEM=unix
  244. TOOLS=tools
  245. TOUCH=touch
  246. # Primary build command
  247. BUILDOPTIONS= EXTRACFLAGS='$(EXTRACFLAGS)' EXTRALDFLAGS='$(EXTRALDFLAGS)'
  248.  EXTRADRIVERS='$(EXTRADRIVERS)' EXTRAAUTHENTICATORS='$(EXTRAAUTHENTICATORS)'
  249.  PASSWDTYPE=$(PASSWDTYPE) SPECIALAUTHENTICATORS='$(SPECIALAUTHENTICATORS)'
  250. #BUILD=$(MAKE) build $(BUILDOPTIONS)
  251. # *** TEMPORARY FOR PINE 4.10 BUILD ***
  252. BUILD=$(MAKE) build $(BUILDOPTIONS) GSSDIR=$(GSSDIR)
  253. # *** TEMPORARY FOR PINE 4.10 BUILD ***
  254. # Make the IMAP Toolkit
  255. all: c-client rebuild bundled
  256. c-client:
  257. @echo Not processed yet.  In a first-time build, you must specify
  258. @echo the system type so that the sources are properly processed.
  259. @false
  260. # Note on SCO you may have to set LN to "ln".
  261. a32 a41 aix bs3 bsf bsi bso d-g d54 do4 drs epx gas gh9 ghp gs5 gso gsu gul hpp hpx lnp lyn mct mnt neb nxt nx3 osf os4 ptx qnx sc5 sco sgi sg6 shp sl4 sl5 slx snx sol sos uw2: an
  262. $(BUILD) OS=$@
  263. # If you use sv4, you may find that it works to move it to use the an process.
  264. # If so, you probably will want to delete the "-Dconst=" from the sv4 CFLAGS in
  265. # the c-client Makefile.
  266. aos art asv aux bsd cvx dpx dyn isc pyr s40 sv4 ult vul vu2: ua
  267. $(BUILD) OS=$@
  268. # Linux shadow password support doesn't build on traditional systems, but most
  269. # Linux systems are shadow these days.
  270. lnx: lnxnul an
  271. $(BUILD) OS=$@
  272. lnxnul:
  273. @sh -c '(test $(PASSWDTYPE) = nul) || make lnxok'
  274. lnxok:
  275. @echo You are building for traditional Linux.  Most modern Linux
  276. @echo systems require that you build using make slx.  Do you want
  277. @echo to continue this build?  Type y or n please:
  278. @sh -c 'read x; case "$$x" in y) exit 0;; *) exit 1;; esac'
  279. @echo OK, I will remember that you really want to build for
  280. @echo traditional Linux.  You will not see this message again.
  281. @echo If you discover that you can not log in to the POP and IMAP
  282. @echo servers, then do the following commands:
  283. @echo % rm lnxok
  284. @echo % make clean
  285. @echo % make slx
  286. @echo If slx does not work, try sl4 or sl5.  Be sure to do a
  287. @echo make clean between each try!
  288. @touch lnxok
  289. # SUN-OS makes you load libdl by hand...
  290. ssn sun: suntools ua
  291. $(BUILD) OS=$@
  292. suntools:
  293. $(CD) tools;$(MAKE) LDFLAGS=-ldl
  294. # SVR2 doesn't have symbolic links (at least my SVR2 system doesn't)
  295. sv2:
  296. $(MAKE) ua LN=ln
  297. $(BUILD) OS=$@ LN=ln
  298. # Pine port names, not distinguished in c-client
  299. bs2: an
  300. $(BUILD) OS=bsi
  301. pt1: an
  302. $(BUILD) OS=ptx
  303. # Compatibility
  304. hxd: # Gotta do this one the hard way
  305. $(MAKE) hpx PASSWDTYPE=dce
  306. # Amiga
  307. ami am2 ama amn:
  308. $(MAKE) an LN=cp SYSTEM=amiga
  309. $(BUILD) OS=$@ LN=cp
  310. # Courtesy entry for NT
  311. nt:
  312. nmake /nologo /f makefile.nt
  313. ntk:
  314. nmake /nologo /f makefile.ntk
  315. # Courtesy entry for WCE
  316. wce:
  317. nmake /nologo /f makefile.wce
  318. # C compiler types
  319. an ua:
  320. @echo Applying $@ process to sources...
  321. $(TOOLS)/$@ "$(LN)" src/c-client c-client
  322. $(TOOLS)/$@ "$(LN)" src/ansilib c-client
  323. $(TOOLS)/$@ "$(LN)" src/charset c-client
  324. sh -c '(test -d src/kerberos) && ($(LN) `pwd`/src/kerberos/* c-client) || true'
  325. $(TOOLS)/$@ "$(LN)" src/osdep/$(SYSTEM) c-client
  326. $(TOOLS)/$@ "$(LN)" src/mtest mtest
  327. $(TOOLS)/$@ "$(LN)" src/ipopd ipopd
  328. $(TOOLS)/$@ "$(LN)" src/imapd imapd
  329. $(LN) $(TOOLS)/$@ .
  330. build: OSTYPE rebuild rebuildclean bundled
  331. OSTYPE:
  332. @echo Building c-client for $(OS)...
  333. echo $(EXTRASPECIALS) > c-client/EXTRASPECIALS
  334. # *** TEMPORARY FOR PINE 4.10 BUILD ***
  335. echo GSSDIR=$(GSSDIR) >> c-client/EXTRASPECIALS
  336. # *** TEMPORARY FOR PINE 4.10 BUILD ***
  337. $(CD) c-client;$(MAKE) $(OS) BUILDOPTIONS="$(BUILDOPTIONS)" $(EXTRASPECIALS)
  338. echo $(OS) > OSTYPE
  339. $(TOUCH) rebuild
  340. rebuild:
  341. @echo Rebuilding c-client for `cat OSTYPE`...
  342. $(TOUCH) c-client/EXTRASPECIALS
  343. $(CD) c-client;$(MAKE) all CC=`cat CCTYPE` CFLAGS="`cat CFLAGS`" `cat EXTRASPECIALS`
  344. rebuildclean:
  345. sh -c '$(RM) rebuild || true'
  346. bundled:
  347. @echo Building bundled tools...
  348. $(CD) mtest;$(MAKE)
  349. $(CD) ipopd;$(MAKE)
  350. $(CD) imapd;$(MAKE)
  351. clean:
  352. @echo Removing old processed sources and binaries...
  353. sh -c '$(RM) an ua OSTYPE c-client mtest imapd ipopd || true'
  354. $(CD) tools;$(MAKE) clean
  355. # A monument to a hack of long ago and far away...
  356. love:
  357. @echo not war?