No rule to make <system library>?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

No rule to make <system library>?

Jeffrey Walton-3
Hi Everyone,

I'm having trouble figuring out this problem. I can build fine from
the command line, but I'm catching an error:

    make: *** No rule to make target 'libcrypto.a', needed by
'test2.exe'.  Stop.

I have a simple makefile:

$ cat Makefile
all: test.exe test2.exe

LIBCRYPTO = -l:libcrypto.a

test.exe:
    $(CXX) $(CXXFLAGS) -g2 -O0 -o test.exe test.cxx -pthread $(LIBCRYPTO) -ldl

test2.exe:
        $(CXX) $(CXXFLAGS) -g2 -O0 -o test2.exe test2.cxx -pthread
$(LIBCRYPTO) -ldl

But this works just fine:

    $ g++ -o test2.exe -g2 -O0 test2.cxx -l:libcrypto.a -pthread -ldl
    $

Any ideas why Make is trying to build a system library?

Jeff

_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

Re: No rule to make <system library>?

Paul Smith-20
On Wed, 2019-10-09 at 06:00 -0400, Jeffrey Walton wrote:

>     make: *** No rule to make target 'libcrypto.a', needed by
> 'test2.exe'.  Stop.
>
> I have a simple makefile:
>
> $ cat Makefile
> all: test.exe test2.exe
>
> LIBCRYPTO = -l:libcrypto.a
>
> test.exe:
>     $(CXX) $(CXXFLAGS) -g2 -O0 -o test.exe test.cxx -pthread $(LIBCRYPTO) -ldl
>
> test2.exe:
>         $(CXX) $(CXXFLAGS) -g2 -O0 -o test2.exe test2.cxx -pthread $(LIBCRYPTO) -ldl
>
> But this works just fine:
>
>     $ g++ -o test2.exe -g2 -O0 test2.cxx -l:libcrypto.a -pthread -ldl
>     $
>
> Any ideas why Make is trying to build a system library?

I can't see any possible way you can get that message from that makefile.

Are you sure that you provided us with the EXACT makefile you used when you
got this error?

If so, please use "make -d" and/or "make -p" and determine where the
prerequisite on libcrypto.a came from.