This file is indexed.

/usr/lib/X11/config/XView.rules is in xviewg-dev 3.2p1.4-28.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
XCOMM ###########################################################################
XCOMM # @(#)XView.rules	1.8 12 May 1993 SMI
XCOMM # XView.rules for XView release 3.0.  Imake rules needed by distribution.

/*
 ***********************************************************************
 *
 *	Imake rules for XView
 *	*** DO NOT CHANGE ANYTHING BELOW THIS LINE! ***
 *
 ***********************************************************************
 */
/*
 * SubdirNormalLibTarget - create an "all::" target for a library;
 */
#ifndef SubdirNormalLibTarget
#define SubdirNormalLibTarget(libname, objlist)				@@\
AllTarget(lib/**/libname.a)						@@\
									@@\
lib/**/libname.a:: objlist						@@\
	$(AR) $(TARGETDIR)$@ objlist

#endif /* SubdirNormalLibTarget */

/*
 * SubdirProfiledLibTarget - create an "all::" target for a profiled library;
 */
#ifndef SubdirProfiledLibTarget
#define SubdirProfiledLibTarget(libname, objlist)			@@\
AllTarget(lib/**/libname/**/_p.a)					@@\
									@@\
lib/**/libname/**/_p.a:: objlist					@@\
	( cd profiled; $(AR) ../$(TARGETDIR)$@ objlist )

#endif /* SubdirProfiledLibTarget */

/*
 * SubdirDebuggedLibTarget - create an "all::" target for a debugged library;
 */
#ifndef SubdirDebuggedLibTarget
#define SubdirDebuggedLibTarget(libname, objlist)			@@\
AllTarget(lib/**/libname/**/_d.a)					@@\
									@@\
lib/**/libname/**/_d.a:: objlist					@@\
	( cd debugger; $(AR) ../$(TARGETDIR)$@ objlist )

#endif /* SubdirDebuggedLibTarget */

/*
 * SubdirCompoundLibTarget - create an "all::" target for a compound library;
 * --same rule as SubdirNormalLibTarget--compatibility
 */
#ifndef SubdirCompoundLibTarget
#define SubdirCompoundLibTarget(libname, objlist)			@@\
AllTarget(lib/**/libname.a)						@@\
									@@\
lib/**/libname.a:: objlist						@@\
	$(AR) $(TARGETDIR)$@ objlist

#endif /* SubdirCompoundLibTarget */

/* 
 * MakeAnythingSubdirs - go into subdirs to make anything for a given target;
 */
#ifndef MakeAnythingSubdirs
#define MakeAnythingSubdirs(name,dirs)					@@\
name::									@@\
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \			@@\
	for i in dirs ;\						@@\
	do \								@@\
		(cd $$i ; echo "making name in $$i"; \			@@\
			$(MAKE) PassCDebugFlags $(MFLAGS) name); \	@@\
	done

#endif /* MakeAnythingSubdirs */

/*
 * InstallLibraryNoBuild - install a library without first trying to build it;
 * Check if need to do ranlib
 */
#if DoRanlibCmd

#ifndef InstallLibraryNoBuild
#define	InstallLibraryNoBuild(libname,dest)				@@\
install:: 								@@\
	-$(INSTALL) -c $(INSTLIBFLAGS) lib/**/libname.a $(DESTDIR)dest	@@\
	-$(RANLIB) $(RANLIBINSTFLAGS) $(DESTDIR)dest/lib/**/libname.a

#endif /* InstallLibraryNoBuild */

#else /* DoRanlibCmd */

#ifndef InstallLibraryNoBuild
#define	InstallLibraryNoBuild(libname,dest)				@@\
install:: 								@@\
	-$(INSTALL) -c $(INSTLIBFLAGS) lib/**/libname.a $(DESTDIR)dest
#endif /* InstallLibraryNoBuild */

#endif /* DoRanlibCmd */

/*
 * SubdirNormalSharedLibraryTarget - generate rules to create a shared library;
 * do not build it since this is for a subdirectory.  Move the files to the
 * shared library directory for all objects in solist.
 */
#ifndef SubdirNormalSharedLibraryTarget
#ifdef __linux__
#define SubdirNormalSharedLibraryTarget(libname,rev,solist,dir,sub)	@@\
AllTarget(lib/**/libname.so.rev)					@@\
									@@\
lib/**/libname.so.rev::  solist						@@\
	-@if [ ! -d dir ]; then mkdir dir; else exit 0; fi		@@\
	@case '${MFLAGS}' in *[i]*) set +e;; esac; \			@@\
	pwd="`pwd`"; \							@@\
	for i in solist; do (set -x; $(RM) dir/$$i; $(LN) "$$pwd"/sub/$$i dir/$$i); done

#else /* __linux__ */
#define SubdirNormalSharedLibraryTarget(libname,rev,solist,dir,sub)	@@\
AllTarget(lib/**/libname.so.rev)					@@\
									@@\
lib/**/libname.so.rev::  solist						@@\
	-@if [ ! -d dir ]; then mkdir dir; else exit 0; fi		@@\
	@case '${MFLAGS}' in *[i]*) set +e;; esac; \			@@\
	for i in solist; do (set -x; $(CP) sub/$$i dir; $(CP) sub/$$i .); done

#endif /* !__linux__ */
#endif /* SubdirNormalSharedLibraryTarget */

/*
 * SubdirNormalSharedLibraryDataTarget - generate rules to create shlib data file;
 * do not build it since this is for a subdirectory.  Copy the files to the
 * shared library data directory for all objects in salist.  Delete the
 * unneeded data modules from the ./shared directory.
 */
#ifndef SubdirNormalSharedLibraryDataTarget
#ifdef __linux__
#define SubdirNormalSharedLibraryDataTarget(libname,rev,salist,dir,sub)
#else /* __linux__ */
#define SubdirNormalSharedLibraryDataTarget(libname,rev,salist,dir,sub)	@@\
AllTarget(lib/**/libname.sa.rev)					@@\
									@@\
lib/**/libname.sa.rev::  salist						@@\
	-@if [ ! -d dir ]; then mkdir dir; else exit 0; fi		@@\
	@case '${MFLAGS}' in *[i]*) set +e;; esac; \			@@\
	for i in salist; do \						@@\
	(set -x; $(CP) sub/$$i dir; $(CP) shared/$$i $(SHARED_DIR)); done

#endif /* !__linux__ */
#endif /* SubdirNormalSharedLibraryDataTarget */


/*
 * SubdirBuildNormalSharedLibraryTarget - generate rules to create a shared library;
 * build it into a different name so that the we don't hose people by having
 * the library gone for long periods.  The lib<foo>.so part contains the entire
 * library both text and data modules.  The globally initialized data must be
 * included in both the .so and the .sa parts of the library.
 */
#ifndef SubdirBuildNormalSharedLibraryTarget
#ifdef __linux__

#define SubdirBuildNormalSharedLibraryTarget(libname,rev,solist,sodir)		@@\
AllTarget(lib/**/libname.so.rev)					@@\
									@@\
lib/**/libname.so.rev:: solist 						@@\
	$(RM) $@~	@@\
	(cd sodir; $(CC) -shared -Wl,-soname -Wl,`basename $@ | sed 's/\(\.[0-9]\).*$$/\1/'` -o $@~ ?*.o $(XVIEW_DEPLIBS)) @@\
	$(RM) $@ `basename $@ | sed 's/\(\.[0-9]\).*$$/\1/'` lib/**/libname.so @@\
	$(MV) sodir/$@~ $@ @@\
	$(LN) $@ `basename $@ | sed 's/\(\.[0-9]\).*$$/\1/'` @@\
	$(LN) $@ lib/**/libname.so @@\
@@\
@@\
clean::	@@\
	$(RM) lib/**/libname.so.rev `basename lib/**/libname.so.rev | sed 's/\(\.[0-9]\).*$$/\1/'` lib/**/libname.so sodir/?*.o

#else /* __linux__ */

#define SubdirBuildNormalSharedLibraryTarget(libname,rev,solist,sodir)		@@\
AllTarget(lib/**/libname.so.rev)					@@\
									@@\
lib/**/libname.so.rev:: solist 						@@\
	$(RM) $@~ sodir/lib/**/libname.so.xs.o				@@\
	@if [ -f xstrings ]; then \                                     @@\
        	$(RM) strings; $(CP) xstrings strings; fi               @@\
	(cd sodir; $(LD) -o ../$@~ $(SHLIBLDFLAGS) ?*.o)		@@\
	-@if [ -f strings~ ]; then $(RM) strings~; else exit 0; fi	@@\
	$(RM) $@  							@@\
	$(MV) $@~ $@							@@\
									@@\
clean::									@@\
	$(RM) lib/**/libname.so.rev sodir/?*.o strings*

#endif /* !__linux__ */

#endif /* SubdirBuildNormalSharedLibraryTarget */

/*
 * SubdirBuildSortedSharedLibraryTarget - rules to create a sorted shlib;
 * build it into a different name so that the we don't hose people by having
 * the library gone for long periods.  The lib<foo>.so part contains the entire
 * library both text and data modules.  The globally initialized data must be
 * included in both the .so and the .sa parts of the library.  Must have the
 * sorting script and a list of objects to sort.
 */
#ifndef SubdirBuildSortedSharedLibraryTarget
#ifdef __linux__

#define SubdirBuildSortedSharedLibraryTarget(libname,rev,solist,sodir,objsort,objlist) \
		SubdirBuildNormalSharedLibraryTarget(libname,rev,solist,sodir)

#else /* __linux__ */

#define SubdirBuildSortedSharedLibraryTarget(libname,rev,solist,sodir,objsort,objlist) @@\
AllTarget(lib/**/libname.so.rev)					@@\
									@@\
lib/**/libname.so.rev:: solist 						@@\
	$(RM) $@~ sodir/lib/**/libname.so.xs.o				@@\
	@if [ -f xstrings ]; then \                                     @@\
        	$(RM) strings; $(CP) xstrings strings; fi               @@\
	-@if [ ! -x objsort ];then $(CHMOD) 755 objsort;else exit 0;fi	@@\
	$(LD) `objsort objlist sodir` -o $@~ $(SHLIBLDFLAGS) 		@@\
	@if [ -f strings~ ]; then $(RM) strings~; else exit 0; fi	@@\
	$(RM) $@  							@@\
	$(MV) $@~ $@							@@\
									@@\
clean::									@@\
	$(RM) lib/**/libname.so.rev sodir/?*.o strings* xstrings*

#endif /* !__linux__ */
#endif /* SubdirBuildSortedSharedLibraryTarget */

/*
 * SubdirBuildNormalSharedLibraryDataTarget - generate rules to create shlib data file;
 * Do not use xstr or pic on the data file segments.
 * The lib<foo>.sa part defines the interface for globally initialized data.
 * Check if ranlib is needed.
 */
#if DoRanlibCmd

#ifndef SubdirBuildNormalSharedLibraryDataTarget

#ifdef __linux__
#define SubdirBuildNormalSharedLibraryDataTarget(libname,rev,sadir)

#else /* __linux__ */

#define SubdirBuildNormalSharedLibraryDataTarget(libname,rev,sadir)	@@\
AllTarget(lib/**/libname.sa.rev)					@@\
									@@\
lib/**/libname.sa.rev::  						@@\
	$(RM) $@~							@@\
	(cd sadir; $(AR) ../$@~ ?*.o)					@@\
	$(RM) $@ 							@@\
	$(MV) $@~ $@							@@\
	$(RANLIB) $@							@@\
									@@\
clean::									@@\
	$(RM) lib/**/libname.sa.rev sadir/?*.o

#endif /* !__linux__ */
#endif /* SubdirBuildNormalSharedLibraryDataTarget */

#else /* DoRanlibCmd */

#ifndef SubdirBuildNormalSharedLibraryDataTarget
#ifdef __linux__
#define SubdirBuildNormalSharedLibraryDataTarget(libname,rev,sadir)
#else /* __linux__ */
#define SubdirBuildNormalSharedLibraryDataTarget(libname,rev,sadir)	@@\
AllTarget(lib/**/libname.sa.rev)					@@\
									@@\
lib/**/libname.sa.rev::  						@@\
	$(RM) $@~							@@\
	(cd sadir; $(AR) ../$@~ ?*.o)					@@\
	$(RM) $@ 							@@\
	$(MV) $@~ $@							@@\
									@@\
clean::									@@\
	$(RM) lib/**/libname.sa.rev sadir/?*.o

#endif /* SubdirBuildNormalSharedLibraryDataTarget */

#endif /* !__linux__ */
#endif /* DoRanlibCmd */

/*
 * SubdirSharedLibraryObjectRule - generate make rules to build 
 * "normal" SunOS style shared object files.  XView absolutely requires
 * the use of xstr to build a shared library; otherwise, the library will
 * overflow the GLOBAL_OFFSET_TABLE for some architectures.
 */
#ifndef SubdirSharedLibraryObjectRule
#ifdef __linux__
#define SubdirSharedLibraryObjectRule()					@@\
all::									@@\
	-@if [ ! -d shared ]; then mkdir shared; else exit 0; fi	@@\
	-@if [ ! -f $(XSTR_STRINGS_FILE) ]; then \                      @@\
		touch $(XSTR_STRINGS_FILE);  else exit 0; fi            @@\
	-@if [ ! -f strings ]; then \                                   @@\
		$(LN) $(XSTR_STRINGS_FILE) strings; else exit 0; fi     @@\
									@@\
.c.o:									@@\
	$(RM) $@ shared/$@						@@\
	$(CC) $(PIC) $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) $(STRCONST) -c $*.c -o shared/$*.o	@@\
	$(CC) $(CFLAGS) $(STRCONST) -c $*.c -o $*.o			@@\
									@@\
clean::									@@\
	$(RM) strings*							@@\
	-@if [ -d shared ]; then echo "	$(RM) shared/?*.o"; \		@@\
		$(RM) shared/?*.o; else exit 0; fi			@@\

#else /* __linux__ */
#define SubdirSharedLibraryObjectRule()					@@\
all::									@@\
	-@if [ ! -d shared ]; then mkdir shared; else exit 0; fi	@@\
	-@if [ ! -f $(XSTR_STRINGS_FILE) ]; then \                      @@\
		touch $(XSTR_STRINGS_FILE);  else exit 0; fi            @@\
	-@if [ ! -f strings ]; then \                                   @@\
		$(LN) $(XSTR_STRINGS_FILE) strings; else exit 0; fi     @@\
									@@\
.c.o:									@@\
	$(RM) $@ shared/$@						@@\
	$(CC) $(PIC) $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) $(STRCONST) -c $*.c \	@@\
		-o shared/$*.o						@@\
									@@\
clean::									@@\
	$(RM) strings*							@@\
	-@if [ -d shared ]; then echo "	$(RM) shared/?*.o"; \		@@\
		$(RM) shared/?*.o; else exit 0; fi			@@\

#endif /* !__linux__ */
#endif /* SubdirSharedLibraryObjectRule */

/*
 * SubdirSharedAndDebuggedLibraryObjectRule - generate make rules to build shared,
 * debuggable, and "normal" object files.
 */
#ifndef SubdirSharedAndDebuggedLibraryObjectRule
#define SubdirSharedAndDebuggedLibraryObjectRule()				@@\
all::									@@\
	-@if [ ! -d shared ]; then mkdir shared; else exit 0; fi	@@\
	-@if [ ! -f $(XSTR_STRINGS_FILE) ]; then \                      @@\
		touch $(XSTR_STRINGS_FILE);  else exit 0; fi            @@\
	-@if [ -f strings ]; then $(RM) strings; else exit 0; fi        @@\
	$(LN) $(XSTR_STRINGS_FILE) strings                              @@\
	-@if [ ! -d debugger ]; then mkdir debugger; else exit 0; fi	@@\
									@@\
.c.o:									@@\
	$(RM) $@ shared/$@ debugger/$@					@@\
	$(CC) -g -c $(SHLIBDEF) $(CFLAGS) $(STRCONST) $*.c		@@\
	$(CP) $*.o debugger/$*.o					@@\
	$(CC) -c $(SHLIBDEF) $(CFLAGS) $(STRCONST) $*.c				@@\
									@@\
clean::									@@\
	$(RM) strings*                                                  @@\
	-@if [ -d shared ]; then echo "	$(RM) shared/?*.o"; \		@@\
		$(RM) shared/?*.o; else exit 0; fi			@@\
	-@if [ -d debugger ]; then echo "	$(RM) debugger/?*.o"; \ @@\
		$(RM) debugger/?*.o; else exit 0; fi			@@\

#endif /* SubdirSharedAndDebuggedLibraryObjectRule */

/*
 * SubdirSpecialSharedAndDebuggedObjectRule - generate rules to compile a file 
 * with special flags and to make shared and debuggable versions.
 * This rule does not use xstr so it may be used for data modules.
 */
#ifndef SubdirSpecialSharedAndDebuggedObjectRule
#define	SubdirSpecialSharedAndDebuggedObjectRule(objs,depends,options)	@@\
all::									@@\
	-@if [ ! -d shared ]; then mkdir shared; else exit 0; fi	@@\
	-@if [ ! -d debugger ]; then mkdir debugger; else exit 0; fi	@@\
									@@\
objs:	depends								@@\
	$(RM) $@ shared/$@ debugger/$@					@@\
	$(CC) $(PIC) -c $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) options $*.c @@\
	$(CP) $*.o shared/$*.o						@@\
	$(CC) -g -c $(SHLIBDEF) $(CFLAGS) options $*.c			@@\
	$(CP) $*.o debugger/$*.o					@@\
	$(CC) -c $(SHLIBDEF) $(CFLAGS) options $*.c

#endif /* SubdirSpecialDebuggedAndProfiledObjectRule */

/*
 * SubdirSpecialSharedObjectRule - generate rules to compile a file 
 * with special flags and to make shared versions.
 * This rule does not use xstr so it may be used for data modules.
 */
#ifndef SubdirSpecialSharedObjectRule
#define	SubdirSpecialSharedObjectRule(objs,depends,options)		@@\
all::									@@\
	-@if [ ! -d shared ]; then mkdir shared; else exit 0; fi	@@\
									@@\
objs:	depends								@@\
	$(RM) $@ shared/$@ 						@@\
	$(CC) $(PIC) -c $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) options $*.c @@\
	$(CP) $*.o shared/$*.o						@@\
	$(CC) -c $(SHLIBDEF) $(CFLAGS) options $*.c

#endif /* SubdirSpecialSharedObjectRule */

/*
 * AssemblerObjectRule - generate an object rule for assembler sources
 */
#ifndef AssemblerObjectRule
#define AssemblerObjectRule(objs,depends)				@@\
									@@\
objs:	depends								@@\
	$(AS) $(AFLAGS) $*.s -o $*.o 

#endif /* AssemblerObjectRule */

/*
 * InstallSharedLibraryDataNoBuild - rules to install the shared library data
 * Check if ranlib is needed
 */
#ifdef __linux__
#define	InstallSharedLibraryDataNoBuild(libname,rev,dest)
#else /* __linux__ */
#if DoRanlibCmd

#ifndef InstallSharedLibraryDataNoBuild
#define	InstallSharedLibraryDataNoBuild(libname,rev,dest)		@@\
install:: 								@@\
	-$(INSTALL) -c $(INSTSHAREDLIBFLAGS) lib/**/libname.sa.rev $(DESTDIR)dest @@\
	-$(RANLIB) $(RANLIBINSTFLAGS) $(DESTDIR)dest/lib/**/libname.sa.rev
	

#endif /* InstallSharedLibraryDataNoBuild */

#else /* DoRanlibCmd */

#ifndef InstallSharedLibraryDataNoBuild
#define	InstallSharedLibraryDataNoBuild(libname,rev,dest)		@@\
install:: 								@@\
	-$(INSTALL) -c $(INSTSHAREDLIBFLAGS) lib/**/libname.sa.rev $(DESTDIR)dest

#endif /* InstallSharedLibraryDataNoBuild */

#endif /* DoRanlibCmd */
#endif /* __linux__ */

/*
 * InstallSharedLibraryNoBuild - generate rules to install the shared library.
 */
#ifndef InstallSharedLibraryNoBuild
#ifdef __linux__
#define	InstallSharedLibraryNoBuild(libname,rev,dest)			@@\
install::  								@@\
	$(RM) $(DESTDIR)dest/lib/**/libname.so				@@\
	$(INSTALL) -c $(INSTSHAREDLIBFLAGS) lib/**/libname.so.rev $(DESTDIR)dest @@\
	(cd $(DESTDIR)dest && $(LN) lib/**/libname.so.rev lib/**/libname.so) @@\
	(PATH=$$PATH:/sbin:/usr/sbin && ldconfig -v -N -l $(DESTDIR)dest/lib/**/libname.so.rev)

#else /* __linux__ */
#define	InstallSharedLibraryNoBuild(libname,rev,dest)			@@\
install::  								@@\
	$(RM) $(DESTDIR)dest/lib/**/libname.so				@@\
	$(INSTALL) -c $(INSTSHAREDLIBFLAGS) lib/**/libname.so.rev $(DESTDIR)dest @@\
	(cd $(DESTDIR)dest && $(LN) lib/**/libname.so.rev lib/**/libname.so) @@\

#endif /* !__linux__ */
#endif /* InstallSharedLibraryNoBuild */

/*
 * SubdirLintLibraryTarget - rules to build a lint library when have subdirs;
 */
#ifndef SubdirLintLibraryTarget
#define SubdirLintLibraryTarget(libname,destdir,srcs)			@@\
lintlib::								@@\
	-@if [ ! -d destdir ]; then mkdir destdir; else exit 0; fi	@@\
	$(RM) ?*.ln;							@@\
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \			@@\
	for i in srcs ;\						@@\
	do \								@@\
		echo "linting $$i"; \					@@\
		$(LINT) $(LINTFLAGS) -i -c $$i; \ 			@@\
		if [ ! -f ?*.ln ]; then \				@@\
			echo "lint failed for $$i"; \			@@\
		else \							@@\
			$(MV) ?*.ln destdir; \				@@\
		fi \							@@\
	done
#endif /* SubdirLintLibraryTarget */


/*
 * SubdirLintLibraryBuild - rules to create a lint library with subdirs;
 * Note that the lint library is always forced to be newer than the library 
 * itself.
 */
#ifndef SubdirLintLibraryBuild
#define	SubdirLintLibraryBuild(libname,lintdir)				@@\
lintlib:: llib-l/**/libname.ln						@@\
									@@\
llib-l/**/libname.ln: 							@@\
	$(RM) $@							@@\
	$(LINT) $(LINTLIBFLAG)/**/libname $(LINTFLAGS) lintdir/?*.ln	@@\
									@@\
clean::									@@\
	$(RM) llib-l/**/libname.ln					@@\
	$(RM) lint/?*.ln						@@\
									@@\
install.ln:: lintlib
#endif /* LintLibraryBuild */

/*
 * PopulateSCCSTree - rule to populate build tree from an SCCS archive
 */
#ifndef PopulateSCCSTree
#define PopulateSCCSTree(type,srcs)					@@\
populate::								@@\
	@case '${MFLAGS}' in *[i]*) set +e;; esac; 			@@\
	-@if [ -type SCCS ]; then \					@@\
		for i in srcs ; do sccs get $$i ; done ; \		@@\
	elif [ -type SCCS- ]; then \					@@\
		$(MV) SCCS- SCCS ; \					@@\
		for i in srcs ; do sccs get $$i ; done ; \		@@\
		$(MV) SCCS SCCS- ; \					@@\
	else \								@@\
		echo "SCCS or SCCS- do not exist" ; \			@@\
	fi
#endif /* PopulateSCCSTree */

/*
 * PopulateSubdirs - generate rules to recursively populate a source tree.
 */
#ifndef PopulateSubdirs
#define PopulateSubdirs(dirs)						@@\
NamedTargetSubdirs(populate,dirs,"populating",/**/,populate)
#endif /* PopulateSubdirs */

/*
 * LinkToFile - rule to make a link to one file
 */
#ifndef LinkToFile
#define LinkToFile(step,filename,linkname,dir)				@@\
step:: filename								@@\
	@case '${MFLAGS}' in *[i]*) set +e;; esac; 			@@\
	-@linkdestdir=dir; \						@@\
	[ step = install ] && [ "x$(DESTDIR)" != x ] && linkdestdir=$(DESTDIR)/$$linkdestdir; \	@@\
	if [ ! -f $$linkdestdir/linkname ]; then \			@@\
		echo "linking $$linkdestdir/linkname to filename..."; \	@@\
		echo "  cd $$linkdestdir"; cd "$$linkdestdir"; $(RM) linkname ; \	@@\
		(set -x; $(LN) filename linkname); \			@@\
	else \								@@\
		echo "$$linkdestdir/linkname exists, no link made." ; \	@@\
	fi
#endif /* LinkToFile */

/*
 * StartNamedTarget - rule to enter a directory and start a target
 */
#ifndef StartNamedTarget
#define StartNamedTarget(step,dir,flags)				@@\
step:: 									@@\
	(cd dir ; $(MAKE) $(MFLAGS) flags step );
#endif /* StartNamedTarget */

/*
 * InstallSupportList - rule to install a list of support files
 */
#ifndef InstallSupportList
#define InstallSupportList(srcs,dest)					@@\
install::								@@\
	@case '${MFLAGS}' in *[i]*) set +e;; esac; 			@@\
	for i in srcs ;\						@@\
	do \								@@\
		echo "installing $$i"; \				@@\
		$(RM) $(DESTDIR)dest/$$i $(DESTDIR)dest/.$$i; \		@@\
		$(INSTALL) -c $(INSTDATFLAGS) $$i $(DESTDIR)dest ; \ 	@@\
		( cd $(DESTDIR)dest; $(MV) $$i .$$i; $(LN) .$$i $$i ); \ @@\
	done
#endif /* InstallSupportList */

/*
 * InstallNonExecList - rule to install a list of help files
 */
#ifndef InstallNonExecList
#define InstallNonExecList(srcs,dest)					@@\
install::								@@\
	@case '${MFLAGS}' in *[i]*) set +e;; esac; 			@@\
	for i in srcs ;\						@@\
	do \								@@\
		echo "installing $$i"; \				@@\
		$(RM) $(DESTDIR)dest/$$i ; \				@@\
		$(INSTALL) -c $(INSTDATFLAGS) $$i $(DESTDIR)dest ; \ 	@@\
	done
#endif /* InstallNonExecList */

/*
 * InstallExampleSrcs - rule to install example sources.
 */
#ifndef InstallExampleSrcs
#define InstallExampleSrcs(files,makefile,dest)				@@\
install.srcs::								@@\
	@case '${MFLAGS}' in *[i]*) set +e;; esac; 			@@\
	for i in files ;\						@@\
	do \								@@\
		echo "installing $$i"; \				@@\
		$(RM) $(DESTDIR)dest/$$i ; \				@@\
		$(INSTALL) -c $(INSTDATFLAGS) $$i $(DESTDIR)dest ; \ 	@@\
	done 								@@\
	$(RM) $(DESTDIR)dest/Makefile ;		 			@@\
	$(INSTALL) -c $(INSTDATFLAGS) makefile $(DESTDIR)dest/Makefile 
#endif /* InstallExampleSrcs */

/*
 * InstallExampleSrcsNoMakefile - rule to install example sources that
 * do not have Makefiles.
 */
#ifndef InstallExampleSrcsNoMakefile
#define InstallExampleSrcsNoMakefile(files,dest)			@@\
install.srcs::								@@\
	@case '${MFLAGS}' in *[i]*) set +e;; esac; 			@@\
	for i in files ;\						@@\
	do \								@@\
		echo "installing $$i"; \				@@\
		$(RM) $(DESTDIR)dest/$$i ; \				@@\
		$(INSTALL) -c $(INSTDATFLAGS) $$i $(DESTDIR)dest ; \ 	@@\
	done 
#endif /* InstallExampleSrcsNoMakefile */

/*
 * InstallSrcsSubdirs - generate rules to recursively install sources.
 */
#ifndef InstallSrcsSubdirs
#define InstallSrcsSubdirs(dirs)					@@\
NamedTargetSubdirs(install.srcs,dirs,"installing srcs",/**/,install.srcs)
#endif /* InstallSrcsSubdirs */