I'm working on a C program, it's a custom shell that asks the user to set different options (IP, port, ...) and then allow the user to build a binary based on these informations. I was wondering what is the best way to build a new binary from within an existing program ?
EDIT: My question may have been a bit unclear. The new compiled binary is a simple TCP client that will connect to the specified IP and Port. I don't want this new binary to be dependant of a config file. How can i build this from my existing C program ? Should i write the IP and Port to a .c file and then compile it using system("/bin/gcc ...") ?