makefiles-forever/README.md

114 lines
3.6 KiB
Markdown
Raw Normal View History

2024-01-05 22:08:25 +00:00
<!--
# SPDX-License-Identifier: LGPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 Glenn Y. Rolland <glenux@glenux.net>
# Copyright © 2023 Glenn Y. Rolland <glenux@glenux.net>
-->
[![Build Status](https://cicd.apps.glenux.net/api/badges/glenux/makefiles-forever/status.svg)](https://cicd.apps.glenux.net/glenux/makefiles-forever)
![License LGPL3.0-or-later](https://img.shields.io/badge/license-LGPL3.0--or--later-blue.svg)
[![Donate on patreon](https://img.shields.io/badge/patreon-donate-orange.svg)](https://patreon.com/glenux)
> :information_source: This project is available on our self-hosted server and
> on CodeBerg and GitHub as mirrors. For the latest updates and comprehensive
> version of our project, please visit our primary repository at:
> <https://code.apps.glenux.net/glenux/makefiles-forever>.
2021-07-14 22:43:29 +00:00
# Makefiles Forever
2021-07-14 22:38:16 +00:00
2021-07-14 22:43:29 +00:00
A drop-in collection of makefiles libraries for your projects
2021-07-14 22:38:16 +00:00
## Description
* plantuml.mk — Automate the building [plantuml](https://plantuml.com/) diagrams.
2024-01-05 22:08:25 +00:00
* graphviz.mk — Streamline the creation of [graphviz](https://graphviz.org/) graph diagrams.
* mocodo.mk — Facilitate the development of [mocodo](http://mocodo.wingi.net/) entity-relation and logical diagrams.
* mypaint.mk - Automate the conversion of [mypaint](https://mypaint.app/) openraster images to usual image formats.
2021-07-14 22:38:16 +00:00
## Usage
2024-01-05 22:08:25 +00:00
### Adding to your project
To include 'Makefiles Forever' in your project, add this repository as a GIT
submodule:
2021-07-23 13:46:18 +00:00
```shell-session
$ git submodule add https://github.com/glenux/makefiles-forever .makefiles
```
2024-01-05 22:08:25 +00:00
### Configuring your makefiles
In your project's makefile, include the necessary modules. __The `include` instructions must be located
2024-01-05 22:38:44 +00:00
after your existing targets__.
2021-07-23 13:46:18 +00:00
```makefile
# [...variable definitions...]
2024-01-05 22:08:25 +00:00
# Include as many Makefiles Forever features as your want
include .makefiles/plantuml.mk
include .makefiles/mocodo.mk
# [...include as many modules as you want...]
2021-07-23 13:46:18 +00:00
# [...targets definitions...]
2021-07-23 13:46:18 +00:00
```
Declare API variables (ex: `*_SRC_DIR`, `*_DEST_DIR`) for each module
```makefile
2024-01-05 22:08:25 +00:00
# PlantUML Configuration
PLANTUML_SRC_DIR=/path/to/plantuml/files
PLANTUML_DEST_DIR=/path/to/output/directory
2021-07-23 13:46:18 +00:00
2024-01-05 22:08:25 +00:00
# Mocodo Configuration
MOCODO_SRC_DIR=/path/to/mocodo/files
MOCODO_DEST_DIR=/path/to/output/directory
# [...you the external variables of the modules you included...]
2024-01-05 22:08:25 +00:00
# [ ... etc ...]
2021-07-23 13:46:18 +00:00
```
2024-01-05 22:08:25 +00:00
Use pre-defined targets in your build process, as dependencies of your existing
targets:
2021-07-23 13:46:18 +00:00
```makefile
2024-01-05 22:08:25 +00:00
build: plantuml-build mocodo-build graphviz-build
clean: plantuml-clean mocodo-clean graphviz-clean
2021-07-23 13:46:18 +00:00
```
Feature files usually define more targets than just build and clean, and you
can use those too!
2024-01-05 22:08:25 +00:00
## Best practices used in our .mk modules
* Parallel Execution: We ensure targets are available from the root makefile and avoid descending into subdirectories for parallel execution.
* Modular Design: We keep our makefiles modular for easy maintenance and scalability.
* Documentation: We comment our makefiles for clarity and ease of use by others.
## Contributing
Contributions are what make the open-source community such an amazing place to
learn, inspire, and create. Any contributions you make are **greatly
appreciated**.
## Troubleshooting and Support
If you encounter any issues or need support, please open an issue in
[the project's issue tracker](https://code.apps.glenux.net/glenux/makefiles-forever/issues).
We strive to be responsive and helpful.
## License
Distributed under the LGPL-3.0-or-later License. See `LICENSE` file for more
information.
## Acknowledgments
2021-07-14 22:38:16 +00:00
2024-01-05 22:08:25 +00:00
* A special thanks to all contributors and users of this project for their
valuable feedback and support.
2021-07-14 22:38:16 +00:00