/contrib/tcsh/Imakefile

https://bitbucket.org/freebsd/freebsd-head/ · #! · 632 lines · 530 code · 102 blank · 0 comment · 0 complexity · e99cd56c97052269db9e8990e4e06fe9 MD5 · raw file

  1. XCOMM
  2. XCOMM $tcsh: Imakefile,v 1.87 2010/01/28 19:01:05 christos Exp $
  3. XCOMM
  4. XCOMM Imakefile for tcsh 6.12
  5. XCOMM Marc Horowitz, MIT SIPB
  6. XCOMM
  7. #ifdef DestDir
  8. #undef DestDir
  9. #endif
  10. #ifdef ManSuffix
  11. #undef ManSuffix
  12. #endif
  13. /* All config options go in a separate file. */
  14. #include "imake.config"
  15. #ifndef HasGcc
  16. # define HasGcc 0
  17. #endif
  18. #ifndef HasGcc2
  19. # define HasGcc2 0
  20. #endif
  21. /* This is a giant conditional block. It should be set up right for
  22. platforms which are in here, but it may need to be changed for new
  23. ones. Please send in your fixes and additions! */
  24. /**** tcsh configuration defines ****/
  25. /* specific platforms */
  26. #ifndef ConfigH
  27. # ifdef UltrixArchitecture
  28. # define ConfigH ultrix
  29. # endif
  30. # ifdef UxpArchitecture
  31. # define ConfigH sysv4
  32. # endif
  33. # if defined(LinuxArchitecture) || defined(GNUArchitecture)
  34. # define ConfigH linux
  35. # endif
  36. # ifdef AlphaArchitecture
  37. # if !defined(LinuxArchitecture) && !defined(GNUArchitecture)
  38. # define ConfigH decosf1
  39. # endif
  40. # if !HasGcc
  41. # define MyCflags -std1 -Olimit 2000
  42. # else
  43. # define NoCombineRegs
  44. # endif
  45. # endif
  46. # if defined(VaxArchitecture) && !defined(UltrixArchitecture)
  47. # define ConfigH bsd
  48. # endif
  49. # ifdef NeXTArchitecture
  50. # define ConfigH mach
  51. # endif
  52. # if defined(SunArchitecture)
  53. # if (OSMajorVersion == 3)
  54. # define ConfigH sunos35
  55. # else
  56. # if (OSMajorVersion == 4)
  57. # if (OSMinorVersion == 0)
  58. # define ConfigH sunos40
  59. # else /* OSMinorVersion == 1 */
  60. # if (OSTeenyVersion == 3)
  61. # define ConfigH sunos413
  62. # else /* OsTeenyVersion in [0,1,2] */
  63. # define ConfigH sunos41
  64. # endif
  65. # endif
  66. # define NoCombineRegs
  67. # else /* OSMajorVersion == 5 */
  68. # if (OSMinorVersion < 3)
  69. # if (OSMinorVersion < 2)
  70. # define ConfigH sol2
  71. # else
  72. # define ConfigH sol22
  73. # endif
  74. # else
  75. # if (OSMinorVersion < 4)
  76. # define ConfigH sol23
  77. # else
  78. # if (OSMinorVersion < 6)
  79. # define ConfigH sol24
  80. # else
  81. # if (OSMinorVersion < 9)
  82. # define ConfigH sol26
  83. # else
  84. # define ConfigH sol29
  85. # endif
  86. # endif
  87. # endif
  88. # endif
  89. # define NoCombineRegs
  90. # endif
  91. # endif
  92. # endif
  93. # ifdef HPArchitecture
  94. /* For some stupid reason makedepend on HP requires this */
  95. DEPENDFLAGS = -o.o
  96. # if (OSMajorVersion >= 8)
  97. # define ConfigH hpux8
  98. # else
  99. # define ConfigH hpux7
  100. # endif
  101. # endif
  102. # ifdef CrayArchitecture
  103. # define ConfigH cray
  104. # endif
  105. # ifdef SGIArchitecture
  106. # define ConfigH irix
  107. # define UseLibBSD
  108. # if (OSMajorVersion < 5)
  109. # ifdef you_are_using_yp
  110. # define UseSunLib
  111. # endif
  112. # if !HasGCC
  113. # define MyStdc -D__STDC__
  114. # if SGICompilerMajorVersion < 4
  115. CCOPTIONS=-float # We don't want -cckr and -prototypes
  116. # endif
  117. # endif
  118. # endif
  119. # if (OSMajorVersion == 6)
  120. # if (OSMinorVersion >= 2)
  121. # undef UseLibBSD
  122. # define ConfigH irix62
  123. # endif
  124. # endif
  125. # endif
  126. # ifdef IBMArchitecture
  127. # undef UseLibBSD
  128. # if (SystemV == YES)
  129. # define ConfigH aix
  130. # if OSMajorVersion < 3
  131. # if OSMinorVersion < 2
  132. # define UseLibBSD
  133. # endif
  134. # endif
  135. # else
  136. # define ConfigH bsd
  137. # define AOSArchitecture
  138. # endif
  139. # endif
  140. #ifdef AOSArchitecture
  141. #define MyStdc -U__STDC__
  142. #endif
  143. # if defined(MipsBsdArchitecture) || defined(MipsSysvArchitecture)
  144. # define ConfigH mips
  145. # endif
  146. # ifdef DguxArchitecture
  147. # define ConfigH dgux
  148. # endif
  149. # ifdef ConvexArchitecture
  150. # define ConfigH convex
  151. # endif
  152. # if defined(SQNTArchitecture) || defined(SequentArchitecture)
  153. # define ConfigH sequent
  154. # endif
  155. # ifdef MacIIArchitecture
  156. # define ConfigH mac2
  157. # endif
  158. # ifdef MinixArchitecture
  159. /* Maybe conditional on MACH? */
  160. SYSSRCS=mi.termios.c mi.wait.h mi.varargs.h
  161. SYSOBJS=mi.termios.${SUF}
  162. EXTF=ma.setp.c vms.termcap.c
  163. # else
  164. /* Maybe conditional on MACH? */
  165. SYSSRCS=ma.setp.c
  166. SYSOBJS=ma.setp.${SUF}
  167. EXTF=mi.termios.c mi.wait.h mi.varargs.h vms.termcap.c
  168. # endif
  169. # ifdef i386Isc
  170. # if IscVersion != 202
  171. # define ConfigH isc
  172. # define UseLibCposix
  173. # else
  174. # define ConfigH isc202
  175. # endif
  176. # endif /* i386Isc */
  177. # ifdef OpenBSDArchitecture
  178. # define ConfigH bsd4.4
  179. # endif /* OpenBsdArchitecture */
  180. # ifdef NetBSDArchitecture
  181. # define ConfigH bsd4.4
  182. # endif /* NetBsdArchitecture */
  183. # ifdef FreeBSDArchitecture
  184. # define ConfigH bsd4.4
  185. # endif /* FreeBsdArchitecture */
  186. # ifdef MidnightBSDArchitecture
  187. # define ConfigH bsd4.4
  188. # endif /* MidnightBsdArchitecture */
  189. # ifdef i386SVR4Architecture
  190. # define ConfigH sysv4
  191. # ifdef DELL
  192. # define NoCombineRegs
  193. # endif
  194. # endif
  195. #endif /* !ConfigH */
  196. /* generic os's */
  197. #ifndef ConfigH
  198. #if (SystemV == YES)
  199. #define ConfigH sysv3
  200. #else
  201. /* why this as a default? Why not? */
  202. #define ConfigH bsd
  203. #endif
  204. #endif /* !ConfigH */
  205. /**** libraries ****/
  206. #if (SystemV == NO) || defined(HPArchitecture) || \
  207. defined(SQNTArchitecture) || defined(SequentArchitecture) || \
  208. defined(MacIIArchitecture) || defined(UseLibTermcap)
  209. LIBTERMCAP = -ltermcap
  210. #else
  211. LIBTERMCAP =
  212. #endif
  213. #if defined(SQNTArchitecture) || defined(SequentArchitecture)
  214. LIBSQNT=-lsocket -linet -lnsl -lseq
  215. #endif
  216. /* This may not be good enough - I don't have access to enough systems
  217. to really test it. */
  218. #if (SystemV == YES) || defined(UseLibCurses) && !defined(HPArchitecture)
  219. LIBCURSES = -lcurses
  220. #else
  221. LIBCURSES =
  222. #endif
  223. #if defined(UseLibNet)
  224. LIBNET = -lnet
  225. #else
  226. LIBNET =
  227. #endif
  228. #if defined(UseLibSocket)
  229. LIBSOCKET = -lsocket
  230. #else
  231. LIBSOCKET =
  232. #endif
  233. #if defined(UseLibBSD)
  234. LIBBSD = -lbsd
  235. #else
  236. LIBBSD =
  237. #endif
  238. #if (defined(SGIArchitecture) && \
  239. (OSMajorVersion == 3) && (OSMinorVersion == 3)) || \
  240. defined(UseLibC_S)
  241. LIBC_S = -lc_s
  242. #else
  243. LIBC_S =
  244. #endif
  245. #if defined(UseLibSun)
  246. LIBSUN = -lsun
  247. #else
  248. LIBSUN =
  249. #endif
  250. #if defined(UseLibCposix)
  251. LIBCPOSIX = -lcposix
  252. #else
  253. LIBCPOSIX =
  254. #endif
  255. #if defined(UseLibInet)
  256. LIBINET = -linet
  257. #else
  258. LIBINET =
  259. #endif
  260. #if defined(UseLibDir)
  261. LIBDIRECT = -ldir
  262. #else
  263. LIBDIRECT =
  264. #endif
  265. #if defined(UseLibX)
  266. LIBX = -lx
  267. #else
  268. LIBX =
  269. #endif
  270. #if defined(UseLibIntl)
  271. LIBINTL = -lintl
  272. #else
  273. LIBINTL =
  274. #endif
  275. #if (HasLibCrypt == YES)
  276. LIBCRYPT = -lcrypt
  277. #else
  278. LIBCRYPT =
  279. #endif
  280. #if defined(MacIIArchitecture) || defined(UseLibPosix)
  281. LIBPOSIX = -lposix
  282. #else
  283. LIBPOSIX =
  284. #endif
  285. #if defined(ATTArchitecture) || defined(UseLibDirent)
  286. LIBDIRECTENT = -ldirent
  287. #else
  288. LIBDIRECTENT =
  289. #endif
  290. /* The order here is significant. Although nothing uses all of these,
  291. some platforms which use more than one do care about the order. */
  292. SYSLIBS = $(LIBPOSIX) $(LIBDIRECTENT) $(LIBTERMCAP) $(LIBCURSES) \
  293. $(LIBNET) $(LIBINTL) $(LIBSOCKET) $(LIBSUN) $(LIBBSD) $(LIBCPOSIX) \
  294. $(LIBINET) $(LIBDIRECT) $(LIBX) $(LIBC_S) $(LIBSQNT) $(LIBCRYPT)
  295. /* Past here, nothing should need to be changed to compile on a different
  296. platform, unless you have a really weird architecture. */
  297. #ifdef MyCC
  298. CC = MyCC
  299. #else
  300. # if HasGcc
  301. # if HasGcc2
  302. CC = gcc
  303. # else
  304. # ifdef NoCombineRegs
  305. CC = gcc -finline-functions -fstrength-reduce
  306. # else
  307. CC = gcc -fcombine-regs -finline-functions -fstrength-reduce
  308. # endif
  309. # endif
  310. # else
  311. CC = cc
  312. # endif
  313. #endif
  314. #ifdef HESIOD
  315. HESLIB = -L/usr/athena/lib -lhesiod
  316. /* it seems to me that the -I shouldn't be necessary, but there seems
  317. to be a bug in the Imake stuff, so here it is. */
  318. HESDEF = -DHESIOD -I/usr/athena/include
  319. #else
  320. HESLIB =
  321. HESDEF =
  322. #endif
  323. #ifdef AFS
  324. #ifndef AFSDIR
  325. AFSDIR = /usr/afsws
  326. #endif
  327. #ifdef AFS33
  328. #define AFS33LIB -laudit
  329. #else
  330. #define AFS33LIB
  331. #endif
  332. /* Auxilliary libs needed for AFS */
  333. /* Both HPUX and Solaris need the BSD libraries. We need -lc before
  334. * the bsd library to avoid using any more of it than is necessary.
  335. */
  336. #if defined(HPArchitecture)
  337. #define AFSAUXLIB -lc -lBSD
  338. /* This is probably a kludge, but so is imake. */
  339. #else
  340. #if defined(SunArchitecture) && (OSMajorVersion == 5)
  341. #define AFSAUXLIB -lsocket -lnsl -lc -lucb
  342. #else
  343. #define AFSAUXLIB
  344. #endif
  345. #endif /* AFSAUXLIB */
  346. AFSLIB = -L$(AFSDIR)/lib -L$(AFSDIR)/lib/afs -lkauth -lprot -lubik\
  347. -lauth -lrxkad -lsys -ldes -lrx -llwp -lcom_err\
  348. $(AFSDIR)/lib/afs/util.a AFS33LIB AFSAUXLIB
  349. AFSDEF = -DAFS -I$(AFSDIR)/include
  350. #else
  351. AFSLIB =
  352. AFSDEF =
  353. #endif
  354. /* This is encore specific, but I don't know what encore's #define is,
  355. and it shouldn't hurt to have it here, so here it is */
  356. PARALLEL=12 # Make the multi-max run fast.
  357. #ifndef TcshTop
  358. #define TcshTop /usr/local
  359. #endif
  360. TCSHTOP = TcshTop
  361. #ifndef ManSuffix
  362. #define ManSuffix 1
  363. #endif
  364. MANSUFFIX = ManSuffix
  365. #ifdef TcshPath
  366. PATH_TCSHELL = TcshPath
  367. TCSHPATH = -D_PATH_TCSHELL='"$(PATH_TCSHELL)"'
  368. #else
  369. TCSHPATH =
  370. #endif
  371. #ifdef DestBin
  372. TCSH_BINDIR = DestBin
  373. #else
  374. TCSH_BINDIR = $(TCSHTOP)/bin
  375. #endif
  376. #ifdef DestMan
  377. TCSH_MANDIR = DestMan
  378. #else
  379. TCSH_MANDIR = $(TCSHTOP)/man/man$(MANSUFFIX)
  380. #endif
  381. LOCALLIBS =
  382. #ifndef MyCflags
  383. #define MyCflags
  384. #endif
  385. #ifndef MyDefines
  386. #define MyDefines
  387. #endif
  388. #ifndef MyIncludes
  389. #define MyIncludes
  390. #endif
  391. #ifndef MyStdc
  392. #define MyStdc
  393. #endif
  394. #ifdef CDebugFlags
  395. CDEBUGFLAGS = CDebugFlags
  396. #else
  397. # if HasGcc2
  398. CDEBUGFLAGS = -O2
  399. # else
  400. CDEBUGFLAGS = -O
  401. # endif
  402. #endif
  403. #ifdef HostType
  404. HOSTTYPE=HostType
  405. HTDEF = -DHOSTTYPE='"$(HOSTTYPE)"'
  406. #else
  407. HTDEF =
  408. #endif
  409. DEFINES = $(TCSHPATH) $(HESDEF) $(AFSDEF) $(HTDEF) MyDefines MyCflags MyStdc
  410. INCLUDES = -I. MyIncludes
  411. #ifdef MyLibs
  412. LDLIBS = MyLibs
  413. #endif
  414. SUF = o
  415. VERSION = 6.12
  416. SHSRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c \
  417. sh.char.c sh.exp.c sh.file.c sh.func.c \
  418. sh.glob.c sh.hist.c sh.init.c sh.lex.c \
  419. sh.misc.c sh.parse.c sh.print.c sh.proc.c \
  420. sh.sem.c sh.set.c sh.time.c glob.c \
  421. sh.char.h sh.dir.h sh.proc.h sh.h \
  422. sh.decls.h glob.h ${SYSSRCS}
  423. SHOBJS= sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \
  424. sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \
  425. sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \
  426. sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \
  427. sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} ${SYSOBJS}
  428. TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
  429. tw.comp.c tw.color.c
  430. TWOBJS= tw.help.${SUF} tw.init.${SUF} tw.parse.${SUF} tw.spell.${SUF} \
  431. tw.comp.${SUF} tw.color.${SUF}
  432. EDSRCS= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
  433. ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
  434. EDOBJS= ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \
  435. ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF}
  436. TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
  437. tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
  438. tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
  439. tc.who.c tc.h
  440. TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.defs.${SUF} \
  441. tc.disc.${SUF} tc.func.${SUF} tc.os.${SUF} tc.printf.${SUF} \
  442. tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \
  443. tc.vers.${SUF} tc.who.${SUF}
  444. MISCF = Makefile.std Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \
  445. WishList config_f.h eight-bit.me glob.3 patchlevel.h \
  446. pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
  447. README.imake complete.tcsh vmsreadme.txt Makefile.vms termcap.vms \
  448. snames.h host.defs gethost.c tcsh.man2html Makefile.in configure.in \
  449. Makefile.win32
  450. CONFSRCS=config/[a-z]*
  451. SRCS = $(SHSRCS) $(TWSRCS) $(EDSRCS) $(TCSRCS)
  452. OBJS = $(SHOBJS) $(TWOBJS) $(EDOBJS) $(TCOBJS)
  453. ALLSRCS= $(MISCF) $(SRCS) $(EXTF)
  454. AllTarget(tcsh)
  455. ed.defns.h: config.h ed.defns.c
  456. @rm -f $@
  457. @echo '/* Do not edit this file, make creates it. */' > $@
  458. @echo '#ifndef _h_ed_defns' >> $@
  459. @echo '#define _h_ed_defns' >> $@
  460. egrep '[FV]_' ed.defns.c | egrep '^#define' >> $@
  461. @echo '#endif /* _h_ed_defns */' >> $@
  462. sh.err.h: config.h sh.err.c
  463. @rm -f $@
  464. @echo '/* Do not edit this file, make creates it. */' > $@
  465. @echo '#ifndef _h_sh_err' >> $@
  466. @echo '#define _h_sh_err' >> $@
  467. egrep 'ERR_' sh.err.c | egrep '^#define' >> $@
  468. @echo '#endif /* _h_sh_err */' >> $@
  469. tc.const.h: config.h tc.const.c
  470. @rm -f $@
  471. @echo '/* Do not edit this file, make creates it. */' > $@
  472. @echo '#ifndef _h_tc_const' >> $@
  473. @echo '#define _h_tc_const' >> $@
  474. ${CC} -E $(INCLUDES) ${DEFINES} -D_h_tc_const tc.const.c | \
  475. grep 'Char STR' | \
  476. sed -e 's/Char \([a-zA-Z0-9_]*\)\[\].*/extern Char \1[];/' | \
  477. sort >> $@
  478. @echo '#endif /* _h_tc_const */' >> $@
  479. config.h: config_f.h
  480. cp config/ConfigH config.h
  481. $(OBJS): sh.err.h tc.const.h ed.defns.h
  482. tar.Z:
  483. rm -f tcsh-${VERSION}.tar.Z
  484. rm -rf tcsh-${VERSION}
  485. mkdir tcsh-${VERSION} tcsh-${VERSION}/config
  486. cp ${ALLSRCS} tcsh-${VERSION}
  487. cp ${CONFSRCS} tcsh-${VERSION}/config
  488. tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
  489. tar cvf - tcsh-${VERSION} | compress > tcsh-${VERSION}.tar.Z
  490. rm -rf tcsh-${VERSION}
  491. tar.gz:
  492. rm -f tcsh-${VERSION}.tar.gz
  493. rm -rf tcsh-${VERSION}
  494. mkdir tcsh-${VERSION} tcsh-${VERSION}/config
  495. cp ${ALLSRCS} tcsh-${VERSION}
  496. cp ${CONFSRCS} tcsh-${VERSION}/config
  497. tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
  498. tar cvf - tcsh-${VERSION} | gzip > tcsh-${VERSION}.tar.gz
  499. rm -rf tcsh-${VERSION}
  500. shar:
  501. rm -f tcsh-*.shar
  502. rm -rf tcsh-${VERSION}
  503. mkdir tcsh-${VERSION} tcsh-${VERSION}/config
  504. cp ${ALLSRCS} tcsh-${VERSION}
  505. cp ${CONFSRCS} tcsh-${VERSION}/config
  506. tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
  507. MAKESHAR -v -n tcsh-${VERSION} tcsh-${VERSION} \
  508. tcsh-${VERSION}/?* tcsh-${VERSION}/config/?* \
  509. tcsh-${VERSION}/?*/set?*
  510. rm -rf tcsh-${VERSION}
  511. catalogs:
  512. @(cd nls; make catalogs)
  513. world:
  514. $(MAKE) clean ; $(MAKE) depend ; $(MAKE) tcsh ; $(MAKE) install
  515. clean::
  516. rm -f ed.defns.h sh.err.h tc.const.h config.h tc.defs.*
  517. rm -f tcsh.*.m tcsh.*.cat
  518. depend:: config.h ed.defns.h sh.err.h tc.const.h $(SRCS) tc.defs.c
  519. tc.defs.${SUF}: tc.defs.c sh.h
  520. tc.defs.c: gethost host.defs
  521. @rm -f $@
  522. @echo "/* Do not edit this file, make creates it */" > $@
  523. ./gethost host.defs >> $@
  524. ALIB=$(HESLIB) $(AFSLIB) $(SYSLIBS)
  525. AINC=ed.defns.h sh.err.h tc.const.h sh.h
  526. NormalProgramTarget(tcsh, $(OBJS), $(AINC), $(LOCALLIBS), $(ALIB))
  527. NormalProgramTarget(gethost, gethost.${SUF}, $(AINC), $(LOCALLIBS), $(ALIB))
  528. InstallProgram(tcsh,$(TCSH_BINDIR))
  529. InstallManPage(tcsh,$(TCSH_MANDIR))
  530. DependTarget()