Hey, Dan I have watched this video like 3 times yet not able to understand a sin...

Tabish Raza Answered 4 answers
Question by Tabish Raza 2 years ago

Question

Hey, Dan I have watched this video like 3 times yet not able to understand a single thing from this video... I don't know why but it feels like you should re-take this video and take a little time to explain what you are actually doing... As you said earlier I learned makefile, learned about header in c, and function pointer... Yet things are totally going over me... Please can you take time to explain things going on in this video?

Answers

Answered by Daniel McCarthy

Instructor

Hi Tabish,
I understand your frustration as building a compiler is not easy however stick with it and all will be fine. I wont be retaking the video as its correct. Please let me know what you had problems with so I can further assist you. What exactly did you struggle with

Thanks
Dan

Follow-up by Tabish Raza

Question author

Yes, your video is absolutely correct I agree... I was just suggesting that it would be better if you could explain a little bit more what you are doing in your videos...

Anyways, First thing I would like to understand is Makefile... I have read and understand basic of it but the what OBJECT variable is doing doesn't make sense to me and even INCLUDE variable

Apart from that I understand that "all" and "clean" is target but what does
"./build/compiler.o: ./compiler.c
gcc ./compiler.c ${INCLUDES} -o ./build/compiler.o -g -c"
this do?

Thanks
Tabish

Answered by Daniel McCarthy

Instructor

I do understand the reason it is not covered is because your expected to come to the course understanding those things as compiler development is a very advanced topic so your expected to be proficient before starting the course which is why I suggested for you to research more on C and makefiles.

The command you pointed out to me states a rule called ./build/compiler.o this rule states that compiler.c is the source file and should compile into ./build/compiler.o. By specifying it in the OBJECT variable and requireing it in the "all" label it will ensure compiler.o is compiled and it requires compiler.o to exist before the all label can continue. That is what the makefile is it basically defines rules on how a project should be compiled. This learning is essential and cant be rushed please go back and take your time and soon enough you will meet the requiements and be able to continue the course. Here is additional information for learning makefiles: https://makefiletutorial.com/

I have a course on C programming as well on this website which you can purchase if you choose. Additionally I have a course on assembly language as well all can be found at my teacher profile: https://dragonzap.com/teacher/daniel-mccarthy

Answered by Daniel McCarthy

Instructor

These things cannot be covered in this particular course as this course is a compiler development course. Makefiles are more suited to a course tailored to learning C. I do actually teach them in my C programming course as well found at my teaching profile