Random Number Generation during compile time (reset proof)

Hi all,
I need to create a random number when compiling sketch (it is a randomly generated MAC address). The idea is to maintain the same random numbers in the MAC address after the reset board, but generate unique (yet persistent) MAC addresses for each Arduino, which I programmed in the future. The Arduino boards will be in the same network, it is important to have a unique MAC addresses.

To store first time generated MAC address into EEPROM is the way, but I'm looking for simplest solution.
BTW: remains EEPROM content untouched after sketch is uploaded?

And also piece of my current code, but created MAC address is not reset resistant.

byte MACAddress[5];
...

void setup();{
  randomSeed(analogRead(0));
  MACAddress[0] = random(0, 256);
  MACAddress[1] = random(0, 256);
  MACAddress[2] = random(0, 256);
  MACAddress[3] = random(0, 256);
  MACAddress[4] = random(0, 256);
  MACAddress[5] = random(0, 256);
...
};

You can't generate random numbers at compile time.

You can, in setup(), read EEPROM to see if a MAC address is stored. If not, generate a random address AND store it. If it is stored, just read it.

The C preprocessor has no state variables, so it cannot be done. I toyed with the idea of using #define, but since you cannot re-define a #define without #undef'ing it first, it won't work. In any case, it would be pre-processor abuse.

Your best bet is to create a .h file with the random numbers. You can write a program to do this automatically and switch to a make file to have it done automagically each compile.

K5CZ:
BTW: remains EEPROM content untouched after sketch is uploaded?

Depending on the fuse settings the EEPROM should remain untouched.