当前位置:网站首页>Makefile missing separator. Stop.怎么解决「建议收藏」
Makefile missing separator. Stop.怎么解决「建议收藏」
2022-08-10 12:52:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
- 现象
在makefile中写入:
all: clean comp
clean:
./clean.csh
comp:
./run_tc命令行的背景显示为红色。
运行makefile 提示:makefile 3 missing separator.stop:
检查了一番发现,有几个原因会引起这样的结果:
第一:makefile的命令行,开头必须用tab键,目前没有发现tabstop的设定值的不同,会引起error。例如:
set tabstop=3(默认) OR set tabstop=4等,均可以。
第二:编码方式引起的原因。这个原因不多见,不容易发现。查看/etc/vimrc文件以及~/.vimrc,查看是否有set fileencodings的选项,是否设定了utf-8。没有的话加上。
***********************************************************************************************
- 扩展
*************************************************************************************************
Makefile missing separator. Stop.如何解决 Makefile:1: *** missing separator. Stop. makefile 如下
makefile missing?separator? stop makefile常见错误
[解决办法]
这个makefile里不要乱用TAB,只有命令所在的行才能且只能以TAB开头!
其他的如,make变量的定义、赋值,make内定函数如$(error "strings")都不能以TAB开头,不然make会将其作为命令来处理!
[解决办法]
1.第一行ifnep这个符号是做什么的?大概是ifneq吧?
2.很多地方你打的是空格,你最好尝试习惯去用tab键
3.第八行和第十行必须用tab开头
ifneq ($(KERNELRELEASE),)
obj-m += module.o
else
PWD := $(shell pwd)
KVER := $(shell uname -r)
KDIR := /lib/modules/$(KVER)/build
all:
$(MAKE) -C $(KDIR) M= $(PWD)
clean:
rm -rf *.o *.mod.c *.ko *.symvers *.order *.makers
endif
[解决办法]
如果排除了TAB用空格代替的问题后、以及由中文“:”等问题后,问题还存在
那么很可能是文件编码格式的问题
查看一下Makefile 文件编码格式是不是utf-8的,还带有BOM标记在文件头
$ xxd -l 16 Makefile
0000000: efbb bf61 6c6c 3a0a 2020 6563 686f 2068 ...all:.
去掉红色字体部分就OK了 发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/129978.html原文链接:https://javaforall.cn
边栏推荐
- LeetCode中等题之比较版本号
- AtCoder初学者比赛077 D -小多
- AtCoder Beginner Contest 077 D - Small Multiple
- Fragment-hide和show
- Jenkins修改默认主目录
- OpenStack-related commands that need to be recorded _ self-use
- 数字藏品,“赌”字当头
- Efficient and Robust 2D-to-BEV Representation Learning via Geometry-guided Kernel Transformer Paper Notes
- A can make large data clustering method of 2000 times faster, don't poke
- 接口自动化测试基础篇
猜你喜欢

bgp双平面实验 路由策略控制流量

专有云ABC Stack,真正的实力派!

Redis 定长队列的探索和实践

【ECCV 2022|百万奖金】PSG大赛:追求“最全面”的场景理解

2022-08-09:以下go语言代码输出什么?A:否,会 panic;B:是,能正确运行;C:不清楚,看投票结果。 package main import ( “fmt“ “syn

进程和计划任务管理

How to describe multiple paragraphs with different font settings in Open Office XML format

Solution for "Certificate not valid for requested usage" after Digicert EV certificate signing

R语言实战应用案例:论文篇(一)-特殊柱形图绘制
![ArcMAP has a problem of -15 and cannot be accessed [Provide your license server administrator with the following information:Err-15]](/img/da/b49d7ba845c351cefc4efc174de995.png)
ArcMAP has a problem of -15 and cannot be accessed [Provide your license server administrator with the following information:Err-15]
随机推荐
ArcMAP has a problem of -15 and cannot be accessed [Provide your license server administrator with the following information:Err-15]
接口自动化测试基础篇
Digicert EV证书签名后出现“证书对于请求用法无效”的解决方案
【jstack、jps命令使用】排查死锁
Basic knowledge of switches
Fragment-hide和show
Open Office XML 格式里如何描述多段具有不同字体设置的段落
Keithley DMM7510 accurate measurement of ultra-low power consumption equipment all kinds of operation mode power consumption
G1和CMS的三色标记法及漏标问题
需要被记录的OpenStack相关的命令_自己用
A can make large data clustering method of 2000 times faster, don't poke
一种能让大型数据聚类快2000倍的方法,真不戳
大佬们有遇到过这个问题吗? MySQL 2.2 和 2.3-SNAPSHOT 都这样,貌似是
Blast!ByteDance successfully landed, only because the interview questions of LeetCode algorithm were exhausted
2022 Recruitment Notice for Academician Zhao Guoping Group of Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences
bgp dual plane experiment routing strategy to control traffic
Nanodlp v2.2/v3.0光固化电路板,机械开关/光电开关/接近开关的接法和系统状态电平设置
【ECCV 2022|百万奖金】PSG大赛:追求“最全面”的场景理解
2022-08-09:以下go语言代码输出什么?A:否,会 panic;B:是,能正确运行;C:不清楚,看投票结果。 package main import ( “fmt“ “syn
Short read or OOM loading DB. Unrecoverable error, aborting now