天嵌 ARM开发社区

 找回密码
 注册
查看: 1727|回复: 2

如何写makefile来编译多个.c文件生成一个可执行文件啊

[复制链接]
阳光梦 发表于 2012-5-20 18:34:49 | 显示全部楼层 |阅读模式
如何写makefile来编译多个.c文件生成一个可执行文件啊,用main.c shtll_test.c magic_gpio.c来产生main.cgi

 楼主| 阳光梦 发表于 2012-5-20 18:36:14 | 显示全部楼层
这些文件中只有一个main
 楼主| 阳光梦 发表于 2012-5-20 20:23:19 | 显示全部楼层
main.cgi:magic_gpio.o shtll_test.o main.o
        gcc main.o magic_gpio.o shtll_test.o -o main.cgi
main.o:mian.c
        gcc -c main.c
magic_gpio.o:magic_gpio.c
        gcc -c magic_gpio.c
shtll_test.o:shtll_test.c
        gcc -c shtll_test.c
.PHONY:clean
clean:
        rm -f magic_gpio.o shtll_test.o main.o main.cgi
在shtll_test中有个log10(x)怎么编译不了呢

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2024-9-23 04:35 , Processed in 1.020443 second(s), 18 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表