From f3c40f4bd779b5c0ed4e9d6e7e42629f4f240661 Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Tue, 31 Dec 2024 14:34:36 +0100 Subject: [PATCH] Add -n option, and other improvements --- mkproj.1 | 69 ++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 19 deletions(-) diff --git a/mkproj.1 b/mkproj.1 index 6e913af..4b42dfe 100644 --- a/mkproj.1 +++ b/mkproj.1 @@ -11,7 +11,7 @@ .Nm .Fl v .Nm -.Op Fl f | Fl l | Fl s +.Op Fl f | Fl l | Fl n | Fl s .Oo .Op Fl d .Fl g Ar gitroot @@ -24,6 +24,13 @@ The script creates a C++ project directory structure with some predefined boilerplate files, ready to be built using .Xr make 1 . +.Pp +Please note that you will need GNU Make to use the supplied Makefiles, which is +standard on Linux systems. +On BSD systems, use +.Xr gmake 1 , +which is usually available through a package manager for the platform. +.Pp .Nm can create a directory for a simple project using a single source file; a general project suitable for many source files; a general project setup as a @@ -40,37 +47,54 @@ display a version string, containing the .Xr git 1 commit hash, after you have built the tool at least once. .Pp -The options are as follows: +The options for +.Nm +are as follows: .Ss General Options .Bl -tag -width Ds -.It Fl \-version, v -Print version info and exit. -.It Fl \-gitroot Ar gitroot , Fl g Ar gitroot +.It Fl d +Save default Git URL to clone from. +Will only have any effect when also using the +.Fl g +option. +It will cause the +.Ar gitroot +argument for +.Fl g +to be saved into the +.Nm +configuration file, for later use with the +.Fl G +option. +.It Fl g Ar gitroot Clone a .Xr git 1 repo from the supplied git URL. When combined with the -.Fl \-default -or .Fl d option, the supplied git URL will be saved into the .Nm configuration file. -.It Fl \-gitfav , Fl G -Use the git URL saved earlier to clone a repo from. -.It Fl \-tplroot Ar tplroot , Fl t Ar tplroot +.It Fl G +Use the Git URL saved earlier to clone a repo from. +.It Fl t Ar tplroot Specify the root directory where the project templates can be found. This option is useful when you want to use a modified set of files to base your projects on. +.It Fl v +Print version info and exit. .El .Ss Project Type Options .Bl -tag -width Ds -.It Fl \-filter, f -Create a filter project. -.It Fl \-library, l +.It Fl f +Create a filter tool project. +.It Fl l Create a library project. -.It Fl \-simple, s -Create a simple project. +.It Fl n +Create a normal tool project. +This is the default. +.It Fl s +Create a simple tool project. .El .Pp Without any @@ -190,8 +214,9 @@ This is where the C++ standard is defined. Change if needed for your project. Note the .Dq += -operator here, so a possibly defined $CXXFLAGS environment -variable will be honored. +operator here, so a possibly defined +.Ev CXXFLAGS +environment variable will be honored. .It PRECOMPILE The project can generate and use a precompiled header. By default, the precomp.hpp file contains the C++ Standard Library headers, but @@ -246,7 +271,7 @@ Possible library dependencies should be added to the Makefile. .Bl -tag -width Ds .It make Use this to compile and link your tool. -When doing this with for the first time, or after doing a +When doing this for the first time, or after doing a .Dq make dist-clean , a .Dq build @@ -291,10 +316,16 @@ that is generated using the various invocations. .It make uninstall Remove the files that are installed by the -.Sq make install +.Dq make install invocation. Please note that no dependency checks are done, so removal could break other tools or libraries that depend on the removed files. +.Pp +Also, if the install also created standard directories, like +.Pa /usr/local/bin , +.Pa /usr/local/lib , +.Pa /usr/local/include , +etc., and they end up empty after the uninstall, they won't be removed. .El .Ss Tool Features, out of the box TODO describe main.cpp and version.cpp here.