hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/mkproj.1
diff options
context:
space:
mode:
Diffstat (limited to 'mkproj.1')
-rw-r--r--mkproj.195
1 files changed, 85 insertions, 10 deletions
diff --git a/mkproj.1 b/mkproj.1
index 145f73e..1f716d1 100644
--- a/mkproj.1
+++ b/mkproj.1
@@ -1,4 +1,4 @@
-.TH MKPROJ 1 "2026-09-07" "mkproj 0.1.0" "User Commands"
+.TH MKPROJ 1 "2026-09-12" "mkproj 0.2.0" "User Commands"
.SH NAME
mkproj \- dumb project generator
.SH SYNOPSIS
@@ -13,9 +13,10 @@ mkproj \- dumb project generator
generates boilerplate for
.BR make ,
.BR cmake ,
-.B meson
-or
+.BR meson ,
.B premake5
+or
+.B xmake
so you do not have to keep writing build files for small projects.
.PP
It creates a directory
@@ -23,7 +24,9 @@ It creates a directory
containing a
.B src
directory with a stub
-.IR main ,
+.IR main
+(or the stub at the root, with
+.BR \-\-flat ),
a build file for the chosen build system, a
.B .gitignore
and, unless disabled, an initialized git repository. The stub compiles
@@ -57,10 +60,57 @@ for
.TP
.BR \-b ", " \-\-build " " \fIsystem\fR
Build system to generate:
-.BR make ", " cmake ", " meson " or " premake .
+.BR make ", " cmake ", " meson ", " premake " or " xmake .
Default
.BR make .
.TP
+.BR \-k ", " \-\-kind " " \fIkind\fR
+What to build:
+.B exe
+for an executable or
+.B lib
+for a static library. A library gets a
+.RI < name >.h
+/
+.RI < name >.c
+pair with a stub function instead of a
+.IR main .
+Default
+.BR exe .
+.TP
+.BR \-\-cc " " \fIcc\fR
+Compiler to use. Default
+.B clang
+for
+.B c
+and
+.BR objc ,
+.B clang++
+for
+.BR cpp .
+Applies to the
+.BR make ", " premake " and " xmake
+backends (for
+.B premake
+and
+.B xmake
+it selects the matching toolset);
+.B cmake
+and
+.B meson
+pick the compiler from the environment instead.
+.TP
+.BR \-\-license " " \fIname\fR
+Write a
+.B LICENSE
+file. One of
+.BR mit ", " isc ", " bsd-2 ", " bsd-3 " or " unlicense .
+The copyright holder is taken from
+.B git config user.name
+(falling back to
+.BR $USER ).
+No license is written by default.
+.TP
.B \-\-no\-git
Do not initialize a git repository.
.TP
@@ -72,6 +122,13 @@ Only meaningful for
and
.BR premake .
.TP
+.B \-\-flat
+Flat layout: put the sources at the project root instead of in a
+.B src
+directory. Objects still build into the
+.B \-\-bin
+directory, so the tree stays a single level deep.
+.TP
.BR \-\-bin " " \fIdir\fR
Build directory. The default depends on the build system:
.B bin
@@ -99,10 +156,16 @@ Default
.BR bin\-int .
.TP
.B \-\-no\-clangd
-Do not add clangd files
-.RB ( .clangd ", " compile_flags.txt ", " compile_commands.json )
+Do not generate a
+.B compile_flags.txt
+for clangd, and do not add the clangd artifacts
+.RB ( .clangd ", " compile_commands.json )
to
.BR .gitignore .
+By default a
+.B compile_flags.txt
+with the project's flags is written so an editor's language server works before
+the first build.
.TP
.BR \-v ", " \-\-version
Print version and exit.
@@ -120,9 +183,7 @@ or split objects into
when
.B \-\-intermediate
is given.
-.B cmake
-and
-.B meson
+.BR cmake ", " meson " and " xmake
use a single out\-of\-source build directory named by
.BR \-\-bin ,
so
@@ -141,6 +202,20 @@ A C++20 project built with cmake.
.B mkproj \-b make \-\-bin\-int obj tool
A make project with objects compiled into
.BR obj/ .
+.TP
+.B mkproj \-\-flat quick
+A flat project: the source sits at the root, no
+.B src
+directory.
+.TP
+.B mkproj \-k lib \-\-license mit libfoo
+A static-library project with an MIT
+.BR LICENSE .
+.SH ENVIRONMENT
+These set defaults that command-line options override:
+.BR MKPROJ_LANG ", " MKPROJ_STD ", " MKPROJ_BUILD ", " MKPROJ_CC ", " MKPROJ_KIND
+and
+.BR MKPROJ_LICENSE .
.SH "EXIT STATUS"
.TP
.B 0