-
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
WIP: Makefile: Initialise Makefile #11
base: master
Are you sure you want to change the base?
Conversation
Looks a good start. No worries if you don't know the proper way. We only learn by doing and most importantly, by making mistakes. That is totally acceptable. But there should be progress at the end of the day :) |
This commit does - Initialise makefile and uses targets to be made - Separate variables for source files, directories and common compiler
This commit does: - When make print-VARIABLE - It returns the VARIABLE = the_value_of_the_variable
Makefile
Outdated
dir: | ||
if [ ! -d "$(TARGET_DIR)" ]; then \ | ||
mkdir -p $(TARGET_DIR); \ | ||
fi | ||
|
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.
Currently looks like a patchy work while redundantly using dir variable everywhere. Can we by default make dir the bin folder is created every time the make command is run no matter what binary we want to prepare?
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 am not getting it, do you know how to? I read in stackoverflow, thats how I did the patchy work.
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 check you do to see if that particular directory is there or not and to create the directory, can't it be written such a way that those particular set of code executes even if 'make dir' is not provided?
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.
can't it be written such a way that those particular set of code executes even if 'make dir' is not provided?
Well the the dir is made even if we give make player
and not make dir
everytime because I put dir as a prerequisite to every other target file in all the rules. I agree it is patchy and redundant putting dir everywhere as a prerequisite, but I haven't come across a better solution. I will need to dig more on that then, but if you know please let me know :)
This commit does - Adds a rule clean which will remove the output directory
$(shell mkdir -p $(TARGET_DIR)) | ||
|
||
.PHONY: all | ||
|
||
all: player tcp_player tcp_server transcoder |
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.
Better than this would be to check if the target_dir is present or not in all
. If it is not present create one and move forward. If it is present move forward.
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.
Well I quite didn't understand you, did you mean putting target_dir as a pre requisite for all
and add the mkdir
as a recipe for the all
. If that's what you meant, make player
won't create the directory.
fixes #1 and #7.
Making it WIP because I don't know if it is the perfect way to do things :P