{"action":"created","issue":{"url":"https://api.github.com/repos/ocaml/ocamlbuild/issues/37","labels_url":"https://api.github.com/repos/ocaml/ocamlbuild/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/ocaml/ocamlbuild/issues/37/comments","events_url":"https://api.github.com/repos/ocaml/ocamlbuild/issues/37/events","html_url":"https://github.com/ocaml/ocamlbuild/pull/37","id":123997943,"number":37,"title":"generic dependencies: 'link_dep' linking dependency rule","user":{"login":"gasche","id":426238,"avatar_url":"https://avatars.githubusercontent.com/u/426238?v=3","gravatar_id":"","url":"https://api.github.com/users/gasche","html_url":"https://github.com/gasche","followers_url":"https://api.github.com/users/gasche/followers","following_url":"https://api.github.com/users/gasche/following{/other_user}","gists_url":"https://api.github.com/users/gasche/gists{/gist_id}","starred_url":"https://api.github.com/users/gasche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gasche/subscriptions","organizations_url":"https://api.github.com/users/gasche/orgs","repos_url":"https://api.github.com/users/gasche/repos","events_url":"https://api.github.com/users/gasche/events{/privacy}","received_events_url":"https://api.github.com/users/gasche/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-27T21:56:45Z","updated_at":"2016-01-01T21:59:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ocaml/ocamlbuild/pulls/37","html_url":"https://github.com/ocaml/ocamlbuild/pull/37","diff_url":"https://github.com/ocaml/ocamlbuild/pull/37.diff","patch_url":"https://github.com/ocaml/ocamlbuild/pull/37.patch"},"body":"OCamlbuild comes with a fair number of built-in flags and parametrized\r\nflags (flag, pflag), but with no built-in dependency rule. This\r\nomission makes it difficult in particular for people to understand how\r\nto build mixed OCaml/C program, as they have to add their own linking\r\nrules (for C object modules) to myocamlbuild.ml.\r\n\r\nThis commit goes a first step towards more usable generic dependency\r\nrules by adding a generic link-time dependency. In _tags,\r\n\r\n    pred: link_dep(foo)\r\n\r\nwill add \"foo\" as dependency to all targets matching \"pred\", and add\r\n\"foo\" as a link-time argument to linking actions performed to produce\r\nthose targets. In particular,\r\n\r\n    \"foo.byte\": link_dep(foo.o), custom\r\n    \"foo.native\": link_dep(foo.o)\r\n\r\nis what should be used to link C stubs into an OCaml executable."},"comment":{"url":"https://api.github.com/repos/ocaml/ocamlbuild/issues/comments/168340555","html_url":"https://github.com/ocaml/ocamlbuild/pull/37#issuecomment-168340555","issue_url":"https://api.github.com/repos/ocaml/ocamlbuild/issues/37","id":168340555,"user":{"login":"whitequark","id":54771,"avatar_url":"https://avatars.githubusercontent.com/u/54771?v=3","gravatar_id":"","url":"https://api.github.com/users/whitequark","html_url":"https://github.com/whitequark","followers_url":"https://api.github.com/users/whitequark/followers","following_url":"https://api.github.com/users/whitequark/following{/other_user}","gists_url":"https://api.github.com/users/whitequark/gists{/gist_id}","starred_url":"https://api.github.com/users/whitequark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitequark/subscriptions","organizations_url":"https://api.github.com/users/whitequark/orgs","repos_url":"https://api.github.com/users/whitequark/repos","events_url":"https://api.github.com/users/whitequark/events{/privacy}","received_events_url":"https://api.github.com/users/whitequark/received_events","type":"User","site_admin":false},"created_at":"2016-01-01T21:59:21Z","updated_at":"2016-01-01T21:59:21Z","body":"Good idea; I have a variation of this in nearly every project that uses C stubs. Would be best if there would be another flag (or maybe even the same?) that adds a `-lfoo` to the flags embedded in a `.cma`."}}