how install source file HP-UX

I want to install a source tar file using SAM . How do I do that?
Also I want to update all installed software using SAM?

sam or swinstall its the same regarding software installation on hp, just type swinstall and follow instruction (you will have to use your eyes) ... assuming you have file(s) in depot format available

If your source file is in the tar format maybe you will have to "untar" it.
You can do that using the command tar -xvf <source file>

Can you utilize sam/swinstall to install source packages?

I always use the following when installing from source:

Whether your installing from source or a depot, dependencies may need to be resolved before proceeding w/the install.

It may also be necessary to add options for ./configure, read the README.
Setting compiler flags, pointing the tree to other required packages, and coordinating options with them. Once this has been done, the rest of the process is usually not much more than:

$ sh ../configure

$ make

$ make test or sometimes make check - see the makefile (I often skip this step, I guess I'm a bit impatient)

$ sudo make install

The final step, sudo, temporarily grants root privileges (assuming this has been explicitly configured by the system administrator) so that files may be copied to the proper places on the system. If sudo is not available, your only other option is to perform this step as as root.