summaryrefslogtreecommitdiffstats
path: root/contrib/tcsh/Imakefile
blob: 7bedd7182636e41d77fb33ef72a5508dba826de3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
XCOMM
XCOMM $tcsh: Imakefile,v 1.87 2010/01/28 19:01:05 christos Exp $
XCOMM
XCOMM Imakefile for tcsh 6.12
XCOMM Marc Horowitz, MIT SIPB
XCOMM

#ifdef DestDir
#undef DestDir
#endif
#ifdef ManSuffix
#undef ManSuffix
#endif

/* All config options go in a separate file. */

#include "imake.config"

#ifndef HasGcc
# define HasGcc 0
#endif

#ifndef HasGcc2
# define HasGcc2 0
#endif

/* This is a giant conditional block.  It should be set up right for
platforms which are in here, but it may need to be changed for new
ones.  Please send in your fixes and additions! */

/**** tcsh configuration defines ****/

/* specific platforms */

#ifndef ConfigH
# ifdef UltrixArchitecture
#  define ConfigH ultrix
# endif

# ifdef UxpArchitecture
#  define ConfigH sysv4
# endif

# if defined(LinuxArchitecture) || defined(GNUArchitecture)
#  define ConfigH linux
# endif

# ifdef AlphaArchitecture
#  if !defined(LinuxArchitecture) && !defined(GNUArchitecture)
#    define ConfigH decosf1
#  endif
#  if !HasGcc
#   define MyCflags -std1 -Olimit 2000
#  else
#   define NoCombineRegs
#  endif
# endif

# if defined(VaxArchitecture) && !defined(UltrixArchitecture)
#  define ConfigH bsd
# endif

# ifdef NeXTArchitecture
#  define ConfigH mach
# endif

# if defined(SunArchitecture)
#  if (OSMajorVersion == 3)
#   define ConfigH sunos35
#  else
#   if (OSMajorVersion == 4)
#    if (OSMinorVersion == 0)
#     define ConfigH sunos40
#    else /* OSMinorVersion == 1 */
#     if (OSTeenyVersion == 3)
#      define ConfigH sunos413
#     else /* OsTeenyVersion in [0,1,2] */
#      define ConfigH sunos41
#     endif
#    endif
#    define NoCombineRegs
#   else /* OSMajorVersion == 5 */
#    if (OSMinorVersion < 3)
#     if (OSMinorVersion < 2)
#      define ConfigH sol2
#     else
#      define ConfigH sol22
#     endif
#    else
#     if (OSMinorVersion < 4)
#      define ConfigH sol23
#     else
#      if (OSMinorVersion < 6)
#       define ConfigH sol24
#      else
#       if (OSMinorVersion < 9)
#        define ConfigH sol26
#       else
#        define ConfigH sol29
#       endif
#      endif
#     endif
#    endif
#    define NoCombineRegs
#   endif
#  endif
# endif

# ifdef HPArchitecture
/* For some stupid reason makedepend on HP requires this */
DEPENDFLAGS = -o.o
#  if (OSMajorVersion >= 8)
#   define ConfigH hpux8
#  else
#   define ConfigH hpux7
#  endif
# endif

# ifdef CrayArchitecture
#  define ConfigH cray
# endif

# ifdef SGIArchitecture
#   define ConfigH irix
#   define UseLibBSD
#  if (OSMajorVersion < 5)
#   ifdef you_are_using_yp
#    define UseSunLib 
#   endif
#   if !HasGCC
#    define MyStdc -D__STDC__
#    if SGICompilerMajorVersion < 4
CCOPTIONS=-float	# We don't want -cckr and -prototypes
#    endif
#   endif
#  endif
#  if (OSMajorVersion == 6)
#   if (OSMinorVersion >= 2)
#    undef UseLibBSD
#    define ConfigH irix62
#   endif
#  endif
# endif

# ifdef IBMArchitecture
#  undef UseLibBSD
#  if (SystemV == YES)
#   define ConfigH aix
#   if OSMajorVersion < 3 
#    if OSMinorVersion < 2
#     define UseLibBSD
#    endif
#   endif
#  else
#   define ConfigH bsd
#   define AOSArchitecture
#  endif
# endif


#ifdef AOSArchitecture
#define MyStdc -U__STDC__
#endif

# if defined(MipsBsdArchitecture) || defined(MipsSysvArchitecture)
#  define ConfigH mips
# endif

# ifdef DguxArchitecture
#  define ConfigH dgux
# endif

# ifdef ConvexArchitecture
#  define ConfigH convex
# endif

# if defined(SQNTArchitecture) || defined(SequentArchitecture)
#  define ConfigH sequent
# endif

# ifdef MacIIArchitecture
#  define ConfigH mac2
# endif

# ifdef MinixArchitecture
/* Maybe conditional on MACH? */
SYSSRCS=mi.termios.c mi.wait.h mi.varargs.h
SYSOBJS=mi.termios.${SUF}
EXTF=ma.setp.c vms.termcap.c
# else
/* Maybe conditional on MACH? */
SYSSRCS=ma.setp.c
SYSOBJS=ma.setp.${SUF}
EXTF=mi.termios.c mi.wait.h mi.varargs.h vms.termcap.c
# endif

# ifdef i386Isc
#  if IscVersion != 202
#   define ConfigH isc
#   define UseLibCposix
#  else
#   define ConfigH isc202
#  endif
# endif /* i386Isc */

# ifdef OpenBSDArchitecture
#  define ConfigH bsd4.4
# endif /* OpenBsdArchitecture */

# ifdef NetBSDArchitecture
#  define ConfigH bsd4.4
# endif /* NetBsdArchitecture */

# ifdef FreeBSDArchitecture
#  define ConfigH bsd4.4
# endif /* FreeBsdArchitecture */

# ifdef MidnightBSDArchitecture
#  define ConfigH bsd4.4
# endif /* MidnightBsdArchitecture */

# ifdef i386SVR4Architecture
#  define ConfigH sysv4
#  ifdef DELL
#   define NoCombineRegs
#  endif
# endif

#endif /* !ConfigH */

/* generic os's */

#ifndef ConfigH

#if (SystemV == YES)
#define ConfigH sysv3
#else
/* why this as a default?  Why not? */
#define ConfigH bsd
#endif

#endif /* !ConfigH */

/**** libraries ****/

#if (SystemV == NO) || defined(HPArchitecture) || \
	defined(SQNTArchitecture) || defined(SequentArchitecture) || \
	defined(MacIIArchitecture) || defined(UseLibTermcap)
LIBTERMCAP = -ltermcap
#else
LIBTERMCAP =
#endif

#if defined(SQNTArchitecture) || defined(SequentArchitecture)
LIBSQNT=-lsocket -linet -lnsl -lseq
#endif

/* This may not be good enough - I don't have access to enough systems
to really test it. */
#if (SystemV == YES) || defined(UseLibCurses) && !defined(HPArchitecture)
LIBCURSES = -lcurses
#else
LIBCURSES =
#endif

#if defined(UseLibNet)
LIBNET = -lnet
#else
LIBNET =
#endif

#if defined(UseLibSocket)
LIBSOCKET = -lsocket
#else
LIBSOCKET =
#endif

#if defined(UseLibBSD)
LIBBSD = -lbsd
#else
LIBBSD = 
#endif

#if (defined(SGIArchitecture) && \
     (OSMajorVersion == 3) && (OSMinorVersion == 3)) || \
	defined(UseLibC_S)
LIBC_S = -lc_s
#else
LIBC_S =
#endif

#if defined(UseLibSun)
LIBSUN = -lsun
#else
LIBSUN =
#endif

#if defined(UseLibCposix)
LIBCPOSIX = -lcposix
#else
LIBCPOSIX =
#endif

#if defined(UseLibInet)
LIBINET = -linet
#else
LIBINET =
#endif

#if defined(UseLibDir)
LIBDIRECT = -ldir
#else
LIBDIRECT = 
#endif

#if defined(UseLibX)
LIBX = -lx
#else
LIBX =
#endif

#if defined(UseLibIntl)
LIBINTL = -lintl
#else
LIBINTL =
#endif

#if (HasLibCrypt == YES)
LIBCRYPT = -lcrypt
#else
LIBCRYPT =
#endif

#if defined(MacIIArchitecture) || defined(UseLibPosix)
LIBPOSIX = -lposix
#else
LIBPOSIX =
#endif

#if defined(ATTArchitecture) || defined(UseLibDirent)
LIBDIRECTENT = -ldirent
#else
LIBDIRECTENT =
#endif

/* The order here is significant.  Although nothing uses all of these, 
some platforms which use more than one do care about the order. */

SYSLIBS = $(LIBPOSIX) $(LIBDIRECTENT) $(LIBTERMCAP) $(LIBCURSES) \
	$(LIBNET) $(LIBINTL) $(LIBSOCKET) $(LIBSUN) $(LIBBSD) $(LIBCPOSIX) \
	$(LIBINET) $(LIBDIRECT) $(LIBX) $(LIBC_S) $(LIBSQNT) $(LIBCRYPT)

/* Past here, nothing should need to be changed to compile on a different
platform, unless you have a really weird architecture. */

#ifdef MyCC
CC = MyCC
#else
# if HasGcc
#  if HasGcc2
CC = gcc 
#  else
#   ifdef NoCombineRegs
CC = gcc -finline-functions -fstrength-reduce
#   else
CC = gcc -fcombine-regs -finline-functions -fstrength-reduce
#   endif
#  endif
# else
CC = cc
# endif
#endif

#ifdef HESIOD
HESLIB = -L/usr/athena/lib -lhesiod
/* it seems to me that the -I shouldn't be necessary, but there seems
to be a bug in the Imake stuff, so here it is. */
HESDEF = -DHESIOD -I/usr/athena/include
#else
HESLIB =
HESDEF =
#endif

#ifdef AFS
#ifndef AFSDIR
AFSDIR = /usr/afsws
#endif
#ifdef AFS33
#define AFS33LIB -laudit
#else
#define AFS33LIB
#endif
/* Auxilliary libs needed for AFS */
/* Both HPUX and Solaris need the BSD libraries.  We need -lc before
 * the bsd library to avoid using any more of it than is necessary.
 */
#if defined(HPArchitecture)
#define AFSAUXLIB -lc -lBSD
/* This is probably a kludge, but so is imake. */
#else
#if defined(SunArchitecture) && (OSMajorVersion == 5)
#define AFSAUXLIB -lsocket -lnsl -lc -lucb
#else
#define AFSAUXLIB
#endif
#endif /* AFSAUXLIB */
AFSLIB = -L$(AFSDIR)/lib -L$(AFSDIR)/lib/afs -lkauth -lprot -lubik\
	 -lauth -lrxkad -lsys -ldes -lrx -llwp -lcom_err\
	 $(AFSDIR)/lib/afs/util.a AFS33LIB AFSAUXLIB
AFSDEF = -DAFS -I$(AFSDIR)/include
#else
AFSLIB =
AFSDEF =
#endif

/* This is encore specific, but I don't know what encore's #define is,
and it shouldn't hurt to have it here, so here it is */
PARALLEL=12				# Make the multi-max run fast.

#ifndef TcshTop
#define TcshTop /usr/local
#endif
TCSHTOP = TcshTop

#ifndef ManSuffix
#define ManSuffix 1
#endif
MANSUFFIX = ManSuffix

#ifdef TcshPath
PATH_TCSHELL = TcshPath
TCSHPATH = -D_PATH_TCSHELL='"$(PATH_TCSHELL)"'
#else
TCSHPATH =
#endif

#ifdef DestBin
TCSH_BINDIR = DestBin
#else
TCSH_BINDIR = $(TCSHTOP)/bin
#endif
#ifdef DestMan
TCSH_MANDIR = DestMan
#else
TCSH_MANDIR = $(TCSHTOP)/man/man$(MANSUFFIX)
#endif

LOCALLIBS =

#ifndef MyCflags
#define MyCflags
#endif

#ifndef MyDefines
#define MyDefines
#endif

#ifndef MyIncludes
#define MyIncludes
#endif

#ifndef MyStdc
#define MyStdc
#endif

#ifdef CDebugFlags
CDEBUGFLAGS = CDebugFlags
#else
# if HasGcc2
CDEBUGFLAGS = -O2
# else
CDEBUGFLAGS = -O
# endif
#endif


#ifdef HostType
HOSTTYPE=HostType
HTDEF = -DHOSTTYPE='"$(HOSTTYPE)"'
#else
HTDEF =
#endif

DEFINES = $(TCSHPATH) $(HESDEF) $(AFSDEF) $(HTDEF) MyDefines MyCflags MyStdc
INCLUDES = -I. MyIncludes
#ifdef MyLibs
LDLIBS = MyLibs
#endif

SUF = o
VERSION = 6.12

SHSRCS=	sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c \
	sh.char.c sh.exp.c sh.file.c sh.func.c \
	sh.glob.c sh.hist.c sh.init.c sh.lex.c \
	sh.misc.c sh.parse.c sh.print.c sh.proc.c \
	sh.sem.c sh.set.c sh.time.c glob.c \
	sh.char.h sh.dir.h sh.proc.h sh.h \
	sh.decls.h glob.h ${SYSSRCS}
SHOBJS=	sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \
	sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \
	sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \
	sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \
	sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} ${SYSOBJS}

TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
	tw.comp.c tw.color.c
TWOBJS=	tw.help.${SUF} tw.init.${SUF} tw.parse.${SUF} tw.spell.${SUF} \
	tw.comp.${SUF} tw.color.${SUF}

EDSRCS= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
	ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
EDOBJS=	ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \
	ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF}

TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
	tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
	tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
	tc.who.c tc.h 
TCOBJS=	tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.defs.${SUF} \
	tc.disc.${SUF} tc.func.${SUF} tc.os.${SUF} tc.printf.${SUF} \
	tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \
	tc.vers.${SUF} tc.who.${SUF} 

MISCF = Makefile.std Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \
	WishList config_f.h eight-bit.me glob.3 patchlevel.h \
	pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
	README.imake complete.tcsh vmsreadme.txt Makefile.vms termcap.vms \
	snames.h host.defs gethost.c tcsh.man2html Makefile.in configure.in \
	Makefile.win32
CONFSRCS=config/[a-z]*


SRCS = $(SHSRCS) $(TWSRCS) $(EDSRCS) $(TCSRCS)
OBJS = $(SHOBJS) $(TWOBJS) $(EDOBJS) $(TCOBJS)

ALLSRCS= $(MISCF) $(SRCS) $(EXTF)

AllTarget(tcsh)

ed.defns.h: config.h ed.defns.c
	@rm -f $@
	@echo '/* Do not edit this file, make creates it. */' > $@
	@echo '#ifndef _h_ed_defns' >> $@
	@echo '#define _h_ed_defns' >> $@
	egrep '[FV]_' ed.defns.c | egrep '^#define' >> $@
	@echo '#endif /* _h_ed_defns */' >> $@

sh.err.h: config.h sh.err.c
	@rm -f $@
	@echo '/* Do not edit this file, make creates it. */' > $@
	@echo '#ifndef _h_sh_err' >> $@
	@echo '#define _h_sh_err' >> $@
	egrep 'ERR_' sh.err.c | egrep '^#define' >> $@
	@echo '#endif /* _h_sh_err */' >> $@

tc.const.h: config.h tc.const.c
	@rm -f $@
	@echo '/* Do not edit this file, make creates it. */' > $@
	@echo '#ifndef _h_tc_const' >> $@
	@echo '#define _h_tc_const' >> $@
	${CC} -E $(INCLUDES) ${DEFINES} -D_h_tc_const tc.const.c | \
	    grep 'Char STR' | \
	    sed -e 's/Char \([a-zA-Z0-9_]*\)\[\].*/extern Char \1[];/' | \
	    sort >> $@
	@echo '#endif /* _h_tc_const */' >> $@

config.h: config_f.h
	cp config/ConfigH config.h

$(OBJS): sh.err.h tc.const.h ed.defns.h

tar.Z:
	rm -f tcsh-${VERSION}.tar.Z
	rm -rf tcsh-${VERSION} 
	mkdir tcsh-${VERSION} tcsh-${VERSION}/config
	cp ${ALLSRCS} tcsh-${VERSION}
	cp ${CONFSRCS} tcsh-${VERSION}/config
	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
	tar cvf - tcsh-${VERSION} | compress > tcsh-${VERSION}.tar.Z
	rm -rf tcsh-${VERSION}

tar.gz:
	rm -f tcsh-${VERSION}.tar.gz
	rm -rf tcsh-${VERSION} 
	mkdir tcsh-${VERSION} tcsh-${VERSION}/config
	cp ${ALLSRCS} tcsh-${VERSION}
	cp ${CONFSRCS} tcsh-${VERSION}/config
	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
	tar cvf - tcsh-${VERSION} | gzip > tcsh-${VERSION}.tar.gz
	rm -rf tcsh-${VERSION}

shar:
	rm -f tcsh-*.shar
	rm -rf tcsh-${VERSION} 
	mkdir tcsh-${VERSION} tcsh-${VERSION}/config
	cp ${ALLSRCS} tcsh-${VERSION}
	cp ${CONFSRCS} tcsh-${VERSION}/config
	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
	MAKESHAR -v -n tcsh-${VERSION} tcsh-${VERSION} \
		 tcsh-${VERSION}/?* tcsh-${VERSION}/config/?* \
		 tcsh-${VERSION}/?*/set?*
	rm -rf tcsh-${VERSION}

catalogs:
	@(cd nls; make catalogs)
	
world:
	$(MAKE) clean ; $(MAKE) depend ; $(MAKE) tcsh ; $(MAKE) install

clean::
	rm -f ed.defns.h sh.err.h tc.const.h config.h tc.defs.*
	rm -f tcsh.*.m tcsh.*.cat

depend:: config.h ed.defns.h sh.err.h tc.const.h $(SRCS) tc.defs.c

tc.defs.${SUF}:	tc.defs.c sh.h

tc.defs.c:	gethost host.defs
	@rm -f $@
	@echo "/* Do not edit this file, make creates it */" > $@
	./gethost host.defs >> $@

ALIB=$(HESLIB) $(AFSLIB) $(SYSLIBS)
AINC=ed.defns.h sh.err.h tc.const.h sh.h

NormalProgramTarget(tcsh, $(OBJS), $(AINC), $(LOCALLIBS), $(ALIB))
NormalProgramTarget(gethost, gethost.${SUF}, $(AINC), $(LOCALLIBS), $(ALIB))

InstallProgram(tcsh,$(TCSH_BINDIR))
InstallManPage(tcsh,$(TCSH_MANDIR))
DependTarget()
OpenPOWER on IntegriCloud