DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ I T

⟦d0f6b4d18⟧ TextFile

    Length: 25161 (0x6249)
    Types: TextFile
    Names: »Imake.rules-ada«

Derivation

└─⟦85b835f43⟧ Bits:30000549 8mm tape, Rational 1000, Xlib rev 6.00
    └─ ⟦0c20f784e⟧ »DATA« 
        └─⟦1abbe589f⟧ 
            └─⟦dfeb830e8⟧ 
                └─ ⟦this⟧ »rev6-0-0/tools/config/Imake.rules-ada« 

TextFile

/**/###########################################################################
/**/# Imake rules for building ADA libraries, programs, scripts, and data files
/**/# rules:  $Rational: Imake.ada-rules,v 1.0 90/05/17 GEB $

/*
 *		   MACHINE-INDEPENDENT RULES; DO NOT MODIFY
 *
 * Warning, when defining rules: make sure you don't include both a trailing
 * backslash and double ampersand backslash or else you will get an extra
 * backslash in the Makefile.
 * 
 * These macros are defined for the various templates and Imakefiles (for a 
 * list of the applicable make variables, see the template files):
 * 
 * The general linking for building programs is:
 * 
 *      program-objects programlibs syslibs EXTRA_LIBRARIES systemlibs \
 *              EXTRA_LOAD_FLAGS
 *
 * where programlibs is LOCAL_LIBRARIES for ComplexProgramTarget
 * and EXTRA comes with syslibs from the LDLIBS
 */


/*
 * AdaParameterize - generate rules to locate all unparameterized Ada source
 * files and to parameterize them.
 */
#ifndef AdaParameterize
#define AdaParameterize()						@@\
AdaParamDependency(param)						@@\
									@@\
param::									@@\
	find . \( -name '*.FNS' -o -name '*.FNB' -o -name '*.PRS' -o \	@@\
		  -name '*.PRB' -o -name '*.PKS' -o -name '*.PKB' -o \	@@\
		  -name '*.FNG' -o -name '*.PRG' -o -name '*.PKG' \) \	@@\
		-exec $(ADAPARAM) -x \{} -p '$(ADAPARAMOPTIONS)' \;	@@\
									@@\
reparam::								@@\
	for i in $(ADASRCS) ; \						@@\
	do \								@@\
		$(ADAPARAM) $$i -p '$(ADAPARAMOPTIONS)' ; \		@@\
	done								@@\
									@@\
normalize::								@@\
	for i in $(ADASRCS) ; \						@@\
	do \								@@\
		$(ADAPARAM) -n $$i -p '$(ADAPARAMOPTIONS)' ; \		@@\
	done

#endif /* AdaParameterize */	

/*
 * AdaParamDependency - generate rules to compile ada-param if this Imakefile
 * is within the Ada source tree.
 */
#ifndef AdaParamDependency
#ifdef UseInstalled
#define AdaParamDependency(target) /**/
#else
#define AdaParamDependency(target)					@@\
target:: $(ADAPARAM)							@@\
									@@\
$(ADAPARAM):								@@\
	@cd $(ADAPARAMSRC); \						@@\
	echo "checking $@ in $(ADAPARAMSRC) first..."; $(MAKE) all 	@@\
	@echo "okay, continuing in $(CURRENT_DIR)"

#endif /* UseInstalled */
#endif /* AdaParamDependency */


/*
 * AdaWorkingLibrary - generate rules to create the $(ADAWORKING) files and
 * directories.
 * (The use of "awk" in the .sub target below is because the TeleSoft acr
 *  program doesn't know enough to return an error code when it gets/gives
 *  a fatal error.  If it produces *any* output then it barfed and died.)
 */
#ifndef AdaWorkingLibrary
#define AdaWorkingLibrary(stem)						@@\
stem.obj:								@@\
	$(RM) -r stem.obj stem.sub 					@@\
	$(ADACRLIB) $(ADACRFLAGS) stem | \				@@\
		awk  '/./ { print ; exit 1; }				@@\
									@@\
stem.sub: 								@@\
	@echo "Library stem created."					@@\
									@@\
stem.obk:								@@\
	mkdir stem.obk							@@\
									@@\
clean::									@@\
	$(RM) -r stem.sub stem.obj stem.obk

#endif /* AdaWorkingLibrary */

/*
 * AdaWorkingLibraryFile - generate rules to create the $(ADAWORKING) file.
 */
#ifndef AdaWorkingLibraryFile
#define AdaWorkingLibraryFile(name,parts)				@@\
name:									@@\
	$(CP) /dev/null name						@@\
	for i in parts ; \						@@\
	do \								@@\
		echo Name\: $$i >> name ; \				@@\
	done								@@\
									@@\
clean::									@@\
	$(RM) name

#endif /* AdaWorkingLibraryFile */

/*
*/
#ifndef AdaLoadProgram

#define AdaLoadProgram(program,adaunit,sources,localdeps,locallibs,syslibs) @@\
program: Makefile.dep							@@\
program: $(ADALIBDEPS) $(ADAWORKINGNAMES) sources localdeps		@@\
	$(RM) program							@@\
	$(MAKE) $(MFLAGS) -f Makefile.dep program \			@@\
		COMMAND='$(ADACOM) $(ADACOMFLAGS)' RM='$(RM)'		@@\
	touch program							@@\
									@@\
load.program: $(ADALIBDEPS) $(ADAWORKINGNAMES) sources localdeps	@@\
	$(ADALD) -o program $(ADALDFLAGS) \				@@\
	  -p "locallibs $(LDLIBS) syslibs $(EXTRA_LOAD_FLAGS)" adaunit	@@\
									@@\
clean::									@@\
	$(RM) program

#endif /* AdaLoadProgram */

/*
 * AdaNormalProgramTarget - generate rules to compile and link the indicated 
 * program; since it does not use any default object files, it may be used for
 * multiple programs in the same Imakefile.
 */
#ifndef AdaNormalProgramTarget

#define	AdaNormalProgramTarget(program,adaunit,sources,localdeps,locallibs,syslibs)@@\
AllTarget(program)							@@\
AdaLoadProgram(program,adaunit,sources,localdeps,locallibs,syslibs)	@@\
AdaDependObk(program,sources,$(ADAWORKINGSTEM))

#endif /* AdaNormalProgramTarget */


/*
 * AdaNormalTestingTarget - generate rules to compile and link the indicated 
 * program; since it does not use any default object files, it may be used for
 * multiple programs in the same Imakefile.
 */
#ifndef AdaNormalTestingTarget

#define	AdaNormalTestingTarget(program,adaunit,sources,localdeps,locallibs,syslibs)@@\
AdaLoadProgram(program,adaunit,sources,localdeps,locallibs,syslibs)	@@\
AdaSimpleDependObk(program,sources,$(ADAWORKINGSTEM))

#endif /* AdaNormalTestingTarget */


/*
 * SimpleProgramTarget - generate rules for compiling and linking programs
 * that only have one C source file.  It should only be used in Imakefiles 
 * that describe a single program.
 */
#ifndef AdaSimpleProgramTarget
#define	AdaSimpleProgramTarget(program,adaunit,source)			@@\
           ADASRCS = source						@@\
									@@\
AdaComplexProgramTarget(program,adaunit)

#endif /* AdaSimpleProgramTarget */


/*
 * AdaComplexLibraryTarget - generate rules for compiling the library units
 * specified by $(ADASRCS) and installing the library.  It should only be used
 * in Imakefiles that describe a single library.
 */
#ifndef AdaComplexLibraryTarget
#define	AdaComplexLibraryTarget(library)				@@\
									@@\
AllTarget(library)							@@\
									@@\
load.library:								@@\
library: Makefile.dep 							@@\
library: $(ADALIBDEPS) $(ADASRCS)					@@\
	$(MAKE) $(MFLAGS) -f Makefile.dep library \			@@\
		COMMAND='$(ADACOM) $(ADACOMFLAGS)' RM='$(RM)'		@@\
									@@\
AdaInstallLibrary($(ADAWORKINGSTEM),$(ADALIBDIR))			@@\
									@@\
AdaDependObk(library,$(ADASRCS),$(ADAWORKINGSTEM))			@@\
AdaDependTarget($(ADAWORKINGSTEM))
#endif /* AdaComplexLibraryTarget */


/*
 * AdaComplexTestingLibrary - generate rules for compiling the library units
 * specified by $(ADASRCS). The library is never installed because it exists
 * solely for debugging/testing purposes.  It should only be used
 * in Imakefiles that describe a single library.
 */
#ifndef AdaComplexTestingLibrary
#define	AdaComplexTestingLibrary(library)				@@\
									@@\
AllTarget(library)							@@\
									@@\
load.library:								@@\
library: Makefile.dep 							@@\
library: $(ADALIBDEPS) $(ADASRCS)					@@\
	$(MAKE) $(MFLAGS) -f Makefile.dep library \			@@\
		COMMAND='$(ADACOM) $(ADACOMFLAGS)' RM='$(RM)'		@@\
									@@\
AdaDependObk(library,$(ADASRCS),$(ADAWORKINGSTEM))			@@\
AdaDependTarget($(ADAWORKINGSTEM))

#endif /* AdaComplexTestingLibrary */


/*
 * AdaComplexLibraryTargetPart0 - generate rules for compiling the library
 * units specified by all $(ADASRCnnS) and installing the library.  It should
 * only be used in Imakefiles that describe a single library that is too big
 * to fit into a single Ada librarian library.
 *
 * This is the guy that is the "main" target of the full library build.
 */
#ifndef AdaComplexLibraryTargetPart0
#define	AdaComplexLibraryTargetPart0(library,parts)			@@\
									@@\
       ADASRCS = $(ADASRC1) $(ADASRC2) $(ADASRC3)			@@\
    ADALIBDEPS = $(ADAWORKING) \					@@\
		 $(ADAWORKING1) $(ADAWORKING2) $(ADAWORKING3) \		@@\
                 $(ADAWORKINGLIB1) $(ADAWORKINGLIB2) $(ADAWORKINGLIB3) \@@\
                 $(ADAEXTERNALLIB)					@@\
									@@\
AllTarget(library)							@@\
									@@\
library: parts								@@\
									@@\
AdaDependTarget($(ADAWORKINGSTEM1))

#endif /* AdaComplexLibraryTargetPart0 */


/*
 * AdaComplexLibraryTargetPart1 - generate rules for compiling the library
 * units specified by $(ADASRC1) and installing the library.  It should only
 * be used in Imakefiles that describe a single library.
 *
 * This is the "innermost" or the first-to-build part of the full build.
 */
#ifndef AdaComplexLibraryTargetPart1
#define	AdaComplexLibraryTargetPart1(part1,libfile)			@@\
									@@\
    ADALIBDEPS1 = $(ADAWORKING1) $(ADAWORKINGLIB1) $(ADAEXTERNALLIB)	@@\
    ADAWORKINGSTEM = $(ADAWORKINGSTEM1)					@@\
									@@\
AllTarget(part1)							@@\
									@@\
load.part1:								@@\
part1: Makefile.dep 							@@\
part1: $(ADALIBDEPS1) $(ADASRC1)					@@\
	$(MAKE) $(MFLAGS) -f Makefile.dep part1 \			@@\
		COMMAND='$(ADACOM) $(ADACOMFLAGS1)' RM='$(RM)'		@@\
									@@\
AdaInstallLibrary($(ADAWORKINGSTEM1),$(ADALIBDIR))			@@\
AdaDependObk(part1,$(ADASRC1),$(ADAWORKINGSTEM1))			@@\
AdaWorkingLibraryFile(libfile,$(ADAWORKINGNAMES1))

#endif /* AdaComplexLibraryTargetPart1 */


/*
 * AdaComplexLibraryTargetPart2 - generate rules for compiling the library
 * units specified by $(ADASRC1) and installing the library.  It should only
 * be used in Imakefiles that describe a single library.
 *
 * This is the 2nd from the "innermost" or first-to-build part of the full
 * library build.
 */
#ifndef AdaComplexLibraryTargetPart2
#define	AdaComplexLibraryTargetPart2(part2,libfile,part1)		@@\
									@@\
    ADALIBDEPS2 = $(ADAWORKING1) $(ADAWORKING2) \			@@\
                  $(ADAWORKINGLIB1) $(ADAWORKINGLIB2) $(ADAEXTERNALLIB)	@@\
    ADAWORKINGSTEM = $(ADAWORKINGSTEM2)					@@\
									@@\
AllTarget(part2)							@@\
									@@\
load.part2:								@@\
part2: part1 Makefile.dep 						@@\
part2: $(ADALIBDEPS2) $(ADASRC2)					@@\
	$(MAKE) $(MFLAGS) -f Makefile.dep part2 \			@@\
		COMMAND='$(ADACOM) $(ADACOMFLAGS2)' RM='$(RM)'		@@\
									@@\
AdaInstallLibrary($(ADAWORKINGSTEM2),$(ADALIBDIR))			@@\
AdaDependObk(part2,$(ADASRC2),$(ADAWORKINGSTEM2))			@@\
AdaWorkingLibraryFile(libfile,$(ADAWORKINGNAMES2))			@@\
AdaWorkingLibrary($(ADAWORKINGSTEM1))

#endif /* AdaComplexLibraryTargetPart2 */


/*
 * AdaComplexLibraryTargetPart3 - generate rules for compiling the library
 * units specified by $(ADASRC3) and installing the library.  It should only
 * be used in Imakefiles that describe a single library.
 *
 * This is the 3rd from the "innermost" or first-to-build part of the full
 * library build.
 */
#ifndef AdaComplexLibraryTargetPart3
#define	AdaComplexLibraryTargetPart3(part3,libfile,part2)		@@\
									@@\
    ADALIBDEPS3 = $(ADAWORKING1) $(ADAWORKING2) $(ADAWORKING3) \	@@\
                  $(ADAWORKINGLIB1) $(ADAWORKINGLIB2) $(ADAWORKINGLIB3)\@@\
                  $(ADAEXTERNALLIB)					@@\
    ADAWORKINGSTEM = $(ADAWORKINGSTEM3)					@@\
									@@\
AllTarget(part3)							@@\
									@@\
load.part3:								@@\
part3: part2 Makefile.dep 						@@\
part3: $(ADALIBDEPS3) $(ADASRC3)					@@\
	$(MAKE) $(MFLAGS) -f Makefile.dep part3 \			@@\
		COMMAND='$(ADACOM) $(ADACOMFLAGS3)' RM='$(RM)'		@@\
									@@\
AdaInstallLibrary($(ADAWORKINGSTEM3),$(ADALIBDIR))			@@\
AdaDependObk(part3,$(ADASRC3),$(ADAWORKINGSTEM3))			@@\
AdaWorkingLibraryFile(libfile,$(ADAWORKINGNAMES3))			@@\
AdaWorkingLibrary($(ADAWORKINGSTEM2))

#endif /* AdaComplexLibraryTargetPart3 */


/*
 * AdaComplexProgramTarget - generate rules for compiling and linking the 
 * program specified by $(ADASOBJS) and $(ADASRCS), installing the program
 * and its man page, and generating dependencies.  It should only be used in 
 * Imakefiles that describe a single program.
 */
#ifndef AdaComplexProgramTarget

#define	AdaComplexProgramTarget(program,adaunit,localdeps,locallibs,syslibs)@@\
        PROGRAM = program						@@\
									@@\
AllTarget(program)							@@\
AdaLoadProgram(program,adaunit,$(ADASRCS),localdeps,locallibs,syslibs)	@@\
InstallProgramWithFlags(program,$(ADABINDIR),$(INSTBINFLAGS))		@@\
InstallManPage(program,$(MANDIR))					@@\
AdaDependObk(program,$(ADASRCS),$(ADAWORKINGSTEM))			@@\
AdaDependTarget($(ADAWORKINGSTEM))

#endif /* AdaComplexProgramTarget */


/*
 * AdaComplexProgramTarget_1 - generate rules for compiling and linking the
 * program specified by $(ADASRCS1), installing the program
 * and its man page, and generating dependencies for it and any programs
 * described by $(ADASRCS2) and $(ADASRCS3).  It should be used to build the
 * primary program in Imakefiles that describe multiple programs.
 */
#ifndef AdaComplexProgramTarget_1

#define	AdaComplexProgramTarget_1(program,adaunit,localdeps,locallibs,syslibs)@@\
            ADASRCS = $(ADASRCS1) $(ADASRCS2) $(ADASRCS3)		@@\
									@@\
AllTarget(program)							@@\
AdaLoadProgram(program,adaunit,$(ADASRCS1),localdeps,locallibs,syslibs)	@@\
InstallProgramWithFlags(program,$(ADABINDIR),$(INSTBINFLAGS))		@@\
InstallManPage(program,$(MANDIR))					@@\
AdaDependObk(program,$(ADASRCS1),$(ADAWORKINGSTEM))			@@\
AdaDependTarget($(ADAWORKINGSTEM))

#endif /* AdaComplexProgramTarget_1 */


/*
 * AdaComplexProgramTarget_2 - generate rules for compiling and linking the
 * program specified by $(ADASRCS2) and installing the program
 * and man page.  It should be used to build the second program in Imakefiles 
 * describing more than one program.
 */
#ifndef AdaComplexProgramTarget_2

#define	AdaComplexProgramTarget_2(program,adaunit,localdeps,locallibs,syslibs)@@\
AllTarget(program)							@@\
AdaLoadProgram(program,adaunit,$(ADASRCS2),localdeps,locallibs,syslibs)	@@\
InstallProgramWithFlags(program,$(ADABINDIR),$(INSTBINFLAGS))		@@\
InstallManPage(program,$(MANDIR))					@@\
AdaDependObk(program,$(ADASRCS2),$(ADAWORKINGSTEM))

#endif /* AdaComplexProgramTarget_2 */


/*
 * AdaComplexProgramTarget_3 - generate rules for compiling and linking the
 * program specified by $(ADASRCS3) and installing the program
 * and man page.  It should be used to build the third program in Imakefiles 
 * describing more than one program.
 */
#ifndef AdaComplexProgramTarget_3

#define	AdaComplexProgramTarget_3(program,adaunit,localdeps,locallibs,syslibs)@@\
AllTarget(program)							@@\
AdaLoadProgram(program,adaunit,$(ADASRCS3),localdeps,locallibs,syslibs)	@@\
InstallProgramWithFlags(program,$(ADABINDIR),$(INSTBINFLAGS))		@@\
InstallManPage(program,$(MANDIR))					@@\
AdaDependObk(program,$(ADASRCS3),$(ADAWORKINGSTEM))

#endif /* AdaComplexProgramTarget_3 */


/*
 * AdaComplexTestingTarget_1 - generate rules for compiling and linking the
 * program specified by $(ADASRCS1).  The program is not
 * installed; it is for debugging/local use.  It has no man page.
 * Generate dependencies for it and any programs
 * described by $(ADASRCS2) and $(ADASRCS3).  This should be used to build the
 * primary program in Imakefiles that describe multiple programs.
 */
#ifndef AdaComplexTestingTarget_1

#define	AdaComplexTestingTarget_1(program,adaunit,localdeps,locallibs,syslibs)@@\
            ADASRCS = $(ADASRCS1) $(ADASRCS2) $(ADASRCS3)		@@\
									@@\
AllTarget(program)							@@\
AdaLoadProgram(program,adaunit,$(ADASRCS1),localdeps,locallibs,syslibs)	@@\
AdaDependObk(program,$(ADASRCS1),$(ADAWORKINGSTEM))			@@\
AdaDependTarget($(ADAWORKINGSTEM))

#endif /* AdaComplexTestingTarget_1 */


/*
 * AdaComplexTestingTarget_2 - generate rules for compiling and linking the
 * program specified by $(ADASRCS2). The program is not
 * installed and it has no man page.  This should be used to build the second
 * program in Imakefiles describing more than one program.
 */
#ifndef AdaComplexTestingTarget_2

#define	AdaComplexTestingTarget_2(program,adaunit,localdeps,locallibs,syslibs)@@\
AllTarget(program)							@@\
AdaLoadProgram(program,adaunit,$(ADASRCS2),localdeps,locallibs,syslibs)	@@\
AdaDependObk(program,$(ADASRCS2),$(ADAWORKINGSTEM))

#endif /* AdaComplexTestingTarget_2 */


/*
 * AdaComplexTestingTarget_3 - generate rules for compiling and linking the
 * program specified by $(ADASRCS2) and $(ADASRCS2). The program is not
 * installed and it has no man page.  This should be used to build the third
 * program in Imakefiles describing more than one program.
 */
#ifndef AdaComplexTestingTarget_3

#define	AdaComplexTestingTarget_3(program,adaunit,localdeps,locallibs,syslibs)@@\
AllTarget(program)							@@\
AdaLoadProgram(program,adaunit,$(ADASRCS3),localdeps,locallibs,syslibs)	@@\
AdaDependObk(program,$(ADASRCS3),$(ADAWORKINGSTEM))

#endif /* AdaComplexTestingTarget_3 */



/*
 * AdaInstallLibrary - generate rules to install the indicated library.
 */
#ifndef AdaInstallLibrary
#define	AdaInstallLibrary(adalibname,dest)				@@\
install:: 								@@\
	$(RM) -r dest/adalibname.sub dest/adalibname.obj		@@\
	tar cBf - adalibname.sub adalibname.obj | \			@@\
		( cd dest ; tar xBf - )					@@\
	chmod -fR `echo $(INSTLIBFLAGS) | sed -e 's/-m//g'` \		@@\
			dest/adalibname.sub dest/adalibname.obj		@@\
	chmod -f a+x dest/adalibname.obj
#endif /* InstallLibrary */

/*
 * AdaDependObk - Some program/library/compilable-entity has dependencies.
 * We must scan his source files in order to ascertain those dependencies.
 * We must also generate a load.name target for the Makefile.dep file.
 */
#ifndef AdaDependObk
#define AdaDependObk(name,sources,workingstem)				@@\
.PRECIOUS: name.OBK							@@\
									@@\
Makefile.scan: name.OBK							@@\
									@@\
name.OBK: sources							@@\
	@$(CP) /dev/null make.scan.tmp					@@\
	@for i in sources ; \						@@\
	do \								@@\
		echo "@ $$i" >> make.scan.tmp ; \			@@\
	done								@@\
	@echo name NONE-FILE TARGET >> make.scan.tmp			@@\
	@for i in $? ; \						@@\
	do \								@@\
		echo '        dep-scan => '$$i ; \			@@\
		awk -f $(ADAIRULESRC)/dep-scan.awk \			@@\
			Working=workingstem.obk \			@@\
			OFile=make.scan.tmp $$i ; \			@@\
	done								@@\
	@$(MV) make.scan.tmp name.OBK					@@\
									@@\
clean::									@@\
	$(RM) *.OBK

#endif /* AdaDependObk */

/*
 * AdaSimpleDependObk - Some program/library/compilable-entity has
 * dependencies but those dependencies have been obtained by some AdaDependObk
 * target already and they don't need to be obtained again.
 * We just need to generate a load.name target for the Makefile.dep file.
 */
#ifndef AdaSimpleDependObk
#define AdaSimpleDependObk(name,sources,workingstem)			@@\
.PRECIOUS: name.OBK							@@\
									@@\
Makefile.scan: name.OBK							@@\
									@@\
name.OBK: sources							@@\
	@$(CP) /dev/null make.scan.tmp					@@\
	@for i in sources ; \						@@\
	do \								@@\
		echo "@ $$i" >> make.scan.tmp ; \			@@\
	done								@@\
	@echo name NONE-FILE TARGET >> make.scan.tmp			@@\
	@$(MV) make.scan.tmp name.OBK

#endif /* AdaSimpleDependObk */

/*
 * AdaDependTarget - generate rules to compute dependencies for all files
 * listed in the argument list.
 */
#ifndef AdaDependTarget
#define	AdaDependTarget(workingstem)					@@\
.PRECIOUS: Makefile.scan						@@\
									@@\
Makefile.scan:	 							@@\
	@echo 'Merge dep-scan information.'				@@\
	@if [ -f Makefile.scan ] ; then \				@@\
	    awk -f $(ADAIRULESRC)/dep-merge.awk OFile=make.dep.tmp \	@@\
		Makefile.scan $? ; \					@@\
	else \								@@\
	    awk -f $(ADAIRULESRC)/dep-merge.awk OFile=make.dep.tmp \	@@\
		$? ; \							@@\
	fi								@@\
	@$(MV) make.dep.tmp Makefile.scan				@@\
	@for i in $? ; \						@@\
	do \								@@\
		$(CP) /dev/null $$i ; \					@@\
	done								@@\
	@sleep 1							@@\
	@touch Makefile.scan						@@\
									@@\
Makefile.dep: Makefile.scan						@@\
	@$(RM) Makefile.dep						@@\
	@awk -f $(ADAIRULESRC)/dep-make.awk \				@@\
		ExternalLib='$(ADAEXTERNALLIB)' \			@@\
		OFile=Makefile.dep Makefile.scan			@@\
									@@\
depend:: 								@@\
	$(RM) *.OBK Makefile.dep Makefile.scan				@@\
	$(MAKE) $(MFLAGS) Makefile.dep					@@\
									@@\
clean::									@@\
	$(RM) Makefile.dep Makefile.scan
#endif /* AdaDependTarget */


/*
 * CleanTarget - generate rules to remove any garbage files; the #* is here
 * instead of in the definition of RM_CMD because System V will treat the 
 * pound sign in the RM_CMD variable as a comment.
 */
#ifndef CleanTarget
#define	CleanTarget()							@@\
clean::									@@\
	$(RM_CMD) \#*							@@\
	$(RM) -r $(ADAWORKINGLIB)
#endif /* CleanTarget */


/*
 * MakefileTarget - generate rules to build a normal Makefile.
 */
#undef MakefileTarget
#ifdef UseInstalled
#define MakefileTarget()						@@\
BuildMakefileTarget(Imakefile, \					@@\
	-DADA_IMAKEFILE_FILE='"'`pwd`/Imakefile'"' -DADATOPDIR=$(ADATOP))
#else
#define MakefileTarget()						@@\
BuildMakefileTarget(Imakefile, \					@@\
	-DADA_IMAKEFILE_FILE='"'`pwd`/Imakefile'"' -DADATOPDIR=$(ADATOP))
#endif /* MakefileTarget */


/*
 * ParamSubdirs - generate rules to recursively "make param" as
 * part of the make param step.
 */
#ifndef ParamSubdirs
#define ParamSubdirs(dirs) 						@@\
NamedTargetSubdirs(param,dirs,"paraming", /**/,param)			@@\
NamedTargetSubdirs(normalize,dirs,"normalizing", /**/,normalize)
#endif /* ParamSubdirs */

/*
 * ReparamSubdirs - generate rules to recursively "make reparam" as
 * part of the make reparam step.
 */
#ifndef ReparamSubdirs
#define ReparamSubdirs(dirs) \
NamedTargetSubdirs(reparam,dirs,"reparaming", /**/,reparam)
#endif /* ReparamSubdirs */

/*
 * MakeMakeSubdirs - generate rules to recursively recreate Makefiles as part
 * of the specified step in the build.  If $(TOP) is set to an absolute path, 
 * don't prepend the ../ prefix.  This makes running things outside of the 
 * source tree to be much easier.
 */

#undef MakeMakeSubdirs
#define MakeMakeSubdirs(dirs,target)					@@\
target::								@@\
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \			@@\
	for i in dirs ;\						@@\
	do \								@@\
		echo "making Makefiles in $(CURRENT_DIR)/$$i..."; \	@@\
		case "$$i" in \						@@\
		./?*/?*/?*/?*) newtop=../../../../ sub=subsubsubsub;; \	@@\
		./?*/?*/?*) newtop=../../../ sub=subsubsub;; \		@@\
		./?*/?*)    newtop=../../ sub=subsub;; \		@@\
		./?*)       newtop=../ sub=sub;; \			@@\
		*/?*/?*/?*)    newtop=../../../../ sub=subsubsubsub;; \	@@\
		*/?*/?*)    newtop=../../../ sub=subsubsub;; \		@@\
		*/?*)       newtop=../../ sub=subsub;; \		@@\
		*)	    newtop=../ sub=sub;; \			@@\
		esac; \							@@\
		newadatop=$$newtop ; \					@@\
		case "$(TOP)" in \					@@\
		/?*) newtop=  upprefix=  ;; \				@@\
		*) upprefix=../ ;; \					@@\
		esac; \							@@\
		case "$(ADATOP)" in \					@@\
		/?*) newadatop=  adaupprefix=  ;; \			@@\
		*) adaupprefix=../ ;; \					@@\
		esac; \							@@\
		$(MAKE) $${sub}dirMakefiles \				@@\
		    UPPREFIX=$$upprefix NEWTOP=$$newtop \		@@\
		    ADAUPPREFIX=$$adaupprefix NEWADATOP=$$newadatop \	@@\
		MAKEFILE_SUBDIR=$$i NEW_CURRENT_DIR=$(CURRENT_DIR)/$$i;\ @@\
	done



/*
 * MakeNsubdirMakefiles - generate rules to create sub Makefiles.
 */

#undef MakeNsubdirMakefiles
#define MakeNsubdirMakefiles()						@@\
subdirMakefiles:							@@\
	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak				@@\
	-@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \			@@\
	echo "	$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \ @@\
	$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \ @@\
	else exit 0; fi							@@\
	cd $(MAKEFILE_SUBDIR); \					@@\
		$(IMAKE_CMD) \						@@\
		-DADA_IMAKEFILE_FILE='"'`pwd`/Imakefile'"' \		@@\
		-DTOPDIR=$(UPPREFIX)$(TOP) \				@@\
		-DADATOPDIR=$(ADAUPPREFIX)$(ADATOP) \			@@\
		-DCURDIR=$(NEW_CURRENT_DIR) ; \				@@\
	$(MAKE) $(MFLAGS) Makefiles 					@@\
									@@\
subsubdirMakefiles:							@@\
	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak				@@\
	-@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \			@@\
	echo "	$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \ @@\
	$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \ @@\
	else exit 0; fi							@@\
	cd $(MAKEFILE_SUBDIR); \					@@\
		$(IMAKE_CMD) \						@@\
		-DADA_IMAKEFILE_FILE='"'`pwd/Imakefile'"' \		@@\
		-DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(TOP) \			@@\
		-DADATOPDIR=$(ADAUPPREFIX)$(ADAUPPREFIX)$(ADATOP) \	@@\
		-DCURDIR=$(NEW_CURRENT_DIR); \				@@\
	$(MAKE) $(MFLAGS) Makefiles 					@@\
									@@\
subsubsubdirMakefiles:							@@\
	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak				@@\
	-@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \			@@\
	echo "	$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \ @@\
	$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \ @@\
	else exit 0; fi @@\
	cd $(MAKEFILE_SUBDIR); \					@@\
		$(IMAKE_CMD) \						@@\
		-DADA_IMAKEFILE_FILE='"'`pwd`/Imakefile'"' \		@@\
		-DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(TOP) \	@@\
		-DADATOPDIR=$(ADAUPPREFIX)$(ADAUPPREFIX)$(ADAUPPREFIX)$(ADATOP) \	@@\
		-DCURDIR=$(NEW_CURRENT_DIR); \				@@\
	$(MAKE) $(MFLAGS) Makefiles 					@@\
									@@\
subsubsubsubdirMakefiles:						@@\
	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak				@@\
	-@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \			@@\
	echo "	$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \ @@\
	$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \ @@\
	else exit 0; fi 						@@\
	cd $(MAKEFILE_SUBDIR); \					@@\
		$(IMAKE_CMD) \						@@\
		-DADA_IMAKEFILE_FILE='"'`pwd`/Imakefile'"' \		@@\
		-DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(TOP) \	@@\
		-DADATOPDIR=$(ADAUPPREFIX)$(ADAUPPREFIX)$(ADAUPPREFIX)$(ADAUPPREFIX)$(ADATOP) \	@@\
		 -DCURDIR=$(NEW_CURRENT_DIR); \				@@\
	$(MAKE) $(MFLAGS) Makefiles