16 ms·
A Tutorial on Portable Makefiles
- erlehmann_ 9y agoAn issue I have with make is that it can not handle non-existence dependencies. DJB noted this in 2003 [1]. To quote myself on this [2]: > Especially when using C or C++, often target files depend on nonexistent files as well, meaning that a target file should be rebuilt when a previosly nonexistent file is created: If the preprocessor includes /usr/include/stdio.h because it could not find /usr/local/include/stdio.h, the creation of the latter file should trigger a rebuild. I did some research on the topic using the repository of the game Liberation Circuit [3] and my own redo implementation [4] … it turns out that a typical project in C or C++ has lots of non-existence dependencies. How do make users handle non-existence dependencies – except for always calling “make clean”? [1] http://cr.yp.to/redo/honest-nonfile.html http://cr.yp.to/redo/honest-nonfile.html [2] http://news.dieweltistgarnichtso.net/posts/redo-gcc-automatic-dependencies.html http://news.dieweltistgarnichtso.net/posts/redo-gcc-automati... [3] https://github.com/linleyh/liberation-circuit https://github.com/linleyh/liberation-circuit [4] http://news.dieweltistgarnichtso.net/bin/redo-sh.html http://news.dieweltistgarnichtso.net/bin/redo-sh.html (redo-dot gives a graph of dependencies and non-existence dependencies)
- Matheus28 9y agoI personally use scons instead of Makefiles. Its dependency analysis is amazing, I haven't seen it fail a single time.
- erlehmann_ 9y agoPlease elaborate: What do you find amazing about scons? Also, how does scons handle non-existence dependencies? What would be a scons dependency graph for this C code? #include<stdio.h> main() { printf("hello, world\n"); return 0; } You can see a dependency graph I generated with redo here: http://news.dieweltistgarnichtso.net/posts/redo-gcc-automatic-dependencies.html#dependency-graph-visualization http://news.dieweltistgarnichtso.net/posts/redo-gcc-automati...
- Matheus28 9y agoI love that I get to use python to write the dependency graph, it allows for some interesting stuff. Other than that, it's mostly the ease of use. This is enough to compile a C++ project (that has all its .c and .cpp files in the same directory as the SConstruct file), and it'll pick up on all dependencies correctly: Program(target = 'a.out', source = Glob('*.c') + Glob('*.cpp')) I also know for a fact that it's able to pick up on how the presence of a new file might trigger a rebuild of what could require it. Regarding the last question, using --tree=all it prints: +-. +-SConstruct +-a.out | +-main.o | | +-main.c | | +-/usr/bin/gcc | +-/usr/bin/gcc +-main.c +-main.o +-main.c +-/usr/bin/gcc I'm not sure if it's hiding dependencies on system headers or not. But I can force it to show them by adding /usr/include and /usr/local/include to CPPPATH (excuse the long code block): +-. +-SConstruct +-a.out | +-main.o | | +-main.c | | +-/usr/include/stdio.h | | +-/usr/include/Availability.h | | +-/usr/include/_types.h | | +-/usr/include/secure/_stdio.h | | +-/usr/include/sys/_types/_null.h | | +-/usr/include/sys/_types/_off_t.h | | +-/usr/include/sys/_types/_size_t.h | | +-/usr/include/sys/_types/_ssize_t.h | | +-/usr/include/sys/_types/_va_list.h | | +-/usr/include/sys/cdefs.h | | +-/usr/include/sys/stdio.h | | +-/usr/include/xlocale/_stdio.h | | +-/usr/include/AvailabilityInternal.h | | +-/usr/include/sys/_types.h | | +-/usr/include/secure/_common.h | | +-/usr/include/sys/_posix_availability.h | | +-/usr/include/sys/_symbol_aliasing.h | | +-/usr/include/machine/_types.h | | +-/usr/include/sys/_pthread/_pthread_types.h | | +-/usr/include/i386/_types.h | | +-/usr/bin/gcc | +-/usr/bin/gcc +-main.c +-main.o -- This part was removed to decrease comment size, it's the same as the main.o part above The SConstruct for this last block is: Program(target = 'a.out', source = ['main.c'], CPPPATH = ['/usr/local/include', '/usr/include']) Note that these were generated on macOS.
- JdeBP 9y agoFrom what you are showing us, the answer to How does scons handle non-existence dependencies? is that it does not handle them at all. Go and look at M. Moskopp's graph. It has a lot of dependencies for non-existent files that the compiler would have used in preference to the ones that it actually used, had they existed.
- bsder 9y agoDid scons finally get a little less opinionated? It used to be that scons really forced you to use subsidiary SConscript child files for anything more complicated than a couple files in a single directory instead of being able to lump it all into a single SConstruct.
- cjhanks 9y agoI think that was quite long ago. Yes, `SCons` can fit into a single file if you so choose. But its behavior under recursive builds (with nested directory structure) is far more predictable than most build systems I have seen.
- tedunangst 9y agoIs this a common problem? I can't think of any project that does this, and there's a simple solution as well: don't shadow system headers. That's just asking for pain, regardless of how well make handles it.
- deleted 9y ago[deleted]
- tomjakubowski 9y agoI don't think this problem is limited to system headers. Something as innocent as #include "foo/bar.h" can be affected by this if you pass -I with at least two unique paths to the compiler.
- tedunangst 9y agook, sure, I revise my answer to don't shadow any header.
- tomjakubowski 9y agoEasier said than done, especially integrating over the lifetime of a years-long project with many ever-changing dependencies :-)
- bch 9y agoI'm missing something. Are you saying you want to be able to compile either way /usr/include/stdio.h and /usr/local/include/stdio.h, but remember what the last compilation used and know what header would be used in the next compilation, and if it's different, mark the target as stale and perform the action? I guess you'd need to keep a log of the build and test cpp invocations for diffs. I've never run into this scenario.
- cjhanks 9y agoAn obvious case would be a developer supporting multiple versions of a 3rd party library.
- bch 9y agoThis is where I saw the beauty of including dependencies w a project. Even on my own systems, as environments change, things break, and having a stable in-tree reference had paid off. It's a tough situation, but I find myself leaning to @tedunangst position over the years - usually I try to adapt my machines (incl software) to my needs, but this case I need to take control/responsibility, and here be dragons. Does cmake actually solve this? Do other build systems?
- tinus_hn 9y agoMake has no memory so it can't remember things. It simply compares the dates of files. If a dependency is newer than a target the target is rebuilt. If you want to keep some kind of memory you have to build and keep track of it yourself. But the problem you point at is simply poor design. It is not a normal occurrence for system header files to move around like you state. If they do, a full rebuild is indeed required. It shouldn't so often that that is an issue.
- feelin_googley 9y ago"It simply compares the dates of files." test(1) also compares the dates of files test file1 -nt file2 test file1 -ot file2 Is there anything else that make does in addition to comparing dates of files? (Besides running the shell.) tsort(1) does topological sorting tsort + sed + sort + join + nm = lorder(1) lorder can determine interdependencies
- beagle3 9y agoIf an apt-get upgrade fixed an issue in a system header or a library, but the date of the fix predates the last build (quite common; last build from yesterday, fix from two days ago but downloaded today) then make will do nothing (or any subset of the right things but not all) and make clean; make will do the right thing. Relying on time stamps is a design decision that was good for its time, but it is no longer robust (or sane) an a constantly connected, constantly updated, everything networked world. djb redo takes it to one logical conclusion (use cryptographic hashes to verify freshness) There are other ways in which make is lacking: operations are non atomic (redo fixes that too), dependency granularity is file level (so dependency on compiler flags is very hard, dependency on makefile is too broad; redo fixes this too); dependency is manual (redo doesn't fix this; AFAIK the only one that properly does is tup)
- pm215 9y agoTypically if a system header has changed or been added due to upgrading a library package you'll need to rerun any configure script anyway (since it very likely checks for header features and those decisions will change). So unless your build system magically makes configure depend on every header file used in every configure test it runs, you'll need to redo a clean build anyway, pretty much. Make has a whole pile of issues, but this one really isn't an aggravation in practice, I find.
- boris 9y agoCould you summarize how you handle this in redo? Also what about the case where a header file does exist but is out-of-date and because of that triggers an error (e.g., version compatibility check with #error) -- how do you handle that?
- JdeBP 9y agoI, for one, handle it with a tool that mimics the compiler's preprocessing phase and emits both redo-ifchange information for all of the headers that are used, and redo-ifcreate information for all of the non-existent headers that are looked for during the process. JdeBP %cat test.cpp #include <cstddef> void f() {} JdeBP %/package/prog/cc/command/cpp test.cpp --iapplication . --icompiler-high /usr/local/lib/gcc5/include/c++ --icompiler-low /usr/local/lib/gcc5/include/c++/x86_64-portbld-freebsd10.3 --iplatform /usr/local/include --iplatform /usr/include -MD -MF /dev/stderr 2>&1 > /dev/null|fgrep redo redo-ifcreate ./cstddef ./bits/c++config.h /usr/local/lib/gcc5/include/c++/bits/c++config.h /usr/local/include/bits/c++config.h /usr/include/bits/c++config.h ./bits/os_defines.h /usr/local/lib/gcc5/include/c++/bits/os_defines.h /usr/local/include/bits/os_defines.h /usr/include/bits/os_defines.h ./bits/cpu_defines.h /usr/local/lib/gcc5/include/c++/bits/cpu_defines.h /usr/local/include/bits/cpu_defines.h /usr/include/bits/cpu_defines.h ./stddef.h /usr/local/lib/gcc5/include/c++/stddef.h /usr/local/include/stddef.h ./sys/cdefs.h /usr/local/lib/gcc5/include/c++/sys/cdefs.h /usr/local/include/sys/cdefs.h ./sys/_null.h /usr/local/lib/gcc5/include/c++/sys/_null.h /usr/local/include/sys/_null.h ./sys/_types.h /usr/local/lib/gcc5/include/c++/sys/_types.h /usr/local/include/sys/_types.h ./machine/_types.h /usr/local/lib/gcc5/include/c++/machine/_types.h /usr/local/include/machine/_types.h ./x86/_types.h /usr/local/lib/gcc5/include/c++/x86/_types.h /usr/local/include/x86/_types.h redo-ifchange /usr/local/lib/gcc5/include/c++/cstddef /usr/local/lib/gcc5/include/c++/x86_64-portbld-freebsd10.3/bits/c++config.h /usr/local/lib/gcc5/include/c++/x86_64-portbld-freebsd10.3/bits/os_defines.h /usr/local/lib/gcc5/include/c++/x86_64-portbld-freebsd10.3/bits/cpu_defines.h /usr/include/stddef.h /usr/include/sys/cdefs.h /usr/include/sys/_null.h /usr/include/sys/_types.h /usr/include/machine/_types.h /usr/include/x86/_types.h JdeBP %/package/prog/cc/command/cpp test.cpp --iapplication . --icompiler-high /usr/local/lib/gcc5/include/c++ --icompiler-low /usr/local/lib/gcc5/include/c++/x86_64-portbld-freebsd10.3 --iplatform /usr/local/include --iplatform /usr/include -MMD -MF /dev/stderr 2>&1 > /dev/null|fgrep redo redo-ifcreate ./cstddef ./bits/c++config.h ./bits/os_defines.h ./bits/cpu_defines.h ./stddef.h ./sys/cdefs.h ./sys/_null.h ./sys/_types.h ./machine/_types.h ./x86/_types.h redo-ifchange JdeBP % I also have a wrapper that takes arguments in the forms that one would invoke g++ -E and clang++ -E, tries to works out all of the platform and compiler include paths, and invokes this tool with them. It's then a simple matter of invoking these redo-ifchange and redo-ifcreate commands from within the redo script that is invoking the compiler. You can see this plumbed into redo in a real system in the source archives for the nosh toolset and djbwares. * http://jdebp.eu./FGA/introduction-to-redo.html#CompilerDeficiencies http://jdebp.eu./FGA/introduction-to-redo.html#CompilerDefic... * https://news.ycombinator.com/item?id=15044438 https://news.ycombinator.com/item?id=15044438
- kccqzy 9y agoNo one wants to manually do dependency management in even a moderately sized project. I really haven't found an ideal way to have these -MM -MT flags integrated into Makefiles; I've tried having an awk script automatically modify the Makefile as the build is happening, but of course the updated dependencies will only work for later builds, so it's only good for updating the dependencies. Any other approaches HNers used and really liked?
- erlehmann_ 9y agoThere exists DJB's redo approach [0], which i implemented [1], where dependencies and non-existence dependencies are only recorded after the build. A typical dofile is a shell script, so you do not need to learn another language. Targets also automatically depend on their own build rules (I have seen such a thing only in makefiles authored by DJB). I wrote a blog post to show how to integrate dependency output for both dependency and non-existence dependency generation [2]. The game “Liberation Circuit” can be built with my redo implementation; you can output a dependency graph usable with Graphviz [4] using “redo-dot”. There is only one other redo implementation that I would recommend, the one from Jonathan de Boyne Pollard [5], who rightly notices that compilers should output information about non-existence dependencies [6]. I would not recommend the redo implementation from Avery Pennarun [7], which is often referenced (and introduced me to the concept), mainly because it is not implemented well: It manages to be both larger and slower than my shell script implementation, yet the documentation says this about the sqlite dependency (classic case of premature optimization): > I don't think we can reach the performance we want with dependency/build/lock information stored in plain text files [0] http://cr.yp.to/redo.html http://cr.yp.to/redo.html [1] http://news.dieweltistgarnichtso.net/bin/redo-sh.html http://news.dieweltistgarnichtso.net/bin/redo-sh.html [2] http://news.dieweltistgarnichtso.net/posts/redo-gcc-automatic-dependencies.html http://news.dieweltistgarnichtso.net/posts/redo-gcc-automati... [3] https://github.com/linleyh/liberation-circuit https://github.com/linleyh/liberation-circuit [4] https://en.wikipedia.org/wiki/Graphviz https://en.wikipedia.org/wiki/Graphviz [5] http://jdebp.eu./Softwares/redo/ http://jdebp.eu./Softwares/redo/ [6] http://jdebp.eu./FGA/introduction-to-redo.html#CompilerDeficiencies http://jdebp.eu./FGA/introduction-to-redo.html#CompilerDefic... [7] https://github.com/apenwarr/redo https://github.com/apenwarr/redo
- 9y ago
- majewsky 9y agoWait... "%.o: %.c" is nonstandard?!?
- pavlov 9y agoYes, base Make is almost useless for anything larger than a utility.
- zbuf 9y agoNot quite; I think '.c.o' is the equivalent in the original Make syntax?
- majewsky 9y agoThat's nowhere near equivalent. For example, it cannot replace the following things: pkg/test/migrations/%.sql: pkg/db/migrations/%.sql build/%.cover.out: prepare-check FORCE (In the second one, $* is then used in the build rule, which is why % does not need to show up in the prerequisites list.) Examples from https://github.com/sapcc/limes/blob/62e07b430e2019a6c189144350bae34c574b2f55/Makefile https://github.com/sapcc/limes/blob/62e07b430e2019a6c1891443...
- tannhaeuser 9y agoAccording to the POSIX make manpage [1], the following double-suffix rule is part of the defaults: .c.o: $(CC) $(CFLAGS) -c $< [1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ma...
- 0x09 9y agoThe problem comes in as soon as you need conditionals, which is likely when attempting to build something portably. There may be some gymnastics that can be done to write around the lack of their presence in standard make, but otherwise your options are: - Supply multiple makefiles targeting different implementations - Bring in autotools in all its glory (at this point you are depending on an external GNU package anyway) - Or explicitly target GNU Make, which is the default make on Linux and macOS, is very commonly used on *BSD, and is almost certainly portable to every platform your software is going to be tested and run on. The downside being that BSD users need a heads up before typing "make" to build your software. But speaking as a former FreeBSD user, this is pretty easy to figure out after your first time seeing the flood of syntax errors.
- wahern 9y agoPOSIX Make supports conditionals, thanks to recursive macro expansion. And while POSIX doesn't yet support a macro construct to invoke and capture shell utilities, you can use both the GNU $(shell COMMAND) and Sun $(COMMAND:sh) syntax. All the BSDs and Solaris support the latter, and GNU Make the former. Both constructs are ignored with an empty string expansion where they're not supported, and no implementation supports both. To see what I'm talking about, see my proof of concept library that I've put together. https://github.com/wahern/autoguess/blob/config-guess/config.mk.guess https://github.com/wahern/autoguess/blob/config-guess/config...
- tedunangst 9y agoAnother possibility is conditional compilation at the C level. thefile.c #includes thefile_unix.c or thefile_windows.c as appropriate.
- caf 9y agoThat doesn't really help situations like "iconv is in libiconv on some systems, and is in libc on others" though.
- SingletonIface 9y ago> But speaking as a former FreeBSD user, this is pretty easy to figure out after your first time seeing the flood of syntax errors. I seem to be about the only person that makes use of the following feature, but FreeBSD and GNU make will in addition to looking for a file named Makefile, also look for BSDmakefile or GNUmakefile respectively. So when I write a makefile with GNU make specific contents, I name it GNUmakefile, and when I write one that is specific to FreeBSD make, I name it BSDmakefile. The user has to do absolutely nothing different; they simply write make and if their make is GNU make and my makefile is a GNUmakefile then it builds. Likewise with FreeBSD make and a file named BSDmakefile. The big win is when someone then has the wrong make. Instead of beginning to build and then failing at some point kicking and screaming, they will simply be told make: no target to make. make: stopped in (path) by FreeBSD make, or make: *** No targets specified and no makefile found. Stop. by GNU make. And at that point they will consult the README I have written for the project in question and they will learn that they need the other make than what they are using if they want to build this software.
- JepZ 9y agoIt's been a while since a I wrote a make file but as far as I remember it was very easy to create a full featured cmake file if the project used the layout which cmake assumed (easy for new projects). However, porting existing projects from traditional make files to cmake could be next to impossible.
- ainar-g 9y agoDoesn't cmake take care of most of this? Is there any reason not to use cmake on middle to large scale projects? I am genuinely curious. I've only recently started looking at cmake, and it seems like they should generate portable Makefiles, or at least have an option to generate them.
- pletnes 9y agoYes, including nmake (windows-compatible).
- to3m 9y agoYes it does, and no there isn't, in that order. CMake is pretty horrid in many respects - I won't deny that - but it gets a few key things right, and it has a good-size ecosystem. That's enough to make up for its notable deficiences.
- deleted 9y ago[deleted]
- deleted 9y ago[deleted]
- carussell 9y ago> Microsoft has an implementation of make called Nmake, which comes with Visual Studio. It’s nearly a POSIX-compatible make, but necessarily breaks [...] Windows also lacks a Bourne shell and the standard unix tools, so all of the commands will necessarily be different. What I've been mulling over is an implementation of make that accepts only a restricted subset of the make syntax, eliding the extensions found in either BSD and GNU make, and disallowing use of non-standard extensions to the commands themselves (and maybe even further restricted still). In theory, a make that does this wouldn't even need to depend on a POSIX environment—it could treat the recipes not as commands but instead as a language. It wouldn't even take much to bootstrap this; you could use something like BusyBox as your interpreter. Call it `bake`. Crucially, this is not another alternative to make: every bake script is a valid Makefile, which means it is make (albeit a restricted subset).
- noway421 9y agoThe naming is brilliant!
- chubot 9y agoI hope you're being sarcastic because there are already a half-dozen build tools called "bake"... it's literally the first name that everyone thinks of.
- _wmd 9y agoWhat you're mulling over is the precept for the autotools toolchain.. spare the next generation the same pain we bore :)
- deleted 9y ago[deleted]
- deleted 9y ago[deleted]
- carussell 9y agoAutotools is the opposite of what I'm suggesting. But maybe I'm missing some nuance in your comment. I think, though, that you may have read what I wrote, interpreted it as "new build tool", and immediately applied XKCD 927[1]. See my closing remarks in my last comment. 1. https://xkcd.com/927/ https://xkcd.com/927/
- git-pull 9y agoMore nifty portable Make facts: - For portable recursive make(1) calls, use $(MAKE). This has the added advantage of BSD systems which can electively install GNU Make as gmake being able to pass in the path to gmake to run GNU Makefiles [1] - BSD's don't include GNU Make in base system. BSD's port and build system uses Make extensively, and has a different dialect [2] - In addition to that, you will likely choose to invoke system commands in your Makefile. These also have the same GNU-specific features that won't work on BSD's. So keep your commands like find, ls, etc. POSIX-compliant [3] - Part of the reasons tools like CMake exist is to abstract not only library/header paths and compiler extensions, but also the fact POSIX shell scripting and Makefile's are quite limited. - Not only is there a necessity to use POSIX commands and POSIX compatible Make language, but the shell scripting must also not use Bash-isms and such, since there's no guarantee the system will have Bash. - POSIX Makefiles have no conditionals as of 2017. Here's a ticket from the issue tracker suggesting it in 2013: http://austingroupbugs.net/view.php?id=805 http://austingroupbugs.net/view.php?id=805. - You can do nifty tricks with portable Makefile's to get around limitations. For instance, major dialects can still use commands to grab piped information and put it into a variable. For instance, you may not have double globs across all systems, but you can use POSIX find(1) to store them in a variable: FILES= find . -type f -not -path '*/\.*' | grep -i '.*[.]go$$' 2> /dev/null Then access the variable: if command -v entr > /dev/null; then ${WATCH_FILES} | entr -c $(MAKE) test; else $(MAKE) test entr_warn; fi I cover this in detail in my book The Tao of tmux, available for free to read online. [4] - MacOS comes with Bash, and if I remember correctly, GNU Make comes with the developer CLI tools as make. - For file watching across platforms (including with respect for kqueue), I use entr(1) [5]. This can plop right into a Makefile. I use it to automatically rerun testsuites and rebuild docs/projeocts. For instance https://github.com/cihai/cihai/blob/cebc197/Makefile#L16 https://github.com/cihai/cihai/blob/cebc197/Makefile#L16 (feel free to copy/paste, it's permissively licensed). [1] https://www.gnu.org/software/make/manual/html_node/MAKE-Variable.html#MAKE-Variable https://www.gnu.org/software/make/manual/html_node/MAKE-Vari... [2] https://www.freebsd.org/cgi/man.cgi?query=make&apropos=0&sektion=1&manpath=FreeBSD+11.0-RELEASE+and+Ports&arch=default&format=html#end https://www.freebsd.org/cgi/man.cgi?query=make&apropos=0&sek... [3] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html http://pubs.opengroup.org/onlinepubs/9699919799/utilities/fi... [4] https://leanpub.com/the-tao-of-tmux/read#tips-and-tricks https://leanpub.com/the-tao-of-tmux/read#tips-and-tricks [5] http://entrproject.org http://entrproject.org
- cmm 9y agowhere, except for Windows, is requiring GNU Make a problem?
- flukus 9y agoI've heard BSD and mac both use much older, non-GPLv3 versions of make. Portability means supporting older versions too.
- eadmund 9y agoMy first step on a non-GNU system back when I had to use those was to install the GNU utilities and add them to the beginning of my PATH. I suppose if I had to support them primarily I'd have gone the portability route, but fortunately I was always worrying about them secondarily instead.
- plorkyeran 9y ago/usr/bin/make on macOS is GNU Make 3.81, which is fairly ancient (2006) but still a much more featureful target than POSIX make. Installing GNU make on BSDs is not difficult; for any project with a nonzero number of dependencies it's likely to be the most trivial one. If you're writing a C89-zero-non-posix-dependencies library then sure, you can't use GNU make, but you also probably only have a ten line makefile anyway.
- paulddraper 9y agoThat's the Ubuntu 14.04 version. Old, but make changes very little.
- int_19h 9y agoIt's not really a problem on Windows, to be honest. MSYS2 gives you that, gcc, and a bunch of POSIX utilities to boot. It also gives you packages for libraries, and a Unix-like filesystem structure where they are deployed (/usr etc). Yet you end up building clean Win32 binaries, with no emulation layers.
- brian-armstrong 9y agoHonestly, just use Cmake. It is far easier to make it work cross playform and better yet cross compile. There's no good reason to write a Makefile by hand and no large projects do it anyway
- chubot 9y agoHm you could argue the largest project did it that way... The Android platform used to be tens of thousands of GNU Make (including the GNU Make Standard Library). For 5+ years. I think they are migrating or have migrated to a custom system now. Also, the Linux kernel is pure GNU Make (no autotools, since that doesn't really make sense). But yes those are platforms/OSes and not applications. Applications typically work on multiple Unix flavors and Windows, so something like cmake makes sense. Although honestly it's a shame that they made the same mistake as GNU make -- not paying enough attention to the programming language design and ending up with a crappy macro language.
- cyphar 9y ago> Also, the Linux kernel is pure GNU Make (no autotools, since that doesn't really make sense). While that is true, they have a lot of wrappers and pseudo-meta-programming that makes it very simple to add a module to the kernel. It's unlike any other "pure GNU make" project I've seen.
- iainmerrick 9y agoThe Android platform used to be tens of thousands of GNU Make[files] Yes, and it was incredibly flaky and awkward to use! And slow. I think they are migrating or have migrated to a custom system now It used so many tricky macros that it already was a custom system, just one that happened to be built on top of Make.
- int_19h 9y agoCMake is rather crufty itself. There are many better options these days.
- 9y ago
- 123younas786 9y agohttps://www.youtube.com/watch?v=0DOqAaCpZe0 https://www.youtube.com/watch?v=0DOqAaCpZe0 https://www.youtube.com/watch?v=OtwnbIEziCw https://www.youtube.com/watch?v=OtwnbIEziCw https://www.youtube.com/watch?v=eQiOP_YRBhU https://www.youtube.com/watch?v=eQiOP_YRBhU https://www.youtube.com/watch?v=dG9lFZbCQrk https://www.youtube.com/watch?v=dG9lFZbCQrk https://www.youtube.com/watch?v=WJdMn_GBPzw https://www.youtube.com/watch?v=WJdMn_GBPzw https://www.youtube.com/watch?v=tA_KAoSmsXA https://www.youtube.com/watch?v=tA_KAoSmsXA https://www.youtube.com/watch?v=RMU0tuniZlc https://www.youtube.com/watch?v=RMU0tuniZlc https://www.youtube.com/watch?v=rb66n8r9KIc https://www.youtube.com/watch?v=rb66n8r9KIc https://www.youtube.com/watch?v=hd_-GkF-WGk https://www.youtube.com/watch?v=hd_-GkF-WGk https://www.youtube.com/watch?v=YM2DLSiHpQw https://www.youtube.com/watch?v=YM2DLSiHpQw https://www.youtube.com/watch?v=8P2EGpk1si8 https://www.youtube.com/watch?v=8P2EGpk1si8 https://www.youtube.com/watch?v=8Qjgg43fuR8 https://www.youtube.com/watch?v=8Qjgg43fuR8 https://www.youtube.com/watch?v=BR5yz8g9Wus https://www.youtube.com/watch?v=BR5yz8g9Wus https://www.youtube.com/watch?v=Fh6BDOh_Lx0 https://www.youtube.com/watch?v=Fh6BDOh_Lx0 https://www.youtube.com/watch?v=EKveadKP8BM https://www.youtube.com/watch?v=EKveadKP8BM https://www.youtube.com/watch?v=6hqLbLMIptE https://www.youtube.com/watch?v=6hqLbLMIptE https://www.youtube.com/watch?v=ZhMMG6HH74U https://www.youtube.com/watch?v=ZhMMG6HH74U https://www.youtube.com/watch?v=s35IjakF6kg https://www.youtube.com/watch?v=s35IjakF6kg https://www.youtube.com/watch?v=2YfehfQY_UM https://www.youtube.com/watch?v=2YfehfQY_UM https://www.youtube.com/watch?v=F_cTeIq1V8c https://www.youtube.com/watch?v=F_cTeIq1V8c https://www.youtube.com/watch?v=QgQskFLk1Z0 https://www.youtube.com/watch?v=QgQskFLk1Z0 https://www.youtube.com/watch?v=7fplPI_JNTI https://www.youtube.com/watch?v=7fplPI_JNTI
- 123younas786 9y agoWatch Hot Video https://www.youtube.com/watch?v=0DOqAaCpZe0 https://www.youtube.com/watch?v=0DOqAaCpZe0
- thetic 9y ago> The bad news is that inference rules are not compatible with out-of-source builds. You’ll need to repeat the same commands for each rule as if inference rules didn’t exist. This is tedious for large projects, so you may want to have some sort of “configure” script, even if hand-written, to generate all this for you. This is essentially what CMake is all about. That, plus dependency management. This isn't a case for CMake. It's a case against POSIX Make. The proposed "portability" and "robustness" of adherence to the POSIX standard are not worth hamstringing the tool. GNU Make is ubiquitous and is leaps and bounds ahead of pure Make.
- kayamon 9y agoI love that their definition of "portable" is software that runs exclusively on UNIX.
- adamstockdill 9y agotarget [target...]: [prerequisite...]
- c3d 9y agoThis article barely addresses what really causes trouble in practice, namely non-portable tools. Sed for example has different switches on macos and linux. MinGW is another world. Also check out https://github.com/c3d/build https://github.com/c3d/build for a way to deal with several of the issues the author addresses (but not posix portability)
- susam 9y agoWe invoke shell commands in a Makefile, and if we are concerned about POSIX conformance in the Makefile syntax, we need to be equally concerned about POSIX conformance in the shell commands and the shell scripts we invoke in Makefile. While I have not found a foolproof way to test for and prove POSIX conformance in shell scripts, I usually go through the POSIX.1-2001 documents to make sure I am limiting my code to features specified in POSIX. I test the scripts with bash, ksh, and zsh on Debian and Mac. Then I also test the scripts with dash, posh and yash on Debian. See https://github.com/susam/vimer/blob/master/Makefile https://github.com/susam/vimer/blob/master/Makefile for an example. Here are some resources: * POSIX.1-2001 (2004 edition home): http://pubs.opengroup.org/onlinepubs/009695399/ http://pubs.opengroup.org/onlinepubs/009695399/ * POSIX.1-2001 (Special Built-In Utilities): http://pubs.opengroup.org/onlinepubs/009695399/idx/sbi.html http://pubs.opengroup.org/onlinepubs/009695399/idx/sbi.html * POSIX.1-2001 (Utilities): http://pubs.opengroup.org/onlinepubs/009695399/idx/utilities.html http://pubs.opengroup.org/onlinepubs/009695399/idx/utilities... * POSIX.1-2008 (2016 edition home): http://pubs.opengroup.org/onlinepubs/9699919799/ http://pubs.opengroup.org/onlinepubs/9699919799/ * POSIX.1-2008 (Special Built-In Utilities): http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_14 http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3... * POSIX.1-2008 (Utilities): http://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html http://pubs.opengroup.org/onlinepubs/9699919799/idx/utilitie... The editions mentioned in parentheses are the editions available at the mentioned URLs at the time of posting this comment. Here is a list of the commands specified in POSIX: Special Built-In Utilities: break, colon, continue, dot, eval, exec, exit, export, readonly, return, set, shift, times, trap, unset Utilities: admin, alias, ar, asa, at, awk, basename, batch, bc, bg, c99, cal, cat, cd, cflow, chgrp, chmod, chown, cksum, cmp, comm, command, compress, cp, crontab, csplit, ctags, cut, cxref, date, dd, delta, df, diff, dirname, du, echo, ed, env, ex, expand, expr, false, fc, fg, file, find, fold, fort77, fuser, gencat, get, getconf, getopts, grep, hash, head, iconv, id, ipcrm, ipcs, jobs, join, kill, lex, link, ln, locale, localedef, logger, logname, lp, ls, m4, mailx, make, man, mesg, mkdir, mkfifo, more, mv, newgrp, nice, nl, nm, nohup, od, paste, patch, pathchk, pax, pr, printf, prs, ps, pwd, qalter, qdel, qhold, qmove, qmsg, qrerun, qrls, qselect, qsig, qstat, qsub, read, renice, rm, rmdel, rmdir, sact, sccs, sed, sh, sleep, sort, split, strings, strip, stty, tabs, tail, talk, tee, test, time, touch, tput, tr, true, tsort, tty, type, ulimit, umask, unalias, uname, uncompress, unexpand, unget, uniq, unlink, uucp, uudecode, uuencode, uustat, uux, val, vi, wait, wc, what, who, write, xargs, yacc, zcat
- sigjuice 9y agoI like Tom Duff's http://www.iq0.com/duffgram/com.html http://www.iq0.com/duffgram/com.html for experimental programs contained in a single file.
- harrywinks04 9y agoAre you desperately in need of a hacker in any area of your life??? then you can contact certifiedhacker04@gmail.com he will help you at affordable prices, i offer services like -hack into your cheating partner's phone(whatsapp,bbm.gmail,icloud,facebook and others) -Sales of Blank ATM cards. -hack into email accounts and trace email location -all social media accounts, -school database to clear or change grades, -Retrieval of lost file/documents -DUIs -company records and systems, -Bank accounts,Paypal accounts -Credit cards hacker -Credit score hack -Monitor any phone and email address -Websites hacking, pentesting. -IP addresses and people tracking. -Hacking courses and classes. my services are the best on the market and 100% security and discreet work is guaranteed.