Toyota is forming new partnerships with other carmakers and battery producers as it seeks to win the race to electric and autonomous cars.

In a show of its seriousness, the world’s second largest carmaker on Friday moved forward by five years its goal of having electrified vehicles account for roughly half of sales.

A global shift away from gasoline and diesel cars is forcing even the biggest carmakers to form partnerships to share the costs of developing hybrid, electric and autonomous vehicles.

Toyota said Thursday that it would build a manufacturing platform dedicated to battery electric vehicles with Japan’s Subaru. The companies said in a statement that the industry is undergoing a “profound transformation,” the likes of which occurs only once every 100 years.

“Both Subaru and Toyota are required to conduct technological development with a sense of speed across a broader-than-ever spectrum of initiatives,” the statement said.

Cooperation with Subaru may help Toyota meet its new goal of dramatically boosting the number of hybrid or electric vehicles it sells to 5.5 million a year by 2025. Its previous target was 2030.

The company is also working to make sure it has enough batteries to power those cars, announcing Friday that it has agreed to partner with five new battery suppliers.

Three of the suppliers are Japanese companies, while two — Contemporary Amperex Technology and electric carmaker BYD — are from China.

Carmakers hook up

The trend toward cooperation has accelerated in recent months as carmakers come under increased pressure from upstarts such as Tesla and tech companies including Uber.

Germany’s BMW and Daimler have formed a joint venture that will develop ride-sharing and charging services, while BMW has agreed to work with Jaguar Land Rover on new electric engines.

Ford and Volkswagen are developing some new vehicles together.

Earlier this week, a proposed merger of Fiat Chrysler and Renault fell apart after the French company stalled on making a decision.

Renault is already part of an alliance with Japan’s Nissan and Mitsubishi Motors that allows the companies to share technology and development costs.