|
|
| damn these make files |
|
IronBob
Member #3,248
February 2003
|
ive never liked make files. my first experience was installing allegro. i think matthew should remember that one. but now that everything is installed correctly im doing fine. took me a while but its all in place. i got allegro (of course), allegrogl (for when i start to learn 3d), audlib (to load sound files as SAMPLE's that are 1/4 of the size of a wave file yet still have the same quality), and libnet (for networking). |
|
damage
Member #3,438
April 2003
|
Hmmm, I'm late to this thread, but I'll just say that I agree with Korval. Unix is full of these one-use-only utilities that are too powerful for their own good. It's a better idea just to spend your (valuable) time learning a general purpose scripting language. Don't learn Perl unless you like writing obfuscated code. Learn Python; it's the way of the future. ____ |
|
kazzmir
Member #1,786
December 2001
|
I dont know what this thread is about anymore cuase ive only read the first 50 or so posts, but id just like to say Makefiles are incredibly simple. They are nothing more than variable declarations and dependency checks. Here is a makefile with as complex structure as you will ever see. CODE = file.o PROGRAM = game ${PROGRAM}: ${CODE} gcc ${CODE} -o ${PROGRAM} CODE is a variable. PROGRAM is a variable. The only usefull line in there is the dependecy check which says, "If ${CODE} exists, then do whatever the next line for ${PROGRAM} is.". These concepts arent very hard and anyone who can understand the C language can certainly understand makefiles. That being said, Makefiles become insanely complex when you add all sorts of bash command line stuff to it. That and if you dont understand the command line arguements to gcc itself then you probably wont understand the garbage written in most makefiles. Those are two different things, however, so people should stop complaining about makefiles and start complaining about gcc and bash. |
|
Bruce Perry
Member #270
April 2000
|
Quote: Here is a makefile with as complex structure as you will ever see. You forgot to account for how GNU Make deals with Makefiles that include files they generate, the difference between variables assigned with := and =, how special targets like .PHONY work, how functions can be called and defined, when variables are evaluated ... -- |
|
23yrold3yrold
Member #1,134
March 2001
|
Actually, Ben, I think I might be able to learn from that (I didn't know rules could have multiple commands like that). You want a scary makefile, Allegro's is still the king -- |
|
Bruce Perry
Member #270
April 2000
|
Quote: "If ${CODE} exists, then do whatever the next line for ${PROGRAM} is." It's actually more like, "If ${PROGRAM} doesn't exist, or is older than ${CODE}, then first make sure ${CODE} exists (build it if possible) and then execute the following commands which are designed to (re)build ${PROGRAM} from ${CODE}." Another thing that makes Makefiles so unapproachable to newcomers is that within the rule, $@ can replace ${PROGRAM} above and $^ or $< can replace ${CODE}. There are lots of such 'automatic variables'. -- |
|
kazzmir
Member #1,786
December 2001
|
Ok, i did a bad job explaining how makefiles work. I didnt know there was a difference between := and =, i just thought it was syntactical sugar to make pascal and C people happy Besides, the things you have mentioned dont make makefiles that much more complicated. Its definately not as hard to read a makefile as it is to read someones undocumented code even if cleanly written. |
|
CGamesPlay
Member #2,559
July 2002
|
I did all of my development on VC++ 5.0 until about 6 months ago. Then I made the big leap and put Linux on my computer. I know all about VC++, and make, and it took me about a week to pick up on makefiles. Now I use autoconf, which I am still learning, but it allows me to automatically generate makefiles for multiple projects at once, and automatically configures it for use with various add-ons (flex and bison, mainly). I think makefiles could be better, and I would definately try out a C-like makefile language, but in the meantime, I'm quite happy with it. Also, I, since getting a cross-compiler, can produce my win32 binaries without even using windows! For demonstration purposes, my makefile.am (which generates Makefile) and configure.in (which writes a configure script):
Very simple, then I run one command "autoreconfigure" and everything is ready to be UNIX-style installed... I haven't tried using that makefile on windows, but I can change the LDADD flags to "-lalleg" and run: [edit] -- Ryan Patterson - <http://cgamesplay.com/> |
|
IronBob
Member #3,248
February 2003
|
hey what about this. we dont use make files at all and use visual installers. everyone with me now, YAAAAYYYY NO MORE MAKE FILES!!! wooohoo. just open an exe and it compiles and places it in the right spot. |
|
Bruce Perry
Member #270
April 2000
|
Enjoy running your visual installer every time you make a minor change in your project, IronBob. -- |
|
IronBob
Member #3,248
February 2003
|
or how about you just change the files that are already installed. |
|
Bruce Perry
Member #270
April 2000
|
Last time I looked, it was possible to download diff files for Allegro. Happy? Anyway you misunderstood. I'm talking about the minor changes you would make if you were working on Allegro itself. Enjoy running your visual installer every time you make such a change. With the Makefile, you can make a minor change and then type 'make', and it will recompile just the bits you've changed. -- |
|
IronBob
Member #3,248
February 2003
|
you dont do that. you do a visual installer for a major version. not one tiny little change. you make a whole bunch of tiny changes and you put it in a patch. then if you get a whole bunch of major changes then you make a new version and put out a visual installer. you dont make a new visual installer for each little patch. you just replace the files with new ones. for yourself if your changing it you wouldnt need to use a make file, just compile it inside your project. |
|
Bruce Perry
Member #270
April 2000
|
Better yet: use Makefiles (or MSVC project files if you like). They enable you to recompile just the stuff that changes, and they serve as the major part of the installation when you decide to release your project. Less work. And since you're not paying the developers, even that is more than you can expect. There was a time when I actually wrote software for me. I never released anything. I didn't know what the Internet was. Those were the days -- |
|
IronBob
Member #3,248
February 2003
|
you can automatically compile only the things that change anyway. and you totaly dont realize what i just said. make files are nothing compared to a visual installer. if you are going to use a make file atleast have something slightly visual to do it for the people that arent as computer perfect. its so damn annoying to spend 3 hours just to get one darn thing to compile and installed. and atleast people can tell you what you need before you install if not GIVE IT TO YOU. so that way you dont have to spend forever looking for some remote thing that was made in the early 90's and never heard of again. that person just had it laying around and decided since no one else was using it they would. then theyll give out their stuff without that one essential component and give a crappy readme that might give you a broken link on where to find it. just include everything needed and only whats needed. it doesnt matter if your one file is big to download. they user will have to download everything else some other place anyway. its just so annoying to spend a whole damn day getting a few things working. |
|
Mars
Member #971
February 2001
|
Quote: you can automatically compile only the things that change anyway. That's what makefiles are meant to do. You don't seem to understand the complexity of dependencies projects can reach. If makefiles aren't used then other means are employed that do the same thing, e.g. the project managment of an ide. -- |
|
Bruce Perry
Member #270
April 2000
|
IronBob, you'd spend longer if you had to write that stuff from scratch. -- |
|
Thomas Fjellstrom
Member #476
June 2000
|
Quote: Don't learn Perl unless you like writing obfuscated code. Learn Python; it's the way of the future. BLASPHEME!!!!! The cleanliness of the code is ONLY dependant on the person writing it. Personally, Python isn't a good option unless you like being told what you can and can't do, ALL the time. IronBob: If you can't figure out "make && make install" you shouldn't be a programmer. -- |
|
23yrold3yrold
Member #1,134
March 2001
|
Quote: The cleanliness of the code is ONLY dependant on the person writing it. Not the person designing it? -- |
|
Thomas Fjellstrom
Member #476
June 2000
|
I don;t know about you, but IF someone hands me a crappy design, I do my best to clean it up -- |
|
Evert
Member #794
November 2000
|
Quote: Unix is full of these one-use-only utilities that are too powerful for their own good. It's a better idea just to spend your (valuable) time learning a general purpose scripting language.
Have you ever actually needed any of that power (for scientific work, for instance)? I doubt it, because if you had, you wouldn't be so quick to dismiss those utilities. Quote: make files are nothing compared to a visual installer. Yes they are. They're platform independent. They also work from a dumb terminal and work without further user intervention. Quote: and atleast people can tell you what you need before you install if not GIVE IT TO YOU Poor documentation has nothing whatsoever to do with makefiles. Quote: just include everything needed and only whats needed.
You really want everyone here who release their sourcecode to include the source to Allegro? Wow. Quote: it doesnt matter if your one file is big to download. they user will have to download everything else some other place anyway. It does matter if you're on dialup and pay by the minute. If I need to download a lot of extra stuff, I'll take a box of floppies with me to university. Then there's always the chance that I in fact already have what I need, in which case I'm going to be very annoyed if I spend ten minutes downloading something I already have (again, I pay by the minute). |
|
Bruce Perry
Member #270
April 2000
|
Referring to Makefiles, Evert said: They're platform independent. I only wish that were true. It takes some work to get a Makefile to work on multiple Unix variants. For instance, BeOS puts include files in boot/develop/headers and libraries in boot/develop/lib/x86. It takes even more work to get a Makefile to work on Windows too, or even to work on all Windows systems (with no consideration for Unix) ... The autotools cover the Unix variants - but they are very ugly and unapproachable, and don't help with Windows at all. (This may be changing; MSYS claims to be able to make configure scripts work on Windows, but I haven't tried this.) -- |
|
Karadoc ~~
Member #2,749
September 2002
|
BP (about makefiles being platform independent) said: I only wish that were true. It takes some work to get a Makefile to work on multiple Unix variants. For instance, BeOS puts include files in boot/develop/headers and libraries in boot/develop/lib/x86. It takes even more work to get a Makefile to work on Windows too, or even to work on all Windows systems (with no consideration for Unix) ...
But that's not the makefile being platform dependant, it's just different OSs having their files in different places. ----------- |
|
Evert
Member #794
November 2000
|
Quote: I only wish that were true. It takes some work to get a Makefile to work on multiple Unix variants. For instance, BeOS puts include files in boot/develop/headers and libraries in /boot/develop/lib/x86/.
Shouldn't the install script cover that on *nix? I haven't ever had the need to use it yet, so I'm not sure here... |
|
IronBob
Member #3,248
February 2003
|
make and make install is no where near the only thing you have to do. i had to find unix tools, get help on how to change the make file from linux to windows, get pthreads, move and rename a bunch of make files, get some evtra thing libnet and then install it all. all of it took me about 3 hours. its ok to use a make file when you are editing the project yourself but when you put out a major version its just annoying. you know all of those "help installing allegro" threads (including mine). that would pretty much all be gone if you include all the files and a visual installer. and for those who want to change the make file just have the installer run the make file. that way others can use the make file if they want to and the computer noobs can use the visual installer. |
|
|
|