Julia Evans
Follow
Using make to compile C programs (for non-C-programmers)
The author is not a C programmer but occasionally needs to compile C/C++ programs from source. They used to rely on others to compile the programs, but since switching to a Mac, they've had to learn how to compile programs themselves. To compile a C program, one needs to install a C compiler, install the program's dependencies, run ./configure if needed, and run make. The author explains how to install a C compiler, install dependencies, and run ./configure. They also discuss common issues that can arise during the compilation process, such as dependency problems and compiler errors. The author explains how to fix these issues by passing flags to the compiler and linker. They also provide tips on how to build specific files, look at how other packaging systems built the same C program, and install the binary. The author concludes that understanding the basics of how C programs work can be useful, even if one is not a C programmer.