I don't want to recite all the disclaimers and caveats from comments all over again. This is a little like asking what a car costs in the United States in the twentieth century, where the range is so huge that it's hard to give a really useful point answer. But I will offer an indicative budget for a cannon made in Burgundy in 1376-1377; this is obviously a different time and place, but it is an instance where we have documentation of unusual level of detail. Looking at this can perhaps show some of the factors involved in the cost of artillery manufacture, and therefore hopefully be helpful for you in understanding what is driving both the costs, and the large error bars around them.
This summary can be found with an English translation in Appendix 4 of The Artillery of the Dukes of Burgundy, 1363-1477 by Robert Douglas Smith and Kelly DeVries (Boydell, 2005), cited to L'artillerie des ducs de Bourgogne by Joseph Garnier (Paris: H. Champion, 1895), p9ff. This is from the account-books of Simon Lambert of Chalon, manuscript B 3522 in the Archives of the Côte-d'Or that now house a large number of Burgundian official records.
The total accounted cost of the weapon, an iron cannon of 60 livres, was 38 francs and 10.5 gros, including:
- 320 livres of iron (fer au pois), bought locally at 2 francs 10 gros per hundredweight
- 16.5 more livres of a different kind of iron (taulles de fer): 10 francs 5.5 gros
- charcoal: 4 francs and 3 gros
- labour for a Parisian metalworker and four labourers for 13 days, plus whatever tools they needed that couldn't be supplied locally: 17 francs and 4 gros. Their lodging was provided by the ducal "masters of cannon" and not included in this account. Note that serrurier means a locksmith these days, but was more general back then.
- 1.5 livres of gunpowder, which had to be bought in from Lyon because the masters of cannon advised the locally-available stuff was no good: 2.5 sous
- "a big piece of wood": 6 gros
- carpenter to carve the big piece of wood into a cannon mount: 6 gros
- transport of the finished piece and two balls of shot, on a two-horse cart, from Chalon to Dijon: 18 gros
This does not include the salaries of the two expert cannon-makers in charge of the project, who were retained at 10 francs per month each (Garnier, p13).
In trying to transpose these costs to any other time and place, we can see that quite a lot hinges on being able to get the right quality of raw materials, and the necessary expert labour to make the thing. This particular example, of a very wealthy and seasoned user of artillery, still shows difficulties in procurement: somebody who was less well-connected would have found it harder to source the parts and labour, and might have spent much more while ending up with a less good cannon. Even this group later spent 223 livres on an enormous weapon which broke on its first trial.
For example, this accounting is based on the fact that the duchy already had the forge infrastructure available. Considering the charcoal alone - which you need in order to reach the necessary temperature and control the chemical makeup of the metal - those four francs are the price for locally-produced charcoal of known quality. It is hard to transport charcoal because it falls to bits. You can transport the raw wood but it's really heavy. So charcoal production tended to be very local to where it was needed; hopefully, you have a good source of wood nearby, or else all this is going to cost a lot more. Equally, you can see (just as well as the strategists of the time) that making an enormous weapon would be really expensive, compared to one or more which were smaller and more manoeuvrable. Those would naturally have different tactical uses.
Over the mentioned time period (1300-1600) there were also enormous changes in artillery technology, the economy, etc., which make it difficult to extrapolate figures from one context to another. Also, as you may be able to tell from the several currency units mentioned, the currencies were not particularly stable - this was an especially difficult period for French coinage - which has an effect on what sort of money your counterparty will even accept for his big piece of wood.
In the context of actually using these things in the field, they need:
- To be transported, which can be difficult because they are heavy. Wagon wheels sink into the mud, horses eat food, etc. If you look at the 18 gros transport cost above, between two nearby towns (< 80km), and imagine trying to bring lots of these much further, then you can see that pretty soon we're talking real money.
- To also have gunpowder and shot. Cannonballs are heavy too. But some rulers were able to maintain stocks at several locations in case of need.
- A crew to fire them. It is actually quite difficult to do this properly. Sources mentioned above show a 6 livre salary for a lead artilleryman, and there would be several other gunners under him. All of these people also need to travel and eat food.
There are thus several other cost factors, especially if you want to use field artillery (vs. something that sits in a castle and points outward). So overall, how much a cannon cost would be "lots of money", but it's very hard to say in specifics without knowing an awful lot about the local circumstances of manufacture.