A practical guide for non-C programmers on compiling C programs from source using make. Covers installing compilers, managing dependencies, running configure scripts, and troubleshooting common compilation errors. Explains how to use environment variables like CPPFLAGS and LDLIBS to fix dependency issues, and provides tips for

9m read time From jvns.ca
Post cover image
Table of contents
step 1: install a C compilerstep 2: install the program’s dependenciesstep 3: run ./configure (if needed)step 4: run makecompiler errors are often dependency problemsthe world’s shortest introduction to the compiler and linkermake uses environment variables to configure the compiler and linkersecret environment variable: CPPFLAGShow to use CPPFLAGS and LDLIBS to fix this compiler errortip: how to just build 1 specific file: make $FILENAMEtip: look at how other packaging systems built the same C programstep 5: installing the binarystep 6: maybe make your own package!it can be useful to understand a little about C even if you’re not a C programmer

Sort: