Creating a simple Makefile to build a shared library

前端 未结 5 1456
天涯浪人
天涯浪人 2021-01-30 21:37

I am trying to create a very basic hand crafted Makefile to create a shared library to illustrate a point.

This is what I have so far:

SHELL = /bin/sh
CC         


        
5条回答
  •  故里飘歌
    2021-01-30 21:46

    Compile with -shared:

    gcc -o libfoo.so module1.o module2.o -shared
    

    (This also works on MingW under Windows to produce DLLs.)

提交回复
热议问题