-
Notifications
You must be signed in to change notification settings - Fork 383
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
[doc] Revise howto #3222
[doc] Revise howto #3222
Conversation
@@ -0,0 +1,34 @@ | |||
project_root_dir := $(strip $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))) |
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.
Try to simplify this Makefile based on this Makefile: https://github.com/Ericsson/codechecker/blob/master/web/tests/projects/cpp/Makefile
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.
To start a make process from other directory is allowed. This line prevents accidentally deletions in this case by clean target.
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.
This Makefile is really complex and it contains a lot of unnecessary things. This is just a test project, so please keep it as simple as possible.
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.
This file is not subject of the howto document. It only works and nice.
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.
This is the subject of this patch. Later if someone wants to modify this file it will be hard to understand it, because it is very complex. So I still recommend to simplify this. The whole Makefile can look like this:
CFLAGS = -Iincl
all:
$(CC) $(CFLAGS) -c src/divide.c -o /dev/null
$(CC) $(CFLAGS) -c src/main.c -o /dev/null
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.
This is marked as resolved but it is not resolved yet. Please do not mark comment as resolved untill it is trully resolved or give me a reason why it is not resolved.
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.
I agree with @csordasmarton to simplify the makefile to the simple suggested one. At the end of the day it is only consists of 3 trivial files.
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.
-
As you mentioned: "Later if someone wants to modify this file...". Why would somebody want to change the makefile? Because it changed the hierarchy of this "project". Your suggestion requires makefile modification too if some file is added or removed. Mine is resistant for that.
-
In the howto document sometimes we clean the project and re-make it. Clean feature is not supported by your suggested solution.
Our purpose with that howto is to inspire users to play with it. There are some other issues in these C sources. If the user tries to repair them then he should re-make the project. But your suggested solution will not make if the user changes the divide.h file.
- The make can be called not only from that directory where the makefile resides. For example:
cd && make -f docs/examples/Makefile
should work. But your suggested makefile will not.
I think I have explained the requirements that were in my mind while creating that makefile.
I think if these requirements are valid then the "simplified" makefile will be at least comlex as mine is.
So, please specify your requirements against the makefile. And I will simplify it following them.
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.
With my solution there will be no generated files (output is redirected to /dev/null) so there is no need for clean target.
You don't have to step into the directory where the Makefile can be found, you can use the -C
option of the make command for it if you would like to:
$ make -C docs/examples/
make: Entering directory '~/codechecker/docs/examples'
cc -Iincl -c src/divide.c -o /dev/null
cc -Iincl -c src/main.c -o /dev/null
make: Leaving directory '~/codechecker/docs/examples'
I still not recommend this complex Makefile for this simple example project but I will not block this PR. So on my side I finished the review of this patch.
@zomen2 When you create a commit the window where you type the commit message will describe the recommended commit format. Please use the recommended format for commits. You can find the commit format also in our repository: https://github.com/Ericsson/codechecker/blob/master/.gitmessage. Also add some description to the commit, what do you do in your patch. |
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.
Please try to keep everything as simple as possible and do not complicate things.
@@ -0,0 +1,34 @@ | |||
project_root_dir := $(strip $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))) |
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.
This Makefile is really complex and it contains a lot of unnecessary things. This is just a test project, so please keep it as simple as possible.
Howto follow modifications happened on command line user interface.
Howto follow modifications happened on command line user interface.
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.
Some typos and some suggested extensions
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.
please look ateh the simplified c example
Howto follow modifications happened on command line user interface.
Howto follow modifications happened on command line user interface.
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.
One import thing is to not use the --enable-all
option for the CodeChecker analyze/check commands because it is not recommended. It will generate to much noise/reports. So please remove this option from this documentation too. Enable specific checkers with the --enable option.
@@ -0,0 +1,34 @@ | |||
project_root_dir := $(strip $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))) |
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.
This is the subject of this patch. Later if someone wants to modify this file it will be hard to understand it, because it is very complex. So I still recommend to simplify this. The whole Makefile can look like this:
CFLAGS = -Iincl
all:
$(CC) $(CFLAGS) -c src/divide.c -o /dev/null
$(CC) $(CFLAGS) -c src/main.c -o /dev/null
Howto follow modifications happened on command line user interface.
Howto follow modifications happened on command line user interface.
Howto follow modifications happened on command line user interface.
@@ -0,0 +1,34 @@ | |||
project_root_dir := $(strip $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))) |
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.
This is marked as resolved but it is not resolved yet. Please do not mark comment as resolved untill it is trully resolved or give me a reason why it is not resolved.
Howto follow modifications happened on command line user interface.
No description provided.