Earlier quoted context omitted.
Trying to do anything non-trivial in GNU make macros is the most bewilderingly awful programming experience it is possible to have. They are horribly broken in every respect, from little stuff like awful syntax (whitespace is insignificant except where it's significant!) and poor error checking (detecting undefined variables? Who cares?) to the really big stuff (can't do arithmetic, despite having core functions whic…
I don't know, Make is difficult because we are used to think in procedures and not in rules; and the rule and macro syntax is a bit weird; it takes time to master it. i have a makefile/make system that uses gnu make macros; (here http://mosermichael.github.io/cstuff/all/projects/2011/06/17... . ) this saves you from repeating the same make constructs many times over, in the following example you do a static library a…
Autotools Mythbuster
81–88 of 88 posts
Re: Autotools Mythbuster
#82Re: Autotools Mythbuster
#83I confess that I don't even know how to write a makefile, but reading the comments here, should I understand that cmake is better than autotools? Or should I learn autotools instead of cmake? Since cmake is more adopted, isn't cmake better ?
Re: Autotools Mythbuster
#84Earlier quoted context omitted.
I don't know, Make is difficult because we are used to think in procedures and not in rules; and the rule and macro syntax is a bit weird; it takes time to master it. i have a makefile/make system that uses gnu make macros; (here http://mosermichael.github.io/cstuff/all/projects/2011/06/17... . ) this saves you from repeating the same make constructs many times over, in the following example you do a static library a…
Your link is wrong and returns 404. Even https://mosermichael.github.io/ returns 404. Can you prove the correct link?
http://mosermichael.github.io/cstuff/
http://mosermichael.github.io/cstuff/all/projects/2011/06/17...
Re: Autotools Mythbuster
#85Earlier quoted context omitted.
If you write make files to build everything in twice, release and debug, you're doing it wrong. The proper way to do this is to write make files so you can do "out-of-tree" builds, i.e. your build directory is outside your source directory and each build directory has its own configuration. This has the significant advantage that you can not just build 2 or 3 or however many different configurations you would think i…
Sorry, I don't follow. I am doing out-of-tree builds? The problem is that there is no way to generate multiple files from one rule. If you write: $(OBJDIR)/foo.o: src/foo.c ...you get one rule, which will build one object file. If you want to generate two object files with two different settings, you have to have two rules. $(OBJDIR1)/foo.o: src/foo.c $(OBJDIR2)/foo.o: src/foo.c There is no way round this. Target-spe…
An example is C++, where often standard libraries don't allow mixing debug and release code.
Re: Autotools Mythbuster
#86Earlier quoted context omitted.
If you write make files to build everything in twice, release and debug, you're doing it wrong. The proper way to do this is to write make files so you can do "out-of-tree" builds, i.e. your build directory is outside your source directory and each build directory has its own configuration. This has the significant advantage that you can not just build 2 or 3 or however many different configurations you would think i…
Sorry, I don't follow. I am doing out-of-tree builds? The problem is that there is no way to generate multiple files from one rule. If you write: $(OBJDIR)/foo.o: src/foo.c ...you get one rule, which will build one object file. If you want to generate two object files with two different settings, you have to have two rules. $(OBJDIR1)/foo.o: src/foo.c $(OBJDIR2)/foo.o: src/foo.c There is no way round this. Target-spe…
This is what I mean, more or less. Your build directory contains a generated configuration state (generated by GNU autoconf, for example), and a wrapper Makefile that reads the configuration and builds everything (maybe by invoking a "real" Makefile in the source directory if you're lucky, maybe by having a bunch of ugly Makefiles generated in the build directory too, as GNU automake does).
And (provided you avoid automake) I don't find it horrible at all.
Re: Autotools Mythbuster
#87Earlier quoted context omitted.
Your link is wrong and returns 404. Even https://mosermichael.github.io/ returns 404. Can you prove the correct link?
Thanks here is the correct link (can no longer edit the parent post). http://mosermichael.github.io/cstuff/ http://mosermichael.github.io/cstuff/all/projects/2011/06/17...
Re: Autotools Mythbuster
#88Please please please do not use ./configure aka autohell. Study the Makefiles in http://git.suckless.org/ Straightforward & fast.
Autotools solves the problem of having to write a makefile for every platform and also provides all the expected targets without having to write them all yourself.