~brenns10/sc-template

bfed01dfd7e8d00fc8db65f31cbb5b01cb1eeffd — Stephen Brennan 1 year, 1 month ago
Initial commit of sc-template
8 files changed, 131 insertions(+), 0 deletions(-)

A .clang-format
A .gitignore
A .pre-commit-config.yaml
A CHANGELOG
A LICENSE
A README.md
A compile_commands.json
A meson.build
A  => .clang-format +12 -0
@@ 1,12 @@
BasedOnStyle: LLVM
IndentWidth: 8
UseTab: ForIndentation
BreakBeforeBraces: Linux
AllowShortIfStatementsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
IndentCaseLabels: false
ContinuationIndentWidth: 8
Cpp11BracedListStyle: false
AlignConsecutiveMacros: true
BraceWrapping:
  AfterEnum: true

A  => .gitignore +2 -0
@@ 1,2 @@
build
.clangd

A  => .pre-commit-config.yaml +12 -0
@@ 1,12 @@
repos:
-   repo: local
    hooks:
    -   id: clang-format
        name: "Run clang-format"
        language: system
        files: "^.*\\.[ch]$"
        entry: clang-format -i
-   repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.5.0
    hooks:
    -   id: trailing-whitespace

A  => CHANGELOG +16 -0
@@ 1,16 @@
Changelog
=========

This project uses the following versioning scheme:

- Major version 0 is development-phase. No compatibility guarantees are made,
  and breaking changes can happen on minor version or patch versions.
- Starting vith major version 1, we follow roughly "semantic versioning":
  - Patch version is incremented for small fixes
  - Minor version is incremented for new features, or major bug fixes
  - Major version is incremented on any API change which would break programs

0.0.0 (YYYY-MM-DD)
------------------

* Bullet points for fixes, additions.

A  => LICENSE +24 -0
@@ 1,24 @@
Copyright (c) 2020 Stephen Brennan. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice,
       this list of conditions and the following disclaimer.
    2. Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in the
       documentation and/or other materials provided with the distribution.
    3. Neither the name of the copyright holder nor the names of its
       contributors may be used to endorse or promote products derived from
       this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

A  => README.md +29 -0
@@ 1,29 @@
sc-template
===========

This serves as a template which I can use to quickly create a new "sc-" library.
Copy and paste this directory and update the following files:

- `README.md`: replace this text with a description of the project
- `CHANGELOG.md`: create a remark for version 0.0.0 and add the date
- `meson.build`: replace the ALL CAPS contents with proper values

All remaining files need not be modified. Place C source directories into the
`src` dir and public headers into `include`.


Development
-----------

Run the following to create a build directory:

    meson build

You may then compile (or re-compile) with:

    ninja -C build

When you would like to commit your changes, please ensure that you have
pre-commit hooks installed, so that automated checks can run on your code:

    pre-commit install

A  => compile_commands.json +1 -0
@@ 1,1 @@
build/compile_commands.json
\ No newline at end of file

A  => meson.build +35 -0
@@ 1,35 @@
project(
  'sc-NAME', 'c',
  version : '0.0.0',
)

sources = [
  # SOURCES HERE
]

inc = include_directories('include')

libsc_NAME = library(
  'sc-NAME',
  sources,
  include_directories : inc,
  install : true,
)

libsc_NAME_dep = declare_dependency(
  include_directories : inc,
  link_with : libsc_NAME,
)

pkg = import('pkgconfig')
pkg.generate(
  libraries: libsc_NAME,
  subdirs: 'include',
  version: meson.project_version(),
  name: 'libsc-NAME',
  filebase: 'sc-NAME',
  description: 'DESCRIPTION',
)

# For each public header in "include/":
#install_headers('include/YOURHEADER.h', subdir : 'sc-NAME')