That's it. I'm learning how makefiles work, today.
49 comments
@bd yeah that's the goal! Thanks for the notes :) I'll send it over for review once I've got something I'm proud of. @neauoire Apropos of nothing: I think if you take away the parts that are due to unfortunate backward-compat/bug-compat with versions of the program written in 1972, make actually has a very powerful and useful underlying model! Awhile back I attempted to make a clone of make that used python snippets for the "shell language" instead of shell snippets and had some promising results with it. @neauoire I remember that hard tabs are either forbidden or mandatory (but can't remember which) @akkartik curiosity, also my build shell scripts are bordering absolute madness. I'd like people to clone, make run, make clean, etc.. Not have to dissect my shell script to figure out my naming conventions @neauoire Only one person has ever written a makefile. The rest of us have just been endlessly copying it ever since. @neauoire interesting how many people are opposed to make in this thread. definitely smells like distaste born of generated makefiles (autotools, cmake) and makefiles that try to be too clever with magic calls. make at it's core provides a very simple yet very powerful mechanism of dependency based shell execution, which alone makes it very easy to reason about and write 'recipes' for any common tasks (not just builds) you want to do in a project without reinventing half of it in shell. @evolbug I'm not deterred, my use of it will be pretty basic. I just want folks to be able to make run in the repo, and have a uxn build. I'm very frustrated that I can't figure out how to make makefiles do very simple things. This is beyond me, who the hell came up with this madness @neauoire like most unix things, it was created as a simple hack to solve an immediate problem and accidentally started getting used by other people. as a result it is a thing that was definitely not designed to be used by people for doing things the original creator has acknowledged that if he knew that would happen, he would have made it not suck so much @zens haha, that explains so much. Yeah, I thought I could somehow simplify it for people by using make, I think I might just stick with shell scripts a while longer afterall @neauoire while i have been able to get makefiles to work before i sympathize. it's a needlessly annoying format with some frustrating limitations @neauoire The exceptionally shitty thing about Make is that there are SO many variants that extend the original make program written by Feldman in incompatible ways. Feldman wrote a paper in '78 on how his original make works. Knowing that you like portability, this is probably the make variant you want to target: http://ewald.cas.usf.edu/teaching/2004F/5156/packet/packet2.docs/05.make.pdf @neauoire You're very welcome. I've been in your position before ("what subset of make is the safest to target?"), so I know where to look for info :D! You can actually get somewhat far w/ 1978 make. I miss the lack of include files (to put user-settings in w/o checking it into version control), but I'm sure you'll manage :D! If it's helpful, here's the guide I generally use: https://cs.colby.edu/maxwell/courses/tutorials/maketutor/ It starts out with a very basic example and then complicates it step by step. I guess so that people can follow it to their desired level of complication. 🙃 I made my first makefile. Thanks for the help everyone! @zens yes! It's not totally finished but it does the thing I need @akkartik when he's shouting with his hands up in the burning rubbles of the orphanage? @neauoire You could probably make a ".tal.rom" suffix rule, though I don't know how much it would help (also they've sort-of been superceded in GNU make). @neauoire yeah I can never remember the syntax for anything, which is what I made my standard makefile that I copy and adapt between projects. I wanted to have all my build outputs be on a separate folder and to avoid as much unnecessary rebuilding as possible. The former is not straightforward to do at all. @neauoire The nonsense with the hard tabs is particularly annoying. people yelled at python for years about its significant whitespace, but grandfathered in make... https://web.archive.org/web/20030916203331/http://aegis.sourceforge.net/auug97.pdf |
@neauoire nice! I will be happy if we switch the build.sh to a Makefile on uxn :P
I have some notes here if you wanna take a look: https://badd10de.dev/notes/makefiles.html