当前位置:网站首页>Share a general compilation method of so dynamic library
Share a general compilation method of so dynamic library
2022-07-07 01:23:00 【wandersky0822】
CC :=$(CROSS_COMPILE)gcc
LD :=$(CROSS_COMPILE)ld
CFLAGS := -fPIC -Wall
LDFLAGS := -shared -Wl,-soname=libdrdev.so.2
SOURCE := $(wildcard *.c)
OBJS := $(patsubst %.c,%.o,$(SOURCE))
TARGET_LIB := libdrdev.so.2.1.0
all:$(OBJS)
@echo $(OBJS)
# $(LD) $(LDFLAGS) -o $(TARGET_LIB) $(OBJS)
$(CC) $(LDFLAGS) -o $(TARGET_LIB) $(OBJS)
%.o:%.c
@echo Compiling $< ...
$(CC) -c $(CFLAGS) $< -o $*.o
.PHONY:clean
clean:
rm $(TARGET_LIB) *.o -rf
Several knowledge points , Explain the following :
-fPIC Position is irrelevant
-shared seeing the name of a thing one thinks of its function , Generating shared libraries
$(wildcard *.c) List all under the folder .c file
$(patsubst %.c,%.o,$(SOURCE)) stay $(SOURCE) Search for .c file , Replace with .o
%.o:%.c % wildcard , You can guess almost
$< All dependence
$* All goals % The previous part .
边栏推荐
- Let's see through the network i/o model from beginning to end
- 子网划分、构造超网 典型题
- Failed to successfully launch or connect to a child MSBuild. exe process. Verify that the MSBuild. exe
- golang中的WaitGroup实现原理
- Spark TPCDS Data Gen
- golang中的Mutex原理解析
- Neon Optimization: About Cross access and reverse cross access
- Neon Optimization: an optimization case of log10 function
- Windows installation mysql8 (5 minutes)
- Taro 小程序开启wxml代码压缩
猜你喜欢
第三方跳转网站 出现 405 Method Not Allowed
Segmenttree
【案例分享】网络环路检测基本功能配置
Maidong Internet won the bid of Beijing life insurance to boost customers' brand value
资产安全问题或制约加密行业发展 风控+合规成为平台破局关键
Transplant DAC chip mcp4725 to nuc980
Dark horse notes - exception handling
力扣1037. 有效的回旋镖
Js逆向——捅了【马蜂窝】的ob混淆与加速乐
Your cache folder contains root-owned files, due to a bug in npm ERR! previous versions of npm which
随机推荐
1123. 最深叶节点的最近公共祖先
Failed to successfully launch or connect to a child MSBuild. exe process. Verify that the MSBuild. exe
Your cache folder contains root-owned files, due to a bug in npm ERR! previous versions of npm which
Tensorflow 1.14 specify GPU running settings
Supersocket 1.6 creates a simple socket server with message length in the header
【芯片方案设计】脉搏血氧仪
C# 计算农历日期方法 2022
Tensorflow GPU installation
Make Jar, Not War
boot - prometheus-push gateway 使用
实现mysql与ES的增量数据同步
Eventbus source code analysis
C语言实例_3
[signal and system]
Oracle: Practice of CDB restricting PDB resources
Transplant DAC chip mcp4725 to nuc980
力扣1037. 有效的回旋镖
C # method of calculating lunar calendar date 2022
1123. The nearest common ancestor of the deepest leaf node
pytorch之数据类型tensor