makefile basics (beginner - intermediate) anthony explains

  Рет қаралды 28,120

anthonywritescode

anthonywritescode

2 жыл бұрын

today I go over the basics of makefiles, how to use them as a build system, and what `.PHONY` is.
playlist: • anthony explains
==========
twitch: / anthonywritescode
dicsord: / discord
twitter: / codewithanthony
github: github.com/aso...
stream github: github.com/ant...
I won't ask for subscriptions / likes / comments in videos but it really helps the channel. If you have any suggestions or things you'd like to see please comment below!

Пікірлер: 34
@uuu12343
@uuu12343 2 жыл бұрын
...that explanation of PHONY was better than the docs and stackoverflow explanations combined Thanks for the talk!
@Karlux92
@Karlux92 Жыл бұрын
One of the best Makefile tutorials out there, thank you very much Anthony!
@dorb1337
@dorb1337 2 жыл бұрын
To be honest, I didn't have the chance till now to learn C programming, and this video sent me to learn what are .h and .o files. So I learnt so much more then just about the 'make' command :) thank you! Hope to join you and the rest of the cool guys in the C programming very soon.
@sadhlife
@sadhlife 2 жыл бұрын
C is my favourite footgun
@martiananomaly
@martiananomaly 2 жыл бұрын
Nice Hybrid Theory pfp
@raoulkent
@raoulkent 2 жыл бұрын
Thank you Anthony! This video really helped me with understanding makefiles much better. It's a great addition for anyone just getting into Makefiles, a good addition in video format to the myriad of tutorials out there. A big thank you!
@TahaAlars
@TahaAlars 10 ай бұрын
Best video about makefile, thank you
@trido3815
@trido3815 8 ай бұрын
Thanks Anthony. You make it so easy to follow.
@unikkkkkkk
@unikkkkkkk Жыл бұрын
very short but precise & among most helpful Makefile tutorials. Thanks
@serge8175
@serge8175 Жыл бұрын
Amazing breakdown of the Makefile! Thanks Anthony!
@a_maxed_out_handle_of_30_chars
@a_maxed_out_handle_of_30_chars 7 ай бұрын
this was awesome, thank you :)
@yugandhar2007
@yugandhar2007 Жыл бұрын
Thanks a lot!! That really helps to understand PHONY
@AbishaiSingh
@AbishaiSingh Жыл бұрын
This is a great tutorial l, especially using advanced symbols in make.
@jiminma50
@jiminma50 Жыл бұрын
Thanks for this concise tutorial. I just wanted a simple Makefile whilst I played with C++. You made all the black magic understandable. =)
@zeljkokojic4831
@zeljkokojic4831 2 жыл бұрын
Thank you Anthony!
@morenoh149
@morenoh149 Жыл бұрын
I'd love to see a makefile that is designed for django/docker projects.
@anthonywritescode
@anthonywritescode Жыл бұрын
I wouldn't use a makefile for that -- I would write specific scripts / build tools do what I need. as I show here a makefile can be (ab)used as a script runner but that's not the point of make
@KraziAzian
@KraziAzian 2 жыл бұрын
These are also great for reproducible data science, great tutorial!
@thesun___
@thesun___ 10 ай бұрын
Why didn't you mention the wildcard function for automatic detection of source files?
@anthonywritescode
@anthonywritescode 9 ай бұрын
because that's a bit beyond "basics" -- you have to get into addprefix and substitution and notdir and the rest of the functions
@thesun___
@thesun___ 9 ай бұрын
​@@anthonywritescode It is a little bit of an intermediate feature, yes. But, for a basic Makefile, it is absolutely necessary for you to be able to automatically detect your source files. Who wants to have to write down every single source file on their creation?
@guntbert9709
@guntbert9709 2 жыл бұрын
Neat trick to use tail instead of cat to get the file names too - why do you use tail instead of head?
@anthonywritescode
@anthonywritescode 2 жыл бұрын
no real reason -- just habit!
@johnwt7333
@johnwt7333 Жыл бұрын
Easier to press t than h
@kristofferbakkejord165
@kristofferbakkejord165 2 жыл бұрын
I've seen Makefile being used in Python projects where basically all the targets are phony. I've come to prefer having a scripts directory, and using bash (or python) for tasks that may be repeated (docker build, run dev db, purge dev db etc.). It offers a bit more flexibility on handling inputs.
@anthonywritescode
@anthonywritescode 2 жыл бұрын
for sure! this actually came up because of a code review I did on stream where every make target was `PHONY` and I explained "well this isn't really what make is for!"
@Caarve
@Caarve 2 жыл бұрын
I think the reason you see this is because Makefiles and make provide a very easy and intuitive way to perform automation. Writing bash scripts or other things make sense and, as Kristoffer said, the scripts are more flexible for handling input, but if you just need to a simple CLI to interface for building, deploying, and testing your application or infrastructure, make comes in clutch imo.
@voytechj
@voytechj 2 жыл бұрын
Hi, I wrote a comment and it was deleted. Just wonder if youtube algorithm did that, or you decide to remove it?
@anthonywritescode
@anthonywritescode 2 жыл бұрын
youtube is very aggressive with the comment filter and there doesn't seem to be much I can do about it :( -- I've heard if you're subscribed it's more likely to not filter but I'm not sure
@voytechj
@voytechj 2 жыл бұрын
@@anthonywritescode Thanks for replay, I wish that was you ;). Now I am start thinking that maybe there is some Makefile conspiracy theory that youtube is trying to hide. I was posting not long ago about makefile in different channels few times and they are all gone 😲. Anyway, I guess this is not last video about make, but I think you forgot include header file as prerequisite, so after modification it wont trigger a building process.
@anthonywritescode
@anthonywritescode 2 жыл бұрын
ah yep totally missed the header file -- the first version I did was just a single .c file and I goofed in this take :P
@Carlos-kd7tu
@Carlos-kd7tu 2 жыл бұрын
con tanta pluma no entendí nada
@fabtjar
@fabtjar Жыл бұрын
Great video. Shouldn't main.o also rely on lib.h?
@anthonywritescode
@anthonywritescode Жыл бұрын
yeah probably
CMake vs Make - A Real Life Comparison (With Actual Code)
12:16
Kea Sigma Delta
Рет қаралды 1,7 М.
🩷🩵VS👿
00:38
ISSEI / いっせい
Рет қаралды 12 МЛН
لااا! هذه البرتقالة مزعجة جدًا #قصير
00:15
One More Arabic
Рет қаралды 51 МЛН
小丑把天使丢游泳池里#short #angel #clown
00:15
Super Beauty team
Рет қаралды 39 МЛН
C Programming: Makefiles
44:21
Barry Brown
Рет қаралды 259 М.
py-spy saved our python 3.11 rollout (intermediate) anthony explains #568
13:48
Using Makefile in Python with a Virtual Environment
12:05
Earthly
Рет қаралды 9 М.
Quick Intro to Makefiles
17:05
MyGeekAdventures
Рет қаралды 19 М.
typing the untype-able with mypy plugins (advanced) anthony explains #574
25:06
Makefiles, but in English
55:45
801Labs
Рет қаралды 28 М.
why do header files even exist?
10:53
Low Level Learning
Рет қаралды 390 М.
adding test == others fail??? (intermediate) anthony explains #572
10:40
anthonywritescode
Рет қаралды 4,1 М.
Samsung vs Iphone
0:21
Takadori1
Рет қаралды 17 МЛН
ПС 110/10. Кто то подключил "левак" 110000 вольт!?
0:34
Советы электрика
Рет қаралды 1,1 МЛН
ПОЧЕМУ МИКРОФОНЫ ИГРОВЫЕ? 🧐
0:46
KEKTAR
Рет қаралды 496 М.
Samsung Galaxy S24 Ultra Vs Iphone 15 Pro Max
0:56
Roanet Tech
Рет қаралды 7 МЛН