hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/mkproj.1
blob: 145f73ed92871001cd497478d41e8d8f6fd22585 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
.TH MKPROJ 1 "2026-09-07" "mkproj 0.1.0" "User Commands"
.SH NAME
mkproj \- dumb project generator
.SH SYNOPSIS
.B mkproj
.RI [ options ]
.I name
.br
.B mkproj
.BR \-v | \-h
.SH DESCRIPTION
.B mkproj
generates boilerplate for
.BR make ,
.BR cmake ,
.B meson
or
.B premake5
so you do not have to keep writing build files for small projects.
.PP
It creates a directory
.I name
containing a
.B src
directory with a stub
.IR main ,
a build file for the chosen build system, a
.B .gitignore
and, unless disabled, an initialized git repository. The stub compiles
cleanly under a strict set of warnings with address and undefined
sanitizers enabled by default.
.SH OPTIONS
.TP
.BR \-l ", " \-\-lang " " \fIlang\fR
Source language:
.BR c ", " cpp " or " objc .
Default
.BR c .
.TP
.BR \-s ", " \-\-std " " \fIstd\fR
Language standard passed to the compiler as
.BI \-std= std\fR,
for example
.B c17
or
.BR c++23 .
Must be valid for the chosen language. Defaults to
.B c17
for
.B c
and
.BR objc ,
and
.B c++23
for
.BR cpp .
.TP
.BR \-b ", " \-\-build " " \fIsystem\fR
Build system to generate:
.BR make ", " cmake ", " meson " or " premake .
Default
.BR make .
.TP
.B \-\-no\-git
Do not initialize a git repository.
.TP
.B \-\-intermediate
Compile objects into a separate directory (see
.BR \-\-bin\-int ).
Only meaningful for
.B make
and
.BR premake .
.TP
.BR \-\-bin " " \fIdir\fR
Build directory. The default depends on the build system:
.B bin
for
.B make
and
.BR premake ,
.B build
for
.BR cmake ,
and
.B builddir
for
.BR meson .
The final executable is written here.
.TP
.BR \-\-bin\-int " " \fIdir\fR
Separate directory for intermediate object files. Implies
.BR \-\-intermediate ,
and applies only to
.B make
and
.BR premake .
Default
.BR bin\-int .
.TP
.B \-\-no\-clangd
Do not add clangd files
.RB ( .clangd ", " compile_flags.txt ", " compile_commands.json )
to
.BR .gitignore .
.TP
.BR \-v ", " \-\-version
Print version and exit.
.TP
.BR \-h ", " \-\-help
Print a usage summary and exit.
.SH "BUILD SYSTEMS"
.B make
and
.B premake
build objects and the executable into
.BR \-\-bin ,
or split objects into
.B \-\-bin\-int
when
.B \-\-intermediate
is given.
.B cmake
and
.B meson
use a single out\-of\-source build directory named by
.BR \-\-bin ,
so
.B \-\-intermediate
and
.B \-\-bin\-int
do not apply to them and are rejected if combined with either.
.SH EXAMPLES
.TP
.B mkproj hello
A C project built with make.
.TP
.B mkproj \-l cpp \-s c++20 \-b cmake app
A C++20 project built with cmake.
.TP
.B mkproj \-b make \-\-bin\-int obj tool
A make project with objects compiled into
.BR obj/ .
.SH "EXIT STATUS"
.TP
.B 0
The project was generated.
.TP
.B 1
A usage error, or a file or directory could not be created.
.SH AUTHOR
hachem <im@hachem.wtf>