If you are going to try to make the barrel, you have your work cut out.
As the others posted, the original guns barrels were made by forge welding a strip of iron around a mandral making a hollow tube.
This tube was then finish bored or reamed (by hand) on a long benchlike gun drilling machine to establish the finished size.
If the bore was bent, the barrel was physically straightened by bending it in the opposite direction.
In the old days, this was all done by eye.
If it was to be rifled, it was then put on the rifling machine which cut one farrel (groove) at a time, taking a little material with each stroke.
There are many books and vidios which describe this process.
Modern factorys use a "gun drill" which is a horizontal machine with a very special drill bit. The bit does not rotate, the barrel does as it is slowly fed into the drill.
This process by the way will drill a very straight hole if the drill is properly sharpened.
The precision of holes drilled by these drills is around +/-.001 on the diameter.
For inexpensive barrels, this is sometimes considered to be good enough. For premium barrels, the bore is usually reamed (on the same or similar machines) by a multi-fluted tungsten carbide reamer. The size tolerance on a reamed hole is usually about +/-.00025 measured on the diameter.
Really good barrels bores are then lapped and polished to a mirror like finish.
The best barrels bores are measured with a "air gage" which is inserted thru the bore and uses leaking air to determine the size variation from a Master Gage.
Air gages are incredibly accurate, some being able to measure as little as 10 millionths of an inch.
If the barrel is to be rifled, it is placed on a rifleing machine which may use several different methods of producing the finished rifleing.
The fine points of making a barrel are too numberous to get into here, but if your really interested in the subject, there are many good books available.