Last active
November 26, 2025 05:44
-
-
Save lidgnulinux/16bdfe6abeca764fc8f432b317d5a54e to your computer and use it in GitHub Desktop.
Simple and clear build.ninja example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # build.ninja | |
| pkgname = dwl | |
| version = v0.8-dev | |
| rev = 0 | |
| cat = wayland | |
| srcdir = dwl | |
| format = ${pkgname}_${version}_${rev}@${cat} | |
| rule edit | |
| command = vim $srcdir/config.def.h | |
| description = Edit default config. | |
| pool = console | |
| rule dwl | |
| command = make -C $srcdir | |
| description = Build the dwl executable. | |
| rule package | |
| command = make -C $srcdir DESTDIR="../package-$pkgname" install | |
| description = Install the dwl package to package directory. | |
| pool = console | |
| rule archive | |
| command = tar -C package-$pkgname -czvf ${format}.tar.gz . | |
| description = Build the archive for $pkgname package. | |
| rule clean | |
| command = make -C $srcdir clean | |
| description = Clean the dwl build. | |
| build edit: edit | |
| build dwl: dwl | |
| build clean: clean | |
| build package: package | |
| build archive: archive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rule coba | |
| command = echo "coba" $ | |
| && touch coba $ | |
| && echo "coba" > coba | |
| description = coba | |
| build coba: coba |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment