-
Notifications
You must be signed in to change notification settings - Fork 24
Makefile: add file with basic targets #74
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| #!/usr/bin/env make -f | ||
|
|
||
| ### global variables section | ||
|
|
||
| # static vars | ||
| BUILD_DIR:="build" | ||
| BUILD_BIN:="$(BUILD_DIR)/tools/blisp/blisp" | ||
|
|
||
| # dynamic vars | ||
| FILES_CMAKE:=$(shell find . -path ./$(BUILD_DIR) -prune -false -o -type f -name '*.cmake' -o -type f -name 'CMakeLists.txt') | ||
| FILES_SRC:=$(shell find . -path ./$(BUILD_DIR) -prune -false -o -type f -name '*.c' -o -type f -name '*.h') | ||
|
|
||
| ### main targets section | ||
|
|
||
| # simplify build | ||
| build: $(FILES_CMAKE) $(FILES_SRC) Makefile | ||
| @echo "\n>>>> Generating build files in: $(BUILD_DIR) ...\n" | ||
| @cmake -S . -B $(BUILD_DIR) -DBLISP_BUILD_CLI=ON | ||
| @echo "\n>>>> Building...\n" | ||
| @cmake --build $(BUILD_DIR) | ||
| @echo "\n>>>> DONE: $(BUILD_BIN)\n" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add this particular output (path for |
||
|
|
||
| # deleting output build directory with its content | ||
| clean: | ||
| -@rm -rf $(BUILD_DIR)/ | ||
|
|
||
| # printf-like debug target | ||
| vars: | ||
| @echo "\n>>>> FILES_CMAKE:" | ||
| @echo "$(FILES_CMAKE)" | sed 's, ,\n,g' | ||
| @echo "\n>>>> FILES_SRC:" | ||
| @echo "$(FILES_SRC)" | sed 's, ,\n,g' | ||
|
Comment on lines
+28
to
+32
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good ol' |
||
|
|
||
| .PHONY: clean vars | ||
|
|
||
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.
Partially snooped from
IronOS/source/Makefile, partially based on readingman findand experimenting locally to make sure that everything works as it should.