home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Unix / Shells / tcsh / Source / Imakefile < prev    next >
Encoding:
Makefile  |  1994-02-21  |  9.7 KB  |  455 lines

  1. /**/#
  2. /**/# $Id: Imakefile,v 1.23 1992/11/20 08:56:38 christos Exp $
  3. /**/#
  4. /**/# Imakefile for for tcsh 6.03
  5. /**/# Marc Horowitz, MIT SIPB
  6. /**/#
  7.  
  8. #ifdef DestDir
  9. #undef DestDir
  10. #endif
  11. #ifdef ManSuffix
  12. #undef ManSuffix
  13. #endif
  14.  
  15. /* All config options go in a separate file. */
  16.  
  17. #include "imake.config"
  18.  
  19. /* This is a giant conditional block.  It should be set up right for
  20. platforms which are in here, but it may need to be changed for new
  21. ones.  Please send in your fixes and additions! */
  22.  
  23. /**** tcsh configuration defines ****/
  24.  
  25. /* specific platforms */
  26.  
  27. #ifndef ConfigH
  28. # ifdef UltrixArchitecture
  29. #  define ConfigH ultrix
  30. # endif
  31.  
  32. # if defined(VaxArchitecture) && !defined(UltrixArchitecture)
  33. #  define ConfigH bsd
  34. # endif
  35.  
  36. # ifdef NeXTArchitecture
  37. #  define ConfigH mach
  38. # endif
  39.  
  40. # if defined(SunArchitecture)
  41. #  if (OSMajorVersion == 3)
  42. #   define ConfigH sos3
  43. #  else /* OSMajorVersion == 4 */
  44. #   if (OSMinorVersion == 0)
  45. #    define ConfigH sos40
  46. #   else /* OSMinorVersion == 1 */
  47. #    if (OSTeenyVersion == 3)
  48. #     define ConfigH sos413
  49. #    else /* OsTeenyVersion in [0,1,2] */
  50. #     define ConfigH sos41
  51. #    endif
  52. #   endif
  53. #  endif
  54. # endif
  55.  
  56. # ifdef HPArchitecture
  57. #  if (OSMajorVersion == 8)
  58. #   define ConfigH hpux8
  59. #  else
  60. #   define ConfigH hpux7
  61. #  endif
  62. # endif
  63.  
  64. # ifdef CrayArchitecture
  65. #  define ConfigH cray
  66. # endif
  67.  
  68. # ifdef SGIArchitecture
  69. #  define ConfigH sgi
  70. #  ifdef you_are_using_yp
  71. #   define UseSunLib 
  72. #  endif
  73. # endif
  74.  
  75. # ifdef IBMArchitecture
  76. #  if (SystemV == YES)
  77. #   define ConfigH aix
  78. #  else
  79. #   define ConfigH bsd
  80. #   define AOSArchitecture
  81. #  endif
  82. # endif
  83.  
  84. # if defined(MipsBsdArchitecture) || defined(MipsSysvArchitecture)
  85. #  define ConfigH mips
  86. # endif
  87.  
  88. # ifdef DguxArchitecture
  89. #  define ConfigH dgux
  90. # endif
  91.  
  92. # ifdef ConvexArchitecture
  93. #  define ConfigH convex
  94. # endif
  95.  
  96. # ifdef SQNTArchitecture
  97. #  define ConfigH sequent
  98. # endif
  99.  
  100. # ifdef MacIIArchitecture
  101. #  define ConfigH mac2
  102. # endif
  103.  
  104. # ifdef MinixArchitecture
  105. /* Maybe conditional on MACH? */
  106. SYSSRCS=mi.termios.c mi.wait.h mi.varargs.h
  107. SYSOBJS=mi.termios.${SUF}
  108. EXTF=ma.setp.c vms.termcap.c
  109. # else
  110. /* Maybe conditional on MACH? */
  111. SYSSRCS=ma.setp.c
  112. SYSOBJS=ma.setp.${SUF}
  113. EXTF=mi.termios.c mi.wait.h vms.termcap.c
  114. # endif
  115. #endif /* !ConfigH */
  116.  
  117. /* generic os's */
  118.  
  119. #ifndef ConfigH
  120.  
  121. #if (SystemV == YES)
  122. #define ConfigH sysv3
  123. #else
  124. /* why this as a default?  Why not? */
  125. #define ConfigH bsd
  126. #endif
  127.  
  128. #endif /* !ConfigH */
  129.  
  130. /*
  131.  * Concat3 - concatenates three strings.
  132.  */
  133. #ifndef Concat3
  134. # if defined(__STDC__) && !defined(UnixCpp)
  135. #  define XConcat3(a,b,c) a##b##c
  136. #  define Concat3(a,b,c) XConcat3(a,b,c)
  137. # else
  138. #  define Concat3(a,b,c) a/**/b/**/c
  139. # endif
  140. #endif
  141.  
  142. #CONFIGH = Concat3(-DCONFIGH=\"config/config.,ConfigH,\")
  143.  
  144. #ifdef TcshPath
  145. TCSHPATH = Concat3(-D_PATH_TCSHELL=\",TcshPath,\")
  146. #else
  147. TCSHPATH =
  148. #endif
  149.  
  150. /**** libraries ****/
  151.  
  152. #if (SystemV == NO) || defined(HPArchitecture) || defined(SQNTArchitecture) || \
  153.     defined(MacIIArchitecture) || defined(UseLibTermcap)
  154. LIBTERMCAP = -ltermcap
  155. #else
  156. LIBTERMCAP =
  157. #endif
  158.  
  159. #if defined(SQNTArchitecture)
  160. LIBSQNT=-lseq
  161. #endif
  162.  
  163. /* This may not be good enough - I don't have access to enough systems
  164. to really test it. */
  165. #if (SystemV == YES) || defined(UseLibCurses) && !defined(HPArchitecture)
  166. LIBCURSES = -lcurses
  167. #else
  168. LIBCURSES =
  169. #endif
  170.  
  171. #if defined(UseLibNet)
  172. LIBNET = -lnet
  173. #else
  174. LIBNET =
  175. #endif
  176.  
  177. #if defined(UseLibSocket)
  178. LIBSOCKET = -lsocket
  179. #else
  180. LIBSOCKET =
  181. #endif
  182.  
  183. #if defined(SGIArchitecture) || defined(_IBMR2) || \
  184.     (!defined(RtArchitecture) && defined(AIXArchitecture)) || \
  185.     defined(UseLibBSD)
  186. LIBBSD = -lbsd
  187. #else
  188. LIBBSD = 
  189. #endif
  190.  
  191. #if (defined(SGIArchitecture) && \
  192.      (OSMajorVersion == 3) && (OSMinorVersion == 3)) || \
  193.     defined(UseLibC_S)
  194. LIBC_S = -lc_s
  195. #else
  196. LIBC_S =
  197. #endif
  198.  
  199. #if defined(UseLibSun)
  200. LIBSUN = -lsun
  201. #else
  202. LIBSUN =
  203. #endif
  204.  
  205. #if defined(UseLibCposix)
  206. LIBCPOSIX = -lcposix
  207. #else
  208. LIBCPOSIX =
  209. #endif
  210.  
  211. #if defined(UseLibInet)
  212. LIBINET = -linet
  213. #else
  214. LIBINET =
  215. #endif
  216.  
  217. #if defined(UseLibDir)
  218. LIBDIRECT = -ldir
  219. #else
  220. LIBDIRECT = 
  221. #endif
  222.  
  223. #if defined(UseLibX)
  224. LIBX = -lx
  225. #else
  226. LIBX =
  227. #endif
  228.  
  229. #if defined(UseLibIntl)
  230. LIBINTL = -lintl
  231. #else
  232. LIBINTL =
  233. #endif
  234.  
  235. #if defined(MacIIArchitecture) || defined(UseLibPosix)
  236. LIBPOSIX = -lposix
  237. #else
  238. LIBPOSIX =
  239. #endif
  240.  
  241. #if defined(ATTArchitecture) || defined(UseLibDirent)
  242. LIBDIRECTENT = -ldirent
  243. #else
  244. LIBDIRECTENT =
  245. #endif
  246.  
  247. # The order here is significant.  Although nothing uses all of these, 
  248. # some platforms which use more than one do care about the order.
  249.  
  250. SYSLIBS = $(LIBPOSIX) $(LIBDIRECTENT) $(LIBTERMCAP) $(LIBCURSES) \
  251.     $(LIBNET) $(LIBINTL) $(LIBSOCKET) $(LIBSUN) $(LIBBSD) $(LIBCPOSIX) \
  252.     $(LIBINET) $(LIBDIRECT) $(LIBX) $(LIBC_S) $(LIBSQNT)
  253.  
  254. /* Past here, nothing should need to be changed to compile on a different
  255. platform, unless you have a really weird architecture. */
  256.  
  257. #ifdef MyCC
  258. CC = MyCC
  259. #else
  260. # if HasGcc || HasGCC
  261. #  ifdef HasGcc2
  262. CC = gcc 
  263. #  else
  264. CC = gcc -fcombine-regs -finline-functions -fstrength-reduce
  265. #  endif
  266. # else
  267. CC = cc
  268. # endif
  269. #endif
  270.  
  271. #ifdef HESIOD
  272. HESLIB = -L/usr/athena/lib -lhesiod
  273. /* it seems to me that the -I shouldn't be necessary, but there seems
  274. to be a bug in the Imake stuff, so here it is. */
  275. HESDEF = -DHESIOD -I/usr/athena/include
  276. #else
  277. HESLIB =
  278. HESDEF =
  279. #endif
  280.  
  281. /* This is encore specific, but I don't know what encore's #define is,
  282. and it shouldn't hurt to have it here, so here it is */
  283. PARALLEL=12                # Make the multi-max run fast.
  284.  
  285. #ifndef TcshTop
  286. #define TcshTop /usr/local
  287. #endif
  288.  
  289. TCSHTOP = TcshTop
  290. MANSUFFIX = 1
  291. #ifndef ManSuffix
  292. #define ManSuffix $(MANSUFFIX)
  293. #endif
  294. #ifdef DestBin
  295. BINDIR = DestBin
  296. #else
  297. BINDIR = $(TCSHTOP)/bin
  298. #endif
  299. #ifdef DestMan
  300. MANDIR = DestMan
  301. #else
  302. MANDIR = $(TCSHTOP)/man/man$(MANSUFFIX)
  303. #endif
  304.  
  305. #ifndef MyCflags
  306. #define MyCflags
  307. #endif
  308.  
  309. #ifndef MyDefines
  310. #define MyDefines
  311. #endif
  312.  
  313. #ifndef MyIncludes
  314. #define MyIncludes
  315. #endif
  316.  
  317. #ifndef MyLibs
  318. #define MyLibs
  319. #endif
  320.  
  321. #ifdef CDebugFlags
  322. CDEBUGFLAGS = CDebugFlags
  323. #else
  324. # ifdef HasGcc2
  325. CDEBUGFLAGS = -O2
  326. # else
  327. CDEBUGFLAGS = -O
  328. # endif
  329. #endif
  330.  
  331. #ifdef AOSArchitecture
  332. #define UStdc -U__STDC__
  333. #else
  334. #define UStdc
  335. #endif
  336.  
  337. #ifdef HostType
  338. HTDEF = Concat3(-DHOSTTYPE=\",HostType,\")
  339. #else
  340. HTDEF =
  341. #endif
  342.  
  343. DEFINES = $(TCSHPATH) $(HESDEF) $(HTDEF) MyDefines MyCflags UStdc
  344. INCLUDES = -I. MyIncludes
  345. LDLIBS = MyLibs
  346.  
  347. SUF = o
  348. VERSION = 6.03
  349.  
  350. SHSRCS=    sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
  351.     sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
  352.     sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
  353.     sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h \
  354.     sh.decls.h glob.c glob.h ${SYSSRCS}
  355. SHOBJS=    sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \
  356.     sh.char.${SUF} sh.exp.${SUF} sh.func.${SUF} sh.glob.${SUF} \
  357.     sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} sh.misc.${SUF} \
  358.     sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} sh.sem.${SUF} \
  359.     sh.set.${SUF} sh.time.${SUF} glob.${SUF} ${SYSOBJS}
  360.  
  361. TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
  362.     tw.comp.c
  363. TWOBJS=    tw.help.${SUF} tw.init.${SUF} tw.parse.${SUF} tw.spell.${SUF} \
  364.     tw.comp.${SUF}
  365.  
  366. EDSRCS= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
  367.     ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
  368. EDOBJS=    ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \
  369.     ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF}
  370.  
  371. TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
  372.     tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
  373.     tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
  374.     tc.who.c tc.h
  375. TCOBJS=    tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.disc.${SUF} \
  376.     tc.func.${SUF} tc.os.${SUF} tc.printf.${SUF} \
  377.     tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \
  378.     tc.vers.${SUF} tc.who.${SUF} 
  379.  
  380. MISCF = Makefile Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \
  381.     WishList config_f.h eight-bit.me glob.3 patchlevel.h \
  382.     pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
  383.     README.imake complete.tcsh vmsreadme.txt Makefile.vms termcap.vms
  384. CONFSRCS=config/config.*
  385.  
  386.  
  387. SRCS = $(SHSRCS) $(TWSRCS) $(EDSRCS) $(TCSRCS)
  388. OBJS = $(SHOBJS) $(TWOBJS) $(EDOBJS) $(TCOBJS)
  389.  
  390. ALLSRCS= $(MISCF) $(SRCS) $(EXTF)
  391.  
  392. all:: tcsh
  393.  
  394. ed.defns.h: config.h ed.defns.c
  395.     @rm -f $@
  396.     @echo '/* Do not edit this file, make creates it. */' > $@
  397.     @echo '#ifndef _h_ed_defns' >> $@
  398.     @echo '#define _h_ed_defns' >> $@
  399.     egrep '[FV]_' ed.defns.c | egrep '^#define' >> $@
  400.     @echo '#endif /* _h_ed_defns */' >> $@
  401.  
  402. sh.err.h: config.h sh.err.c
  403.     @rm -f $@
  404.     @echo '/* Do not edit this file, make creates it. */' > $@
  405.     @echo '#ifndef _h_sh_err' >> $@
  406.     @echo '#define _h_sh_err' >> $@
  407.     egrep 'ERR_' sh.err.c | egrep '^#define' >> $@
  408.     @echo '#endif /* _h_sh_err */' >> $@
  409.  
  410. tc.const.h: config.h tc.const.c
  411.     @rm -f $@
  412.     @echo '/* Do not edit this file, make creates it. */' > $@
  413.     $(CC) -E $(CFLAGS) tc.const.c | egrep 'Char STR' | \
  414.         sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
  415.         sort >> $@
  416.  
  417. config.h:
  418.     @cp config/config.ConfigH config.h
  419.  
  420. $(OBJS): sh.err.h tc.const.h ed.defns.h
  421.  
  422. tar:
  423.     rm -f tcsh-${VERSION}.tar.Z
  424.     rm -rf tcsh-${VERSION} 
  425.     mkdir tcsh-${VERSION} tcsh-${VERSION}/config
  426.     cp ${ALLSRCS} tcsh-${VERSION}
  427.     cp ${CONFSRCS} tcsh-${VERSION}/config
  428.     tar cvf - tcsh-${VERSION} | compress > tcsh-${VERSION}.tar.Z
  429.     rm -rf tcsh-${VERSION}
  430.  
  431. shar:
  432.     rm -f tcsh-*.shar
  433.     rm -rf tcsh-${VERSION} 
  434.     mkdir tcsh-${VERSION} tcsh-${VERSION}/config
  435.     cp ${ALLSRCS} tcsh-${VERSION}
  436.     cp ${CONFSRCS} tcsh-${VERSION}/config
  437.     MAKESHAR -v -n tcsh-${VERSION} tcsh-${VERSION} \
  438.          tcsh-${VERSION}/?* tcsh-${VERSION}/config/?*
  439.     rm -rf tcsh-${VERSION}
  440.  
  441. world:
  442.     make clean ; make depend ; make tcsh ; make install
  443.  
  444. clean::
  445.     rm -f ed.defns.h sh.err.h tc.const.h config.h
  446.  
  447. depend:: config.h ed.defns.h sh.err.h tc.const.h $(SRCS)
  448.  
  449. NormalProgramTarget(tcsh, $(OBJS), ed.defns.h sh.err.h tc.const.h, \
  450.             /*LOCALLIBS*/, $(HESLIB) $(SYSLIBS))
  451.  
  452. InstallProgram(tcsh, $(BINDIR));
  453. InstallManPage(tcsh, $(MANDIR));
  454. DependTarget()
  455.