C++/Init provides a starting point for new C++ projects. The project includes a makefile generator called bake, a convenient template for small projects, a simple profile for configuring your shell, a .gitignore file, and a standard directory layout for consistency with other projects.
To get started:
-
Create a new Git repository.
git init my-project -
Add
cpp-initas a git remote.cd my-project git remote add cpp-init git@github.com:unbuggy/cpp-init.git -
Pull the
cpp-initmaster branch into your repo.git pull cpp-init master -
Generate a makefile by running
bake.bin/bake -
Add code to the
srcdirectory, usingmaketo build.cd src vi main.cpp make -
Whenever you delete or obsolete the generated makefile, regenerate it.
../bin/bakeThe makefile is obsoleted whenever you add or remove source files or local
#includerelationships. -
Customize the cloned repository as you see fit. For example, you might edit the makefile generator (
etc/mkmk.cpp)to add atesttarget to generated makefiles. -
Whenever you wish to update or upgrade your version of C++/Init dependency, fetch or pull (respectively) the
cpp-initremote:git pull cpp-init master
For convenience, you may source etc/profile to prepend the bin directory to your path (so that you can run bake easily, as well as any project-specific scripts you add). The profile also adds the build output directory to your path, so that you can run compiled programs right from the src directory.
There are a few limitations:
-
The makefile generator assumes a Unix-like environment, and is developed solely on OS X.
-
The default shell is assumed to be Bash-like. If you want to use
csh, you'll need to do a little setup; for example, translatingetc/profiletoetc/login.
Thank you for trying C++/Init. May the source be with you!