Compile code 50 times when each cycle has a different #define value

I have a #define config (number)

I want to compile my code for each possible (number)
And see if one of these values has compilation errors.

My project is software that can be compiled into 50 different versions of the same hardware device.

I know it has something to do with advanced scripting, but I wasn’t able to find out how to achieve this.

#define MACHINE_CONFIG (0 - 50)

Thanks if you want to help me

Ypu should create a bash sxript (or bat in windows) to run pio build with 50 times and update define before steps.