THE star of the show was missing from the skies above the Farnborough air show, Europe’s biggest aerospace get-together, which began on July 14th. The F-35 fighter (pictured), which was to have made its first appearance outside America, is grounded after an engine fire. Not taking to the air when expected is a trait of Lockheed Martin’s jet. It is years behind schedule and stratospherically over budget. Its absence is an embarrassment for Lockheed but, then again, its presence might have reminded the defence officials shopping for kit at Farnborough of just the sort of complex and expensive programme that they want to avoid signing up to in future.

Arms-makers are going through a lean period. Some big contracts, such as ones to make bombers, trainer aircraft and drones, are still up for grabs in America, the world’s biggest spender. But it and other rich-world governments, struggling to curb their deficits, are trying ever harder to get the most bang for the fewest bucks. The revenues of 17 of the top 20 American weapons-makers shrank in 2013. American-led wars in Iraq and Afghanistan had helped to push global spending to a record $1.7 trillion in 2008. Since then it has plunged by $100 billion, according to IHS Jane’s, a consulting firm.

The good news for arms-makers is that the worst is probably over. America’s Congress has partly reversed automatic cuts it had imposed to deal with a ballooning deficit. In Europe the rate of decline is slowing. Growing wealth in emerging economies and new threats in Syria, Iraq and the South China Sea are encouraging rapid spending growth in Asia, the Middle East and Latin America. In all, the market for military kit (excluding Russia and China, mainly closed to Western firms) is set to bottom out next year (see chart 1).

Although the Pentagon’s budget is as big as that of the next 15 defence ministries combined, its coffers are no longer bottomless. It wants more “make do and mend”, upgrading existing equipment. The model here is Boeing’s venerable B-52 bomber, which has been constantly refitted, and will fly on past its 90th birthday in 2042. The Pentagon has moved away from conventional “cost-plus” contracts, which give contractors an incentive to overspend, since they are guaranteed a margin on top of whatever their costs turn out to be. But in the department’s annual assessment of its own competence as a buyer, published last month, it noted that the alternative, fixed-price contracts, has not always proved better: indeed, contractors sometimes end up with profit margins “spectacularly” higher than in cost-plus deals. So the Pentagon is seeking to create more sophisticated contracts that encourage arms-makers to find cost savings that are shared with the taxpayer. America is taking an interest in moves across the Atlantic, especially in Britain, to get companies to take over the ownership and upkeep of weapons systems. A deal Britain struck with BAE Systems in 2009 provides “strike power by the hour” for the Royal Air Force’s Eurofighter Typhoon jets. The RAF’s commitment to low-cost flying was reinforced with the announcement at Farnborough that maintenance contracts for transporters would go to Flybe, a budget airline. Britain even recently contemplated outsourcing its entire military procurement, only to get cold feet about such a radical move. An earlier squeeze in military spending, in the 1990s, prompted a spate of mergers, as weapons-makers cut costs by joining forces. This time the Pentagon has made it clear that it will not accept further consolidation that damages competition. In Europe, political opposition hinders efforts at consolidation—Airbus’s attempt in 2012 to merge with BAE Systems failed for this reason. With mergers out of the question, the big military contractors had to move quickly to prepare for the most recent round of spending cuts, by slashing costs and laying off battalions of workers. Now they are looking at what else they can do to prepare for an age in which budgets have stopped falling, but defence ministries are more demanding buyers.

One answer is to find new, civilian markets for their products. Some big suppliers to the armed forces, such as Boeing and UTC—the owner of Pratt & Whitney, a maker of aero-engines—already have even bigger civilian sides (see chart 2). But the more defence-heavy firms’ past attempts at diversification into non-military work were “unblemished by success”, in the words of Norm Augustine, a former Lockheed boss. Still, a lot of the things they make have civilian uses. Secure communications systems could help to protect banks and other businesses from hackers. Raytheon has just sold its Boomerang sniper-detection system to American power firms, after a gunman knocked out several transformers providing electricity to Silicon Valley.

As yet, though, such contracts are a small part of most arms companies’ businesses: civilian cyber-security and related activities provide only around 2% of Lockheed’s revenues, for example. And although weapons-makers are “essentially tech firms”, as Rami Myerson of Investec, a bank, puts it, they may struggle to compete with nimbler Silicon Valley outfits. Indeed these are beginning to invade the defence industry’s territory. “Warfare is going digital,” observes Tom Captain of Deloitte, a consulting firm. Tech firms have shown that they can supply robots, drones and intelligence software. SpaceX, founded by Elon Musk, a tech entrepreneur, is taking America’s air force to court to reopen bidding for a satellite-launch contract awarded to Boeing and Lockheed. If it is hard for military suppliers to make it on civvy street, it is not much easier for them to hawk their gear to new export customers. Plenty of countries, from the Middle East to East Asia, are spending more on arming themselves with jets, missiles and tanks. China’s increasingly assertive territorial claims are prompting its neighbours to bolster their defences. But the market is highly fragmented: Brazil, among the bigger spenders, has a defence budget just 4% the size of America’s. Not only is it costly to sell to lots of smallish customers; often they insist on some manufacturing being done locally, or on access to sensitive technology that the arms suppliers’ home governments would not allow. India, the biggest prize, is a fearfully tough customer, imposing all manner of conditions in return for arms contracts. The competition to sell to foreign powers is fiercer than at home. Asian and Latin American countries may prefer Russian or Chinese equipment that is not quite as good as Western gear, but far cheaper. Ever more countries with weapons industries of their own are encouraging their firms to seek new export markets, such as South Korea and Japan (see article). Those arms-makers which are part of big civilian aerospace conglomerates can spread their research and development overheads across a broader base. They also have a better chance of cross-selling to the defence ministries of countries whose state airlines are already their customers. Airbus’s recent restructuring was in part aimed at achieving this. Civil aerospace is booming, giving such firms strong financial firepower. Potential buyers of their military gear will feel reassured that these companies will still be around in a decade or two, when it needs updating.

Companies that mostly make military products may find life is harder. The turn in the spending cycle may encourage them to dream that vast, money-spinning programmes like the F-35 will return, and the good times will roll again. But the evidence is that an often unreliable, inefficient and over-rewarded industry is at last being forced to change its ways to survive.