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