首页 > 其他分享 >Makefile - Error: Makefile:2: *** missing separator. Stop.

Makefile - Error: Makefile:2: *** missing separator. Stop.

时间:2023-11-27 19:34:16浏览次数:28  
标签:exec Makefile createdb Stop zimple separator bank dropdb

Got below error:

Makefile:2: *** missing separator.  Stop.

 

Check the Makefile using cat -e -t -v:

zzh@ZZHPC:/zdata/Github/zimplebank$ cat -e -t -v Makefile 
createdb:$
    docker exec -it postgres16 createdb --username=root --owner=root zimple_bank$
$
dropdb:$
    docker exec -it postgres16 dropdb zimple_bank$
$
.PHONY createdb dropdb

make defines a tab is required to start each recipe. All actions of every rule are identified by tabs. If you prefer to prefix your recipes with a character other than tab, you can set the .RECIPEPREFIX variable to an alternate character.

 

Replaced the identation spaces to tabs:

zzh@ZZHPC:/zdata/Github/zimplebank$ cat -e -t -v Makefile 
createdb:$
^Idocker exec -it postgres16 createdb --username=root --owner=root zimple_bank$
$
dropdb:$
^Idocker exec -it postgres16 dropdb zimple_bank$
$
.PHONY createdb dropdbzzh@ZZHPC:/zdata/Github/zimplebank$ make dropdb
Makefile:7: *** missing separator.  Stop.

Still got the error, but the error line number changed to 7. Checkd and found that a colon was missing after .PHONY.

 

zzh@ZZHPC:/zdata/Github/zimplebank$ cat -e -t -v Makefile
createdb:$
^Idocker exec -it postgres16 createdb --username=root --owner=root zimple_bank$
$
dropdb:$
^Idocker exec -it postgres16 dropdb zimple_bank$
$
.PHONY: createdb dropdbzzh@ZZHPC:/zdata/Github/zimplebank$ make dropdb
docker exec -it postgres16 dropdb zimple_bank

 

标签:exec,Makefile,createdb,Stop,zimple,separator,bank,dropdb
From: https://www.cnblogs.com/zhangzhihui/p/17860232.html

相关文章

  • Makefile中空格与tab
    空格与tabmakefile实际上是在一个文件中用两种完全不同的“语言”编写的。recipe(运行编译器,echo等的命令)是用shell脚本语法编写的。不在recipe中的其余makefile是用makefile语法编写的。为了使make能够区分recipe和不是recipe的东西,它使用了TAB字符。因此,以TAB开头的行......
  • C# 中增加一个使用StopWatch记录方法执行时间的通用方法
    目录一背景二源码2.1注意事项三使用方法一背景在很多时候我们在进行代码排查的时候需要在日志中记录代码的执行时间从而方便我们进行代码运行效率的执行,我们在日志中准确记录方法的执行时间,这样方便我们进行代码的排查,下面分享一个我们常用的记录方式,方便使用,而且最重要的......
  • Windows下mDNS查询API—DnsStartMulticastQuery/DnsStopMulticastQuery的使用
    背景及问题:目前很多局域网设备通过mNDS协议实现互联,IP地址为自动IP段-169.254.x.x,有时候设备厂家提供的API需要通过知晓局域网中的IP地址/设备名,才能连接该设备。这样要求每个软件必须配置设备名或者启动时遍历所有IP(6w+),不是很方便,这时候可以通过mDNS查询,自动拿到设备名,再进行连......
  • Linux-Makefile与make命令
    Makefile命令 makefile文件和make工具的作用make它能够通过查找文件中记录的被修改过的文件根据依赖关系对这些文件来单独编译,达到快速编译多个文件的过程。Make的执行过程当控制台终端执行make命令以后,它就会去寻找Makefile文件并执行文件中的第一个目标的命令。例子中......
  • U-BOOT分析之顶层Makefile文件
    U-BOOT分析(二)之顶层Makefile文件(1)U-BOOT版本u-boot版本:   u-boot-2021.01.tar.bz2Makefile&&make简介      Makefile:是一个描述文件定义一系列的规则来指定源文件编译的先后顺序,拥有特定的语法规则,makefile文件描述了整个工程中所有文件的__编译顺序,编译规......
  • Makefile - What is a Makefile and how does it work?
    Ifyouwanttorunorupdateataskwhencertainfilesareupdated,the make utilitycancomeinhandy.The make utilityrequiresafile, Makefile (or makefile),whichdefinessetoftaskstobeexecuted.Youmayhaveused make tocompileaprogramf......
  • makefile深入补交
    ......
  • Makefile 模板(二)
    Makefile模板模板介绍支持存放中间文件的文件夹检查和创建支持源文件位于不同文件夹内模板OBJOUT:=./out/EXEOUT:=./out/INCLUDE_DIR:=./includeSRC_DIR_TEST=./src/test/SRC_DIR_THREADPOLL=./src/WorkThread/LIB:=-lpthreadSRC:=$(wildcard$(SRC_......
  • 如何用gcc+makefile改造STM32Keil项目
    1、环境配置,本地需要安装gcc+make环境,将w64devkit中的bin路径放入环境变量D:\download\storage\arm_gcc\w64devkit然后再cmd中输入gcc-v和make-v测试gcc和make环境是否可以正常运行,如果有下面这种显示就说明gcc和make环境配置好了2、获取芯片的启动文件文件和链接文件,stm32......
  • $(CURDIR)/Makefile Makefile: ; 的作用
    $(CURDIR)/MakefileMakefile:; 在这个Makefile中,$(CURDIR)/MakefileMakefile:;是一个特殊的语法,它被用于取消Makefile默认的隐含规则。这个语句的作用是阻止Make命令在当前目录下自动查找和使用默认的隐含规则来构建目标。通常情况下,如果没有指定如何构建某个目标,Make命令......