This may be too late for you, in that you may already have agreed contractually to do this, and you could have agreed to mutually incompatible terms with different customers.
There are two ways in which you can provide your customers with your source code. Ownership of the copyright and licensed.
Some customers will want ownership of the source code. This means, at the end of the process they will pay you money and you will in exchange give them copyright copyright of the code you create for them. One reason for this is if they see significant potential for intellectual property in the source code, and may want to value this on their company balance sheet. In this scenario, you will have no entitlement to continued use of that source code for other projects, unless you also obtain a license from your customer giving you this entitlement.
If your customer is buying an 'off the shelf' product from yourselves, they would expect to be receiving a license to use the software, not ownership of the source code. They should be expecting that you are selling the same (or similar) software to many other organisations, and that they are hopefully benefiting from a lower cost of purchase due to the wider customer base.
However, the situation in this question is a mishmash of the two.
Here is what I would want to be able to do. I would grant your customer a license to use (and modify) your shared code. If quizzed by the customer, I would point out that this is shared code that you have already used in multiple projects and have current bids in place for future work that are based on you continuing to use this work. point out that this has resulted in less time on this project for your customer and that they have paid a lower price as a result. Like other shared libraries of code used by the project, they have a license in place to use this code, and to allow other development teams to develop this, and other projects based on this library. However, if they would rather ownership of all the code, you are willing to create a replacement, but this would be an additional charge.
Depending on what you have already committed yourself to, you could be having to write a replacement functionality for free, or giving away your source code.
Remember, there are different types of libraries. The Standard Template Library in C++ is a good example of a library that is included at a source code level and is compiled into a project executable that may be quite similar to how you have used your common code.