Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vulcalien/makefiles
Useful makefiles
https://github.com/vulcalien/makefiles
makefile
Last synced: 29 days ago
JSON representation
Useful makefiles
- Host: GitHub
- URL: https://github.com/vulcalien/makefiles
- Owner: Vulcalien
- License: cc0-1.0
- Created: 2021-04-29T22:00:42.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-10-09T14:37:00.000Z (3 months ago)
- Last Synced: 2024-10-16T12:28:47.804Z (3 months ago)
- Topics: makefile
- Language: Makefile
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# Makefiles
Various makefiles I've developed over the years: two makefiles for
building projects written in the C programming language and one for
generating man pages from AsciiDoc files.## C makefiles
The two makefiles for C projects are `library.mk` and `executable.mk`.
`library.mk` produces static and shared library files, while
`executable.mk` produces an executable file.These make targets are available:
| Command | Result | Library | Executable |
| ----------------- | ----------------------------- | :-: | :--------: |
| make | Build the program/library | x | x |
| make clean | Remove all build files | x | x |
| make run | Execute the program | | x |
| make build-static | Build only the static library | x | |
| make build-shared | Build only the shared library | x | |### Source subdirectories
Subdirectories of the top-level source directory containing code to be
compiled need to be listed in the `SRC_SUBDIRS` variable.For example, to compile files in `src`, `src/foo` and `src/foo/bar`
write the following:
```make
SRC_DIR := src
...
SRC_SUBDIRS := foo foo/bar
```### Cross-compilation
By passing the `TARGET=WINDOWS` argument to make, the makefiles will
produce output for Windows, provided that the appropriate cross-compiler
is installed.## Man pages makefile
The `manuals.mk` makefile converts AsciiDoc files into man pages.
Similarly to the C makefiles, it supports source subdirectories.## License
I release these makefiles under the [CC0 public domain
license](https://creativecommons.org/publicdomain/zero/1.0/).