File: rules.def

package info (click to toggle)
vrweb 1.5-11
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 14,360 kB
  • ctags: 26,143
  • sloc: cpp: 133,581; ansic: 87,373; sh: 936; makefile: 444; perl: 347; csh: 26
file content (648 lines) | stat: -rw-r--r-- 17,383 bytes parent folder | download | duplicates (6)
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
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
/*
$Id: rules.def,v 1.4 1996/10/18 07:42:52 bheide Exp $

$Log: rules.def,v $
Revision 1.4  1996/10/18 07:42:52  bheide
added UseGcc macro

Revision 1.3  1996/10/17 14:01:51  hleitner
Removed: all the *SunOSShared* stuff (no more needed with our new
shared library support).

Added: shared library support; new imake rules and defines are:

AllSharedTarget, DependSharedTarget, MakeSharedObjectFromSrcFlags,
MakeSharedObjectFromSrc, InstallLibrary, InstallSharedProgram.

Revision 1.2  1996/09/26 05:29:13  jfasch
MakeObjectRule bug (dst..c)

Revision 1.1  1995/11/13 10:54:24  hleitner
Initial revision

*/

XCOMM -----------------------------------------------------------------------
XCOMM rules.def


/*
 * The following macros are defined for the various templates and Imakefiles
 * 
 * MakeCPU                      ()
 * MakeNormalWorld              (flags)
 * MakeSpecialWorld             (special,flags)
 * MakeWorld                    (flags)
 * MakefileTarget               ()
 * MakefilesSubdirs             (dirs)
 * MakefileObjectCodeDir        (dir) 
 * IntoSubdirs                  (name,dirs,verb)
 * DependSubdirs                (dirs)
 * MakeSubdirs                  (dirs)
 * InstallSubdirs               (dirs)
 * CleanSubdirs                 (dirs)
 * FormatSubdirs                (dirs)
 * PrintSubdirs                 (dirs)
 * SpecialTargets               (special,imakeflags)
 * MakeInSubdirs                (dirs)
 * MakeInObjectCodeDir          ()
 * AllTarget                    (deps)
 * DependTarget                 ()
 * CleanTarget                  ()
 * Use_libInterViews            () 
 * MakeObjectRule               (dst,src,flags)
 * MakeObjectFromSrcFlags       (file,flags)
 * MakeObjectFromSrc            (file)	
 * RanLibrary                   (args)
 * NormalSharedLibraryTarget    (libname,rev,depobjs,ldobjs)
 * NormalNonSharedLibraryTarget (libname,depobjs,ldobjs)
 * NormalLibraryTarget          (libname,rev,depobjs,ldobjs)
 * MakeLibrary                  (name,rev)
 * RemoveIfUnwritable           (program)
 * BuildProgram                 (program,depobjs,ldobjs,deplibs,ldlibs)
 * ComplexProgramTarget         (program)
 * SimpleProgramTarget          (program)
 * TroffSources                 (formatted)
 * CppScriptTarget              (dst,src,defs,deplist)
 * MakeDirectories              (step,dirs)
 * MakeDir                      (dir)
 * InstallProgramWithFlags      (program,destdir,destname,flags)
 * InstallProgram               (program,destdir,destname)
 * InstallScript                (script,dest)
 * InstallMultipleFlags         (list,dest,flags)
 * InstallMultiple              (list,dest)
 *
 */



/*
 * Print the name you should assign to CPU.
 */
#ifndef MakeCPU
#define MakeCPU()							@@\
CPU:									@@\
	@$(SHELL) $(SCRIPTSRC)/cpu.sh $(CONFIGSRC)/InterViews/arch.def
#endif

/*
 * Make everything in the normal object code subdirectories.
 */
#ifndef MakeNormalWorld
#define MakeNormalWorld(flags)						@@\
World::									@@\
	@echo ""							@@\
	@echo "Building InterViews 3.0 on `date`"			@@\
	@echo ""							@@\
	$(MAKE) Makefile XCONFIGDIR=$(XCONFIGDIR)			@@\
	@echo ""							@@\
	$(MAKE) Makefiles						@@\
	@echo ""							@@\
	$(MAKE) depend							@@\
	@echo ""							@@\
	$(MAKE) flags all						@@\
	@echo ""							@@\
	@echo "InterViews build completed on `date`"			@@\
	@echo ""
#endif

/*
 * Make everything in special object code subdirectories.
 */
#ifndef MakeSpecialWorld
#define MakeSpecialWorld(special,flags)					@@\
Concat(World,special)::							@@\
	@echo ""							@@\
	@echo "Building InterViews 3.0 on `date`"			@@\
	@echo ""							@@\
	$(MAKE) Makefile XCONFIGDIR=$(XCONFIGDIR)			@@\
	@echo ""							@@\
	$(MAKE) Concat(Makefiles,special)				@@\
	@echo ""							@@\
	$(MAKE) Concat(depend,special)					@@\
	@echo ""							@@\
	$(MAKE) flags Concat(all,special)				@@\
	@echo ""							@@\
	@echo "InterViews build completed on `date`"			@@\
	@echo ""
#endif

#ifndef MakeWorld
#define MakeWorld(flags)						@@\
MakeNormalWorld(flags)							@@\
MakeSpecialWorld(.debug,flags)
#endif

/*
 * Make the Makefile in the current directory.
 */
#ifndef MakefileTarget
#define MakefileTarget()						@@\
Makefile::								@@\
	-@if [ -f Makefile ]; then \					@@\
		$(RM) Makefile.bak; \					@@\
		$(MV) Makefile Makefile.bak; \				@@\
	else exit 0; fi							@@\
	$(IMAKE) $(IMAKEFLAGS) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
#endif

/*
 * Make the Makefiles in the list of subdirectories.
 */
#ifndef MakefilesSubdirs
#define MakefilesSubdirs(dirs)						@@\
Makefiles::								@@\
	-@for i in dirs; \						@@\
	do \								@@\
		if [ -d $$i ]; then ( \					@@\
			echo "Making Makefiles" \			@@\
			"for $(ARCH) in $(CURRENT_DIR)/$$i"; \		@@\
			if [ -f $$i/Makefile ]; then \			@@\
				$(RM) $$i/Makefile.bak; \		@@\
				$(MV) $$i/Makefile $$i/Makefile.bak; \	@@\
			fi; \						@@\
			$(IMAKE) $(IMAKEFLAGS) \			@@\
			-DTOPDIR=../$(TOP) -DCURDIR=$(CURRENT_DIR)/$$i \@@\
			-f $$i/Imakefile -s $$i/Makefile; \		@@\
			cd $$i; \					@@\
			$(MAKE) $(PASSARCH) Makefiles; \		@@\
		) else continue; fi; \					@@\
	done
#endif

/*
 * Make the Makefile in the appropriate object code subdirectory.
 */
#ifndef MakefileObjectCodeDir
#define MakefileObjectCodeDir(dir)					@@\
Makefiles::								@@\
	@echo "Making Makefiles" \					@@\
	"for $(ARCH) in $(CURRENT_DIR)/dir"				@@\
	-@if [ ! -d dir ]; then \					@@\
		mkdir dir; \						@@\
		chmod g+w dir; \					@@\
	fi; \								@@\
	if [ -f dir/Makefile ]; then \					@@\
		$(RM) dir/Makefile.bak; \				@@\
		$(MV) dir/Makefile dir/Makefile.bak; \			@@\
	fi; \								@@\
	$(IMAKE) $(IMAKEFLAGS) \					@@\
	-DTOPDIR=../$(TOP) -DCURDIR=$(CURRENT_DIR)/dir \		@@\
	-DInObjectCodeDir -s dir/Makefile
#endif

/*
 * Make the given target in the list of subdirectories.
 */
#ifndef IntoSubdirs
#define IntoSubdirs(name,dirs,verb)					@@\
name::									@@\
	-@for i in dirs; \						@@\
	do \								@@\
		if [ -d $$i ]; then ( \					@@\
			echo verb \					@@\
			"for $(ARCH) in $(CURRENT_DIR)/$$i"; \		@@\
			cd $$i; \					@@\
			$(MAKE) $(PASSARCH) name; \			@@\
		) else continue; fi; \					@@\
	done
#endif

#ifndef DependSubdirs
#define DependSubdirs(dirs)						@@\
IntoSubdirs(depend,dirs,"depending")
#endif

#ifndef MakeSubdirs
#define MakeSubdirs(dirs)						@@\
IntoSubdirs(all,dirs,"making all")
#endif

#ifndef InstallSubdirs
#define InstallSubdirs(dirs)						@@\
IntoSubdirs(install,dirs,"installing")
#endif

#ifndef CleanSubdirs
#define CleanSubdirs(dirs)						@@\
IntoSubdirs(clean,dirs,"cleaning")
#endif

#ifndef FormatSubdirs
#define FormatSubdirs(dirs)						@@\
IntoSubdirs(format,dirs,"formatting")
#endif

#ifndef PrintSubdirs
#define PrintSubdirs(dirs)						@@\
IntoSubdirs(print,dirs,"printing")
#endif

/*
 * Make the above targets in specialized versions of the appropriate
 * object code subdirectories.
 */
#ifndef SpecialTargets
#define SpecialTargets(special,imakeflags)				@@\
Makefiles.special:							@@\
	@$(MAKE) ARCH="$(ARCH).special" \				@@\
	SPECIAL_IMAKEFLAGS="$(SPECIAL_IMAKEFLAGS) imakeflags" \		@@\
	Makefiles							@@\
depend.special:								@@\
	@$(MAKE) ARCH="$(ARCH).special" \				@@\
	SPECIAL_IMAKEFLAGS="$(SPECIAL_IMAKEFLAGS) imakeflags" \		@@\
	depend								@@\
all.special:								@@\
	@$(MAKE) ARCH="$(ARCH).special" \				@@\
	SPECIAL_IMAKEFLAGS="$(SPECIAL_IMAKEFLAGS) imakeflags" \		@@\
	all								@@\
install.special:							@@\
	@$(MAKE) ARCH="$(ARCH).special" \				@@\
	SPECIAL_IMAKEFLAGS="$(SPECIAL_IMAKEFLAGS) imakeflags" \		@@\
	install								@@\
clean.special:								@@\
	@$(MAKE) ARCH="$(ARCH).special" \				@@\
	SPECIAL_IMAKEFLAGS="$(SPECIAL_IMAKEFLAGS) imakeflags" \		@@\
	clean
#endif

/*
 * Shorthand for making all targets in a list of subdirectories.
 */
#ifndef MakeInSubdirs
#define MakeInSubdirs(dirs)						@@\
MakefilesSubdirs(dirs)							@@\
DependSubdirs(dirs)							@@\
MakeSubdirs(dirs)							@@\
InstallSubdirs(dirs)							@@\
CleanSubdirs(dirs)							@@\
SpecialTargets(debug,-DUseDebug)
#endif

/*
 * Shorthand for making all targets in the appropriate object code
 * subdirectory.
 */
#ifndef MakeInObjectCodeDir
#define MakeInObjectCodeDir()						@@\
MakefileObjectCodeDir($(ARCH))						@@\
DependSubdirs($(ARCH))							@@\
MakeSubdirs($(ARCH))							@@\
InstallSubdirs($(ARCH))							@@\
CleanSubdirs($(ARCH))							@@\
SpecialTargets(debug,-DUseDebug)
#endif

/*
 * Make the given dependencies during make all.
 */
#ifndef AllTarget
#define AllTarget(deps)							@@\
all:: deps
#endif

#ifndef AllSharedTarget
#ifndef HaveShared 
#define AllSharedTarget(deps)
#else
#define AllSharedTarget(deps)							@@\
all:: deps
#endif
#endif

/*
 * Add automatically generated dependencies to the Makefile.
 */
#ifndef DependTarget
#define DependTarget()							@@\
DEPDEP1 = $(wildcard $(SRC)/RCS$(SLASH)*.$(CCSUFFIX),v $(SRC)/RCS$(SLASH)*.h,v)	@@\
DEPDEP2 = $(DEPDEP1:,v=)						@@\
DEPDEP = $(subst $(SLASH)RCS$(SLASH),$(SLASH),$(DEPDEP2))		@@\
depend:: $(DEPDEP)							@@\
	$(DEPEND) -s "# DO NOT DELETE" -- $(DEPEND_CCFLAGS) -- $(SRCS)
#endif

/*
 * Add automatically generated dependencies to the Makefile (shared).
 */
#ifndef DependSharedTarget
#define DependSharedTarget()							@@\
DEPDEP1 = $(wildcard $(SRC)/RCS$(SLASH)*.$(CCSUFFIX),v $(SRC)/RCS$(SLASH)*.h,v)	@@\
DEPDEP2 = $(DEPDEP1:,v=)						@@\
DEPDEP = $(subst $(SLASH)RCS$(SLASH),$(SLASH),$(DEPDEP2))		@@\
depend:: $(DEPDEP)							@@\
	$(DEPEND) -s "# DO NOT DELETE (SHARED)" -- -SHARED $(DEPEND_CCFLAGS) -- $(SRCS)
#endif

/*
 * Remove garbage files.  The #* cannot go in the definition of RM_CMD
 * because System V will treat the pound sign as a comment.
 */
#ifndef CleanTarget
#define CleanTarget()							@@\
clean::									@@\
	@$(RM_CMD) "#"*
#endif

/*
 * Set up $(CCDEPLIBS) and $(CCLDLIBS) for a program using libIV.
 */
#ifndef Use_libInterViews
#define Use_libInterViews() 						@@\
         DEPLIBIV = Dep_libIV						@@\
       DEPLIBXEXT = Dep_libXext						@@\
        DEPLIBX11 = Dep_libX11						@@\
          DEPLIBM = Dep_libm						@@\
									@@\
       LIBDIRPATH = LibDirPath						@@\
          LDLIBIV = Ld_libIV						@@\
      XLIBDIRPATH = XLibDirPath						@@\
        LDLIBXEXT = Ld_libXext						@@\
         LDLIBX11 = Ld_libX11						@@\
           LDLIBM = Ld_libm						@@\
    ABSLIBDIRPATH = AbsLibDirPath
#endif

#ifndef UseGcc
#define UseGcc()                                                        @@\
         CCDRIVER = cc                                                  @@\
         CCSUFFIX = c
#endif

/*
 * Make an object file.  $(AOUT) is either a.out or a library and the
 * dependency allows Imakefiles to avoid having to define OBJS.
 */
#ifndef MakeObjectRule
#define MakeObjectRule(dst,src,flags)					@@\
$(AOUT): dst.o								@@\
dst.o: src.$(CCSUFFIX)							@@\
	@$(RM) dst.o dst..c						@@\
	$(CCDRIVER) $(CCFLAGS) flags -c src.$(CCSUFFIX)
#endif

/*
 * Shorthands for making an object file.
 */
#ifndef MakeObjectFromSrcFlags
#define MakeObjectFromSrcFlags(file,flags)				@@\
MakeObjectRule(file,$(SRC)/file,flags)
#endif

#ifndef MakeObjectFromSrc
#define MakeObjectFromSrc(file)						@@\
MakeObjectFromSrcFlags(file,NullParameter)
#endif

/*
 * Shorthands for making a shared object file.
 */
#ifndef MakeSharedObjectFromSrcFlags
#ifndef HaveShared
#define MakeSharedObjectFromSrcFlags(file,flags)
#else
#define MakeSharedObjectFromSrcFlags(file,flags)				@@\
MakeSharedObjectRule(file,$(SRC)/file,flags)
#endif
#endif

#ifndef MakeSharedObjectFromSrc
#define MakeSharedObjectFromSrc(file)						@@\
MakeSharedObjectFromSrcFlags(file,NullParameter)
#endif

/*
 * Convert an archive to a random library.
 */
#ifndef RanLibrary
#if HasRanlibCmd
#define RanLibrary(args) $(RANLIB) args
#else
#define RanLibrary(args) /**/
#endif
#endif

/*
 * Make a shared library.
 */
#ifndef NormalSharedLibraryTarget
#define NormalSharedLibraryTarget(libname,rev,depobjs,ldobjs)	@@\
AOUT = Concat(lib,libname.so.rev)					@@\
SHARED_CCFLAGS = SharedCCFlags						@@\
									@@\
AllTarget(Concat(lib,libname.so.rev))					@@\
									@@\
Concat(lib,libname.so.rev): depobjs					@@\
	@echo "building $@"						@@\
	$(RM) $@~							@@\
	$(LD) -o $@~ -assert pure-text ldobjs				@@\
	$(RM) $@							@@\
	$(MV) $@~ $@							@@\
									@@\
clean::									@@\
	$(RM) Concat(lib,libname.so.rev)
#endif

/*
 * Make a non-shared library archive.
 */
#ifndef NormalNonSharedLibraryTarget
#define NormalNonSharedLibraryTarget(libname,depobjs,ldobjs)		@@\
AOUT = Concat(lib,libname.a)						@@\
									@@\
AllTarget(Concat(lib,libname.a))					@@\
									@@\
Concat(lib,libname.a): depobjs						@@\
	@echo "building $@"						@@\
	$(RM) $@							@@\
	$(AR) $@ ldobjs							@@\
	RanLibrary($@)
#endif

/*
 * Make either a shared library or a non-shared library.
 */
#ifndef NormalLibraryTarget
#define NormalLibraryTarget(libname,rev,depobjs,ldobjs)			@@\
NormalNonSharedLibraryTarget(libname,depobjs,ldobjs)
#endif

/*
 * Shorthand for building and installing a library.
 */
#ifndef MakeLibrary
#define MakeLibrary(name,rev)						@@\
NormalLibraryTarget(name,rev,NullParameter,$(OBJS))			@@\
InstallLibrary(name,rev,$(LIBDIR))					@@\
DependTarget()
#endif


#ifndef InstallLibrary
#define InstallLibrary(libname,rev,dest)				@@\
InstallNonSharedLibrary(libname,dest)
#endif

/*
 * Removing an executable before relinking it wastes time if the user's using
 * an incremental linker smart enough to write only the modified sections.
 */
#ifndef RemoveIfUnwritable
#define RemoveIfUnwritable(program) \
-@if [ ! -w program ]; then $(RM) program; else exit 0; fi
#endif

/*
 * Build a program.
 */
#ifndef BuildProgram
#define BuildProgram(program,depobjs,ldobjs,deplibs,ldlibs)		@@\
program: depobjs deplibs						@@\
	RemoveIfUnwritable($@)						@@\
	$(CCDRIVER) $(CCLDFLAGS) -o $@ ldobjs ldlibs
#endif

/*
 * Shorthand for building and installing a complex program.
 */
#ifndef ComplexProgramTarget
#define ComplexProgramTarget(program)					@@\
PROGRAM	= program							@@\
									@@\
AllTarget($(AOUT))							@@\
BuildProgram($(AOUT),NullParameter,$(OBJS),$(CCDEPLIBS),$(CCLDLIBS))	@@\
InstallProgram($(AOUT),$(BINDIR),$(PROGRAM))				@@\
DependTarget()
#endif

/*
 * Shorthand for building and installing a simple program.
 */
#ifndef SimpleProgramTarget
#define SimpleProgramTarget(program)					@@\
SRCS	= $(SRC)/program.$(CCSUFFIX)					@@\
OBJS	= program.o							@@\
									@@\
ComplexProgramTarget(program)						@@\
MakeObjectFromSrc(program)
#endif

/*
 * Format or print troff sources.
 */
#ifndef TroffSources
#define TroffSources(formatted)						@@\
print:									@@\
	$(TROFF) $(TROFFFLAGS) $(TROFFSRCS)				@@\
									@@\
format: formatted							@@\
									@@\
formatted: $(TROFFSRCS)							@@\
	$(RM) formatted							@@\
	$(TROFF) -t $(TROFFFLAGS) $(TROFFSRCS) > formatted		@@\
									@@\
clean::									@@\
	$(RM) formatted
#endif

/*
 * Generate a script using cpp.
 */
#ifndef CppScriptTarget
#if ExecableScripts		/* can use #! instead of colon */
#define CppScriptTarget(dst,src,defs,deplist)				@@\
dst::  src deplist							@@\
	$(RM) $@							@@\
	$(CPP) defs <src | \						@@\
		sed -e '/^#  *[0-9][0-9]*  *.*$$/d' >$@			@@\
	chmod a+x $@
#else
#define CppScriptTarget(dst,src,defs,deplist)				@@\
dst::  src deplist							@@\
	$(RM) $@							@@\
	echo \: >$@							@@\
	sed '1d' src | $(CPP) defs  | \					@@\
		sed -e '/^#  *[0-9][0-9]*  *.*$$/d' >>$@		@@\
	chmod a+x $@
#endif
#endif

/*
 * Create directories if necessary at a step in the build (now
 * superseded by MakeDir in each of the individual install rules).
 */
#ifndef MakeDirectories
#define MakeDirectories(step,dirs)					@@\
step::									@@\
	$(MKDIRHIER) dirs
#endif

/*
 * Create a directory if necessary.
 */
#ifndef MakeDir
#define MakeDir(dir) -@if [ -d dir ]; then exit 0; \			@@\
		else (set -x; $(MKDIRHIER) dir); fi
#endif


/*
 * Install a program with renaming of the installed program.
 */
#ifndef InstallProgramWithFlags
#if RemoveAfterInstall
#define InstallProgramWithFlags(program,destdir,destname,flags)		@@\
install:: program							@@\
	MakeDir(destdir)						@@\
	$(INSTALL) -c $(INSTPGMFLAGS) flags program destdir/destname	@@\
	$(RM) program
#else
#define InstallProgramWithFlags(program,destdir,destname,flags)		@@\
install:: program							@@\
	MakeDir(destdir)						@@\
	$(INSTALL) -c $(INSTPGMFLAGS) flags program destdir/destname
#endif
#endif

#ifndef InstallProgram
#define InstallProgram(program,destdir,destname)			@@\
InstallProgramWithFlags(program,destdir,destname,$(INSTBINFLAGS))
#endif

#ifndef InstallSharedProgram
#ifndef HaveShared 
#define InstallSharedProgram(program,destdir,destname)
#else
#define InstallSharedProgram(program,destdir,destname)			@@\
InstallProgramWithFlags(program,destdir,destname,$(INSTBINFLAGS))
#endif
#endif

/*
 * Install a script (which cannot be stripped like a program).
 */
#ifndef InstallScript
#define InstallScript(script,dest)					@@\
install:: script							@@\
	MakeDir(dest)							@@\
	$(INSTALL) -c $(INSTBINFLAGS) script dest
#endif

/*
 * Install multiple files.
 */
#ifndef InstallMultipleFlags
#define InstallMultipleFlags(list,dest,flags)				@@\
install:: list								@@\
	MakeDir(dest)							@@\
	@for i in list; do \						@@\
		(set -x; $(INSTALL) -c flags $$i dest); \		@@\
	done
#endif

#ifndef InstallMultiple
#define InstallMultiple(list,dest)					@@\
InstallMultipleFlags(list,dest,$(INSTALLFLAGS))
#endif