Tcl is a scripting language. No compiling. Files are run by an interpreter,
in ns2 the binary 'ns' is used : 'ns file.tcl'
The usual method is to add the new object to a copy of the 'Makefile'.
Example abcd.cpp : Then add abcd.o to "Makefile.new", section "OBJ_CC =".
( Assume a backup for Makefile ( like Makefile.org ) and ns
( Rename ns to e.g. ns233 )).
Next : make clean && make -f Makefile.new .
Like the example, you already know :
http://elmurod.net/wps/?p=157
Another example :
http://www.lrc.ic.unicamp.br/wimax_ns2/
Please look for "Installation".
..