交叉编译Linux SDK —— Makefile
2021/9/11 7:07:03
本文主要是介绍交叉编译Linux SDK —— Makefile,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
CC = /home/aston/flp/dicpen_rk3326_linux/buildroot/output/rockchip_rk3326_64/host/bin/aarch64-linux-gcc CXX = /home/aston/flp/dicpen_rk3326_linux/buildroot/output/rockchip_rk3326_64/host/bin/aarch64-linux-g++ TLINCLUDE += -I ./include target = test objects = a.o b.o c.o d.o e.o CFLAGS = $(TLINCLUDE) -fPIC TLLIBS = -L ./lib obj = ./ **#测试demo** all: $(target).o a.o b.o c.o d.o e.o $(CXX) $^ $(TLLIBS) -lcurl -lssl -lcrypto -ldl -lsqlcipher -o $(target) all: $(objects) $(CC) $^ $(CFLAGS) $(TLLIBS) -lcurl -lssl -lcrypto -ldl -lsqlcipher -lpthread -o $(target) $(target).o: $(target).c $(CC) $(CFLAGS) -c $< -o $(obj)$@ a.o: a.c $(CC) $(CFLAGS) -c $< -o $@ b.o: b.c $(CC) $(CFLAGS) -c $< -o $(obj)$@ c.o: c.c $(CC) $(CFLAGS) -c $< -o $(obj)$@ d.o: d.c $(CC) $(CFLAGS) -c $< -o $(obj)$@ e.o: e.cpp $(CXX) $(CFLAGS) -c $< -o $@ clean: rm -rf *.o rm -rf $(obj)*.o rm -rf $(objects) **#so文件** all: $(objects) $(CC) $^ $(CFLAGS) $(TLLIBS) -lcurl -shared -lssl -lcrypto -ldl -lsqlcipher -lpthread -o libxxx.so a.o: a.c $(CC) $(CFLAGS) -c $< -o $@ b.o: b.c $(CC) $(CFLAGS) -c $< -o $(obj)$@ c.o: c.c $(CC) $(CFLAGS) -c $< -o $(obj)$@ d.o: d.c $(CC) $(CFLAGS) -c $< -o $(obj)$@ e.o: e.cpp $(CXX) $(CFLAGS) -c $< -o $@ clean: rm -rf *.o rm -rf $(obj)*.o rm -rf $(objects) **#调用so库** all: $(target).o $(CC) $^ $(CFLAGS) $(TLLIBS) -lcurl -lssl -lcrypto -ldl -lsqlcipher -lpthread -lxxx -o $(target) $(target).o: $(target).c $(CC) $(CFLAGS) -c $< -o $(obj)$@ clean: rm -rf *.o rm -rf $(obj)*.o rm -rf test
这篇关于交叉编译Linux SDK —— Makefile的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-12-18git仓库有更新,jenkins 自动触发拉代码怎么配置的?-icode9专业技术文章分享
- 2024-12-18Jenkins webhook 方式怎么配置指定的分支?-icode9专业技术文章分享
- 2024-12-13Linux C++项目实战入门教程
- 2024-12-13Linux C++编程项目实战入门教程
- 2024-12-11Linux部署Scrapy教程:新手入门指南
- 2024-12-11怎么将在本地创建的 Maven 仓库迁移到 Linux 服务器上?-icode9专业技术文章分享
- 2024-12-10Linux常用命令
- 2024-12-06谁看谁服! Linux 创始人对于进程和线程的理解是…
- 2024-12-04操作系统教程:新手入门及初级技巧详解
- 2024-12-04操作系统入门:新手必学指南