获取错误makefile:45:条件中的语法无效.停止

Getting error Makefile:45: invalid syntax in conditional. Stop

本文关键字:语法 无效 停止 条件 取错误 makefile 获取      更新时间:2023-10-16

现在我正在学习C 。在尝试执行makefile时,我会遇到这样的错误

makefile:45:条件中的语法无效。停止。我的系统配置是:

  • OS: - Ubuntu
  • OpenWrt SDK

我正在尝试在 ubuntu OS 系统中构建SDK。在这里,我添加了我尝试过的makefile代码。

    include $(TOPDIR)/rules.mk
PKG_NAME:=helloworld
PKG_VERSION:=0.0.1
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk

define Package/helloworld
    SECTION:=base
    CATEGORY:=Utilities
    DEFAULT:=n
    TITLE:=This is my first project
    URL:=http://unwireddevices.com
    # Other packages your program needs (our doesn't need anything, so let's comment it out)
    # DEPENDS:=+libstdcpp
endef

define Package/helloworld/description
    This! Is! My! First! Project!
endef


define Build/Prepare
    mkdir -p $(PKG_BUILD_DIR)
    $(CP) ./src/* $(PKG_BUILD_DIR)/
endef

define Build/Configure
    $(call Build/Configure/Default,--with-linux-headers=$(LINUX_DIR))
endef

define Package/helloworld/install
    $(INSTALL_DIR) $(1)/usr/bin
    $(INSTALL_BIN) $(PKG_BUILD_DIR)/helloworld $(1)/usr/bin/
endef
$(eval $(call BuildPackage, helloworld))

在您的makefile中,第一行似乎被过度指出。遵循"制作文件指南",并正确使用标签和空间。