Repository navigation
Build & Install Guide
So you want to install a three-line C program like it’s the Linux kernel?
Excellent.
This guide walks you through building and installing argc, with and without make, and explains the surrounding ecosystem magic that makes tiny tools like this feel like real software.
To build and install argc, you’ll need:
- A C compiler (such as
gccorclang) - Basic POSIX command-line tools (
make,install,rm) - A terminal
- A sense of humor (optional, but encouraged)
There are no dependencies, no libraries to install, no network calls, no build system sorcery. Just pure, portable C.
If you're on a Unix-like system, this is the easiest and most idiomatic way:
make
sudo make installThis will:
- Compile the
argcprogram with optimization and warnings enabled - Install it to
/usr/local/bin/argc - Install the manpage to
/usr/local/share/man/man1/argc.1
Once installed, you can run:
argc foo barAnd it will print:
3
And you can read the manpage with:
man argcTo remove the installed binary and manpage:
sudo make uninstallTo clean up the compiled binary:
make cleanYou can also compile and install everything manually:
cc -O2 -Wall -o argc argc.c
sudo install -Dm755 argc /usr/local/bin/argc
sudo install -Dm644 argc.1 /usr/local/share/man/man1/argc.1Want to uninstall?
sudo rm /usr/local/bin/argc
sudo rm /usr/local/share/man/man1/argc.1-
argcis 100% POSIX-friendly (no platform-specific hacks) - It builds with GCC, Clang, and any C compiler that supports C89 or newer
- It runs on any Unix-like system (Linux, macOS, BSD, even WSL)
If you can compile C, you can compile argc.
| Command | What it does |
|---|---|
make |
Compiles the program |
make install |
Installs the binary and manpage |
make uninstall |
Removes the installed files |
make clean |
Deletes the compiled binary |
cc -o argc argc.c |
Manual build without make
|
Tip
If you're using a nonstandard install prefix (like for packaging), you can run:
make PREFIX=/some/other/path installIf something breaks during install… it's probably not argc.
It’s probably your system. Or your karma.
Either way—happy hacking.