7 ms·
Or just switch to Meson+Ninja [1][2] and enjoy all features of modern build systems. [1] https://mesonbuild.com/ https://mesonbuild.com/ [2] https://ninja-bui
by xvilka 8y ago
Or just switch to Meson+Ninja [1][2] and enjoy all features of modern build systems.
[1] https://mesonbuild.com/ https://mesonbuild.com/
[2] https://ninja-build.org/ https://ninja-build.org/
- dig1 8y agoBefore mesom/ninja, you had one problem - install gmake. Now you have three problems - install python, ninja and meson ;) Maybe fourth - learn how to use it
- jcelerier 8y ago> Before mesom/ninja, you had one problem - install gmake. No, you had as many problems as there are '%' and '$' symbols in this web page : http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ multiplied by the number of permutations of tools in the different platforms you want to support, e.g. (gcc-mingw-windows, clang-cl-windows, msvc-windows (this one counts as 10), xcode-macos, gcc-macos). And let's not even get started with cross-compiling.
- enriquto 8y agoIn what sense isn't gnu make a modern build system?
- jplayer01 8y agoUsability.
- enriquto 8y agoI find gnu make very usable and very clear on its purpose. Sometimes I have used cmake and it was uglier, more complicated, and harder to understand. What would you suggest as a modern, usable build system?
- jcelerier 8y ago> Sometimes I have used cmake and it was uglier, more complicated, and harder to understand. okay, please provide a makefile which: * detects if, say, libpng is available * compile a library, an executable and a unit test if that's the case * links the executable to the library and the library to libpng * does so for mac, windows, linux, creates a .app for mac, an installer for windows, a .deb package for linux * can be used from IDEs, with IDEs understanding where your code has to be fetched, what the includes are, etc here's more-or-less the CMake version : project(myapp) find_package(PNG REQUIRED) add_library(mylib lib.c) add_executable(myapp MACOS_BUNDLE WIN32 app.c) target_link_libraries(mylib PRIVATE PNG::PNG) target_link_libraries(myapp PRIVATE mylib) install( TARGETS myapp mylib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib) include(CPack) you can't seriously say that this (which covers an immense part of software project needs) is easier to do in make, right ?
- enriquto 8y ago> * detects if, say, libpng is available You just compile with -lpng. If libpng is available, it will work, otherwise it will fail with a clear error message. What else do you need? > * links the executable to the library and the library to libpng LDLIBS = -lpng BIN = foo bar baz OBJ = lib1.o lib2.o lib3.o LIB = libmine.a default : $(BIN) $(LIB) $(BIN) : $(OBJ) $(LIB) : $(LIB)($(OBJ)) clean : ; $(RM) $(BIN) $(LIB) $(OBJ) check : $(BIN) ; ./foo -test This will compile the code from lib*.c into libmine.a, and then compile the source code of a few test executables from foo.c, bar.c and baz.c The .a is useless often, but there you have it just in case. Otherwise, just remove all references to $(LIB) and get a shorter makefile. > you can't seriously say that this (which covers an immense part of software project needs) is easier to do in make, right ? This is rather subjective. In my case the makefile seems easier. It will work for all unices, but probably not for windows, and will not create an "app" package, your are right about that. But the makefile covers indeed all my personal needs, and it is much more powerful and easier to use than the cmake/make combo. For example, you can test multiple compilers and compiler options with a shell loop: # test all compilers in debug and release modes for i in gcc clang tcc icc; do for m in "-O3 -DNDEBUG" "-g"; do make clean check CC=$i CFLAGS=$m done done doing that in cmake would be a nightmare, wouldn't it?
- chrisseaton 8y agoFor example it checks the last modified time on all your files, every build. This doesn’t scale at a certain point. More modern build systems have better ways of doing this.
- hhmc 8y agoHow to modern build systems check for file updates?
- Nzen 8y agoI can't speak for other build systems, but tup [0] provides the option to listen for filechanges via the fuse library. [0] http://gittup.org/tup/make_vs_tup.html http://gittup.org/tup/make_vs_tup.html <edit substitutes the make comparison link instead of the main page>
- Orphis 8y agoMake is a much of a build system as C++ as you can call stat() and system() from it. A modern build system by default should be able to provide utilities to make sure your build is correct and reproducible. Those features need to be coded into your Makefile and aren't available easily or by default. If you need to code those rules, then you don't have a build system, just a way to run commands and possibly add some (usually poor) logic around them. A typical example that most handcrafted Makefiles will fail is that changing a build flag should only rebuild the files affected. Most will either require a full clean (aka ignoring the flag change) or rebuild everything.
- enriquto 8y ago> A typical example that most handcrafted Makefiles will fail is that changing a build flag should only rebuild the files affected. If you change a build flag, how aren't all the files affected?
- hpcjoe 8y agoI've noticed a plethora of build options over the past decades. I keep hearing how they are all "better" than make. Then to build one particular bit of software, there is a dependency upon a particular version of cmake, which you don't have. Or you have to upgrade Maven. Or install some software you do not have by default on your environment. I've never had to do that with make. I've been told that other tools are better because the are simpler ... that is ... until you run into one of those aforementioned compatibility issues with the build tool. This isn't an infrequent occurrence for me, I see lots of hardwiring for various packages that I don't have installed by default in some projects. Then you get the gophers/rust folk, and their need to run on the most recently released kit. With all its undiscovered bugs. The gophers want to replace make with mage ... well, to be more correct, they want to replace every non-go based tool with one built in go, because ... go. A modern version of the insufferable pythonistas of years past. Throughout this, I've been using and building with Make just fine. My make files do the heavy lifting in my projects. And I get a good laugh each time I hear "oh I have to fix my magefile/CMakeFile.txt/yadda yadda yadda". As the great philosopher Inigo Montoya once opined ... you keep using that word [better]. I do not think it means what you think it means.
- shlomifish 8y agoFor my projects which are written in C or C++, I use cmake which can generate BSD makefiles among other targets. For some other projects (websites/etc.) I use gmake directly because they are not related to C. Since some of my makefiles (e.g: https://github.com/shlomif/shlomi-fish-homepage/blob/master/lib/make/main.mak https://github.com/shlomif/shlomi-fish-homepage/blob/master/... ) have become quite large, I've started looking for better build systems - see my current research at https://www.shlomifish.org/open-source/resources/software-tools/#build https://www.shlomifish.org/open-source/resources/software-to... . I tried using meson for https://github.com/shlomif/mini-factor https://github.com/shlomif/mini-factor , and while it worked fine locally it turned out to require python 3.6 which made it hard to install on Travis-CI. I ended up created a complementary cmake build system.
- MaxBarraclough 8y agoEver tried Premake?
- xvilka 8y agoLong time ago, I thought it is not that actively maintained as before.
- ridiculous_fish 8y agoMeson and Ninja cannot handle "C, Perl 5, Python, Ruby, GNU Bash, XML, CMake, XSLT, XHTML5, XHTML1.1, Website META Language, JavaScript and more." One of make's great strengths is that it is so generic.
- deleted 8y ago[deleted]
- cdoxsey 8y agoNinja is generic and minimalist. You can use it for anything that can be defined as a command with inputs and outputs. Writing ninja files by hand is tedious and those extra features make provides can make it easier to use, but in principle ninja should be able to handle anything make could. It also works in windows.
- imron 8y agoMeson is a joy to use.