title: Build Makefile Target in Bazel
body: <p>I'm trying to build <code>openssl</code> with bazel. Here is my current setup</p>
  <p>In my <code>/WORKSPACE</code> in the project root i have</p>
  <pre><code>load(&quot;@bazel_tools//tools/build_defs/repo:http.bzl&quot;, &quot;http_archive&quot;)
  
  http_archive(
      name = &quot;openssl&quot;,
      urls = [&quot;https://www.openssl.org/source/openssl-1.1.1c.tar.gz&quot;],
      sha256 = &quot;f6fb3079ad15076154eda9413fed42877d668e7069d9b87396d0804fdb3f4c90&quot;,
      strip_prefix = &quot;openssl-1.1.1c&quot;,
      build_file = &quot;@//:BUILD.openssl&quot;,
  )
  </code></pre>
  <p>In my <code>/BUILD.openssl</code> file i have</p>
  <pre><code>genrule(
      name = &quot;build&quot;,
      visibility = [&quot;//visibility:public&quot;],
      srcs = glob([&quot;**&quot;]),
      cmd = '\n'.join([
          './Configure darwin64-x86_64-cc -mmacosx-version-min=&quot;10.14&quot; --prefix=$@ --openssldir=$@',
          'make',
          'make install',
      ]),
      outs = [&quot;openssl&quot;],
  )
  </code></pre>
  <p>I don't quite understand what folder I am in while this <code>genrule</code> is running, since it complains with</p>
  <pre><code>/bin/bash: ./Configure: No such file or directory
  </code></pre>
  <p>Also what do i specify for <code>srcs</code> and <code>outs</code> in a makefile target?
  What directory would i specify for openssls <code>--prefix</code> and <code>--openssldir</code> in this case?</p>
  <p>I'm kind of suprised that integrating targets that are not configured in Bazel is so poorly documented, given that's probably the most important use case.</p>