Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

build: separate configuration and rules #698

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

a) it's a good thing to separate these
b) one can do this:

# cat libuv-config.mk
include config-common.mk

%:
    @echo $($@)
# make -I import/johndoe/libuv -f libuv-config.mk LDFLAGS

would it be of interest to add actual libuv-config.mk from above?

Contributor

bnoordhuis commented Jan 29, 2013

I'm afraid I landed a couple of commits just now that conflict with your PR.

make -I import/johndoe/libuv -f libuv-config.mk LDFLAGS

When / why would you want to do that? I'm not sure I follow.

That's basically kind of intending to serve the same purpose as libfoo-config --ldflags --cflags does, however the original reason for digging into this was to fix an issue where on Darwin I have had to pass -framework CoreServices in order to compile my code with uv.a.
It actually looks like that was an issue in v0.8 and it's not in master 😄

@bnoordhuis it's fine by me if you wish to reject this as b was a slightly odd use case, and I'm not too strong on a after all ...

So as of master (at least) one shouldn't be able to compile with cc myprog.c libuv/uv.a, right?

I'm taking it back, I still have to pass -framework CoreServices.

So the point b of this PR still stands strong.

The idea of doing it this way is quite simple:

  1. one needs to build something that uses libuv
  2. the only tools at had is make (no cmake, gyp or anything of that kind)
  3. no code should be replicated from libuv makefiles, as it's hard to maintain

I have only tried this on Darwin, but I suspect all the other platform-specific LDFLAGS will get on the way and I'd need to copy quite few lines from config-unix.mk & config-mingw.mk. And this PR solves the problem upstream with just splitting makefiles and no effective change of build process.

Contributor

bnoordhuis commented Jul 25, 2013

Closing, this PR no longer applies after the switch to autotools. Thanks though.

@bnoordhuis bnoordhuis closed this Jul 25, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment