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: ┃ T d

⟦3929dc678⟧ TextFile

    Length: 1609 (0x649)
    Types: TextFile
    Names: »dep-merge.awk«

Derivation

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

TextFile

# dep-merge.awk
#
# We maintain a small database of information in the $(ADAWORKINGSTEM).obK
# file.  That database is updated with records from the $(ADAWORKINGSTEM).oBK
# file.  That file is generated every time any Ada unit under our control
# has a change of text/date.  We are fed the .obK file followed by the .oBK
# file.  We create an array of all known Ada units and we update that array
# with our intput.  When the input is done we have overridden any old
# information from the .obK file with new information from the .oBK file and
# we write out the accumulated information to the OFile.
#
# Each input line is of the form:
#
#	<Ada unit> <file> <GENERIC/BODY/SPEC/TARGET> <lib> <deps>
#
# We keep track of things based upon the <Ada unit> name and the <GENERIC...>
# type.  Any 2nd entry that has the same name&type as a previous entry will
# override that previous entry.

#---All "@" continuation lines are done here.

/^\@/ {
	Conts = Conts + 1;
	Cont[Conts] = $0;
	next;
}

#---All normal lines are processed here.

{
	if (NF < 3) {
		print "A line did not have at least <unit> <file> <type>?";
		print "{",$0,"}";
		exit 1;
	}
	Key = $1 $3;
	if (Conts == 0) {
		DB[Key] = $0;
	} else {
		DB[Key] = "";
		CDB[Key 0] = $0;
		for (i = 1; i <= Conts; ++i) {
			CDB[Key i] = Cont[i];
		}
		CDB[Key i] = "";
		Conts = 0;
	}
	next;
}

#---Dump the database when we are done.

END {
	for (i in DB) {
		if (DB[i] != "") {
			print DB[i]				> OFile;
		} else {
			for (j = 1; j != 0; ++j) {
				if (CDB[i j] == "") { break; }
				print CDB[i j]			> OFile;
			}
			print CDB[i 0]				> OFile;
		}
	}
}