一 生成动态链接库的模板:

  

 1 #######################
 2 # Makefile
 3 #######################
 4 
 5 # compile and lib parameter
 6 CC      := g++
 7 LIBS    :=
 8 LDFLAGS :=
 9 DEFINES :=
10 INCLUDE := -I.
11 CFLAGS  :=
12 CXXFLAGS:=
13 
14 # link parameter
15 #LIB := libfunc.so
16 LIB := libfunc.a
17 
18 #link
19 $(LIB):func.o
20         $(CC) -shared -o -fPIC -o $@ $^
21 #compile
22 func.o:thread.c
23         $(CC) -c -fPIC $^ -o $@ 
24 
25 # clean
26 clean:
27         rm -fr *.o
View Code

相关文章:

  • 2022-12-23
  • 2022-02-02
  • 2022-01-02
  • 2021-05-25
  • 2021-12-18
  • 2022-01-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-26
  • 2021-08-04
  • 2022-12-23
  • 2021-06-25
  • 2021-06-30
相关资源
相似解决方案