Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide link information for make #3

Closed
lefessan opened this issue Mar 20, 2012 · 4 comments
Closed

provide link information for make #3

lefessan opened this issue Mar 20, 2012 · 4 comments

Comments

@lefessan
Copy link
Contributor

Since most packages can use make to build themselves, ocp-get should maintain a "Makefile.ocp-get" with one line per package:

extlib_DIR='directory where extlib has been installed'

Packages can use this information directly in their Makefiles.

This should be done before opam-config.

@samoht
Copy link
Member

samoht commented Mar 20, 2012

So you want the user to add an -include $(PATH)/Makefile.ocp-get at the top of her Makefile ? But how $(PATH) will be computed (it depends on the compiler version) ?

What's the difference of adding the line:

exlib_DIR=`ocp-get config -dir exlib` 

at the top of the Makefile ? IMHO the second solution is more flexible (ie. it can be embedded easily in an existing mycamlbuild.ml) and it is already possible to mimic the behavior with the current specs. So I don't see this issue as very urgent.

@lefessan
Copy link
Contributor Author

ocp-get could just copy a local copy of Makefile.ocp-get into the sources directory for each package. That sounds much easier to implement.

@samoht
Copy link
Member

samoht commented Mar 20, 2012

You're right.

But in case you are building a program, with your solution you have to manually build the list of transitive dependencies, ie. if extlib depends on foo and bar you will have to run:

$(OCAMLC)
  -I $(foo_DIR) $(foo_CMA)
  -I $(bar_DIR) $(bar_CMA)
  -I $(exlib_DIR) $(extlib_CMA)
  myprog.ml

This can become very cumbersome for projects having a lot of dependencies (and it will break each time someone adds a dependency to a project you depend on). How do you solve this ? ocamlfind has -r flag which computes automatically the right set, and ocp-get config should have that as well.

@samoht
Copy link
Member

samoht commented Apr 2, 2012

ocp-get config -I -r foo bar, ocp-get config -asmlink foo bar and ocp-get config -r -bytelink foo bar works now as expected. -r foo bar returns the transitive closure of config dependencies for packages foo and bar (it remove doublons).

-I -rstrict foo returns the strict transitive closure of config dependencies for package foo (ie without foo config).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants