Hacker News new | ask | show | jobs
by bgongfu 2951 days ago
I hear you; I'm not overly excited with CMake either, or the C build system story in general.

I spent several years trying to bend regular make into something I was happy with; then I spent several years on top of that using Rake, since at least it allowed me to say what I mean in a sane language. Compared to Rake, CMake is at least semi-standard, provides some kind of macro for most things I want to do, and mostly stays out of my way.

But you definitely have a point when it comes to simplicity and project fit. If someone would be willing to step up and help translate the makefile into something that doesn't look horrible, I'd be more than happy to let it go. Otherwise we'll have to wait until I get enough round tuits, which could take a while given how much remains to be done in Cixl.

1 comments

Often it is disheartening to bend make to your bidding. But cixl has a neatly arranged tree and the makefile to build it is trivial. The following lines suffice (and by running 'make test -j' you compile everything in parallel and run all the tests) :

    CFLAGS   = -Isrc -O2
    LDLIBS   = -ldl -lm

    SRC      = $(shell ls src/cixl/*.c src/cixl/lib/*.c)
    OBJ      = $(SRC:%.c=%.o)

    src/main : src/main.o $(OBJ)

    clean    : ; $(RM) $(OBJ) src/main

    test: src/main ; for i in tests/*; do ./src/main<$$i; done

would you accept such a patch in your project?
Not bad; my make-fu was never that spectacular to begin with and it hasn't been aging well, this helps me a lot.

Sure thing, if you feel like giving the entire makefile the same treatment I'd be delighted to accept it.

Thanks for taking the time!