-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New features for Makefile 🐧 #57
Conversation
The `build-docs` is the new `make` rule that would creates and generates the JMatrix's Java documentation (javadoc). Note: Generated docs will be saved in "docs/jmatrix/" directory.
This new file for now on and later will stores the usage information of JMatrix's `Make`. Also by using this method, it can reduces time to generate or print the usage information rather than using `@echo` in `Make`. Note: JMatrix `Make` is using bash as command shell, for Windows please consider to install Git Bash before using it.
This refactor only change its method to prints the usage information, and does not change its original behavior (which prints the usage about JMatrix's `Make`).
This reverts commit 214c20b.
This script processes command-line arguments and searches for a specific argument in the list, then outputs the index of the desired argument. Usage: bash get_argument.sh [OPTIONS] ARGUMENTS bash get_argument.sh [-s ARG | -v] ARGUMENTS
This changes make the `build-docs` rule to be standalone rule, which means it does not needs and ignores other rules, otherwise raises an error. This refactor would make the `FLAGS` options does not conflicting with other rule that also uses `FLAGS` to add some either additional options or flags (e.g `compile`). Thus, with refactoring the `build-docs` rule to make it a standalone rule, it should makes code more easier to maintain on next patch.
And also remove the `-quiet` flag, it can be added again with... $ make build-docs FLAGS="-quiet" ...asign the `-quiet` flag to `FLAGS` as Make arguments.
This changes make the `build-docs` support some options such as: - FLAGS - VERBOSE Usage: $ make build-docs [options] ... $ make build-docs [VERBOSE[=<bool>] | FLAGS[=<flags>]] Please note, the `build-docs` rule does not supported multiple rules, due to conflict between compiler's flags (`javac`) and `javadoc`'s flags. The following code will get an error: $ make build-docs compile package $ make compile package build-docs $ make build-docs clean
Makefile
Outdated
$(if $(shell [ ! -f $(DOCS_PATH)makefile-usage.txt ] && echo 1),\ | ||
$(error $(PREFIX) File "$(DOCS_PATH)makefile-usage.txt" is missing)\ | ||
) | ||
@cat $(DOCS_PATH)makefile-usage.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The usage instructions and list of available rules and options has been moved to makefile-usage.txt
.
And here, the only way to print the usage instructions it uses cat
command (Unix built-in).
This also improve the flexibility and reduce the code.
Now the `clean` rule will also clean the temporary directory (`tmp/`).
This change fixed the temporary directory is get generated even the verbose mode is deactivated (off).
|
||
# Only create temporary directory if the | ||
# verbose activated | ||
mkdir -p `dirname $tmpfile` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now this code is inside of case
block and only create the temporary directory if one of arguments activating the verbose mode (e.g -v
or --verbose
).
Please note, this function below doesn't echoing the info message directly onto standard output, instead it writes the info message to log file named Lines 44 to 47 in 51ba40e
|
Now the ` clean` rule will include the `docs/jmatrix/` directory during cleaning the working directory and clean it recursively. And this change also refactored the code, for now on before clean the specific directory such as `tmp/` or `docs/jmatrix/` it will checks whether the directory is exist, and cleans the directory only if exist.
This rule would cleans the generated docs recursively. Note: This only clean the gemerated HTML pages of JMatrix's javadocs recursively and does not clean other working directories. Consider use the `clean` rule to clean the working directories thoroughly.
This change fixed the issue when both `FLAGS` and `VERBOSE` options get defined at the same time, the `FLAGS`'s value will get changed by `VERBOSE`. For example: $ make build-docs VERBOSE=all FLAGS="-quiet" This will not trigger the `javadoc` to use the given FLAGS, instead it will uses flags that given by `VERBOSE`, which is `-verbose`.
For more details, see 6a39b4d.
This reverts commit ba4e744.
- Fixed unexpected behavior When user assign value "false" to VERBOSE option and invoke the `build-docs` rule, the `build-docs` would override the verbose mode NORMAL instead QUIET (no verbose). - Added comments on each `ifeq` statements.
Forgot to make it as a "not" statement. It should `ifneq`, not `ifeq`.
Now several rules has supported using
Usage: $ make [rules] VERBOSE[=<bool>]
$ make [clean | cleanbin | cleandocs] VERBOSE[=<bool>] |
Both files contain the same contents but in `makefile-usage.txcc` file, it has several texts with color coded, whereas in the other one is the original contents with no color coded. The extension `.txcc` chosen, it because `txcc` is stands for "text color coded".
This make the `all` rule to checks whether the current shell environment to execute the Make is Bash or else (like Powershell). If the current shell is Bash, then displays the contents from `makefile-usage.txcc` file which is the color coded version, otherwise the another one.
What's Changed
build-docs
, that builds and generates the HTML pages of JMatrix's javadocs automatically.makefile-usage.txt
that would stores all of usage instructions and the list of availableMake
's options.all
rule and moved all usage instructions tomakefile-usage.txt
file.build-docs
rule to be a standalone rule that ignores other rules.build-docs
rule now supports several options.Summary
These changes introduce new functionality and improvements to the build process and documentation. The
build-docs
rule allows for easy generation of JMatrix's javadocs in HTML format. The addition of themakefile-usage.txt
file centralizes the usage instructions and available options. These changes enhance the functionality and flexibility of the Makefile for building and documenting the project.