Announcing 'build', Auto-Configuration In 1000 Lines Of Makefile (github.com)
Christophe de Dinechin created the XL programming language -- and as descubes he's also Slashdot reader #35,093. Today he shares his latest project, a simple makefile-based build system that he's split from ELFE/XL:
Most open-source projects use tools such as autoconf and automake. For C and C++ projects, build is a make-based alternative that offers auto-configuration, build logs, colorization, testing and install targets, in about 1000 lines of makefile. A sample makefile looks like this:
BUILD=./
SOURCES=hello.cpp
PRODUCTS=hello.exe
CONFIG= <stdio.h> <iostream> clearenv libm
TESTS=product
include $(BUILD)rules.mk
Multiple versions locally that don't conflict (so .deb doesn't cut it), control over C++ ABI and build type, transitive dependency closure, the works. Work on that, not another damn build system!
I always wondered why we used that ugly collection of bash, perl and duct tape known as configure, autoconf, automake.
There have many make based systems in the past. but AFAIK, none of them had really tried to obsolete configure.
I'll stick to using Ant for my Python projects.
I have a similar make based build system called MakeXS. It's used in the Austria C++ project. It has similar features but my plan was to migrate away from make. Now that Google has released bazel I'm thinking of migrating to it instead.
I found SCons about 10 years ago and use it daily. I only use make when I'm on a project that is already using it. Much easier than make and free threading. Because SCons is implemented in python you can do more than make, IMHO.
the "[COMPILE X/Y] z.cpp" could count up on a single line insted of a new line for each file.
Why do we care? What makes it any better than that 50 other make alternatives? Is this a sponsored post?
"Descubes"?
Reminds me of this: https://github.com/openbsd/src/tree/master/share/mk
Which has been around in BSD for ages.
Cmake is pretty simpler and powerful, and works for the major OSs.
If makefile simplicity *and* portability are your goals, look no further.
The reason people keep reinventing build systems is because there are so many disparate languages and builds. Within a limited set of projects it is usually very easy to use a simple make based build. But when people start expecting one solution to solve all project builds, with simplicity at the same time, you end up with the current state of affairs. Lots of solutions promising a miracle, but generally never delivering.
Complexity generally arises as a result of historical accumulation and erroneous thinking. The world if full of this. Ironically, nearly every new miraculous solution to a complex problem simply compounds rather than solves the problem.
It looks like BSD Makefiles (sample below)... or just like automake's Makefile.am
WARNS=6
PROG= sed
SRCS= compile.c main.c misc.c process.c
I'm slashdot user #15,884 and my make-based autoconfiguration system is at least 3x as long. I could really learn from this guy.
CMake is easy too.
just use cmake.
I'm afraid XKCD described this problem of competing build systems very well, years ago.
https://xkcd.com/927/
My bazel BUILD file:
,
cc_binary(
name = "HttpEchoServer",
srcs = ["src/HttpEchoServer.cpp"]
+glob(["src/common/**/*.cpp"])
includes = [],
copts = ["-g","-std=c++1z","-I/usr/include/mysql++","-I/usr/include/mysql","-Isrc","-Isrc/common"],
linkopts = ["-L/usr/local/lib",
"-lcairo","-lcryptopp","-lpq",
"-lPocoCrypto","-lPocoFoundation","-lPocoJSON","-lPocoNet","-lPocoNetSSL","-lPocoUtil",
"-lboost_date_time","-lboost_unit_test_framework","-lboost_random","-lboost_system","-lgtest",
"-lproxygenhttpserver","-lfolly","-lglog","-lgflags","-lpthread"],
)
For what it is worth, which is nothing. Coding has never landed me a job no matter what I do.
The tech industry can suck the rancid shit out of my old bitter asshole. Fuck you all to hell, you fucking motherfuckers.
You should try writing decent code, and maybe working on your people skills.
It is nice of you to warn potential employers off though.
It looks _more_ complicated than cmake to achieve anything useful with this tool, and it lacks the proper dependency management. Also, I don't want to use make at all. It minimally needs to work with ninja and msbuild instead. I don't really understand what problem this tool is trying to solve.
BSD based Unix systems have this for along time.
Both in the base system, and for 3rd party software.
Base system example:
http://cvsweb.netbsd.org/bsdwe...
Then again, there's not much need for "autoconf"-like system environment detection there. The actual build system is also in a lot of Makefile snippets in the share/mk directory:
http://cvsweb.netbsd.org/bsdwe...
For 3rd party software that's build from a make-based system, see http://www.pkgsrc.org/
... is NOT another build system.
Most other reinventions of the build system wheel suck in various ways, so I don't think it's totally wrong to try reinventing it again. However, attaching a GPL license to your new wheel seriously limits your chance of success. autoconf is very deeply entrenched with the people who view GPL as a feature. IMHO, your best chance of finding users lies among the people who view GPL as a bug, but you're excluded them. Good luck with that.