简体   繁体   中英

how to include bsd.prog.mk in both GNU and BSD make?

I am new to the World of makeFile, I have a basic question.

I have a make file with the content.

.include <bsd.prog.mk>

I am getting the error when executing the make file

 Makefile:: *** missing separator.  Stop.

The reason I am getting the error since I am executing the makefile in the Linux environment instead of the FreeBSD system.

so, Is there any way to include the bsd.prog.mk file in both Linux and BSD systems, if Linux supports it, if not then what is the similar file to include to keep the MakeFile behavior the same.

You need a compatible Make implementation (and build system files). The problem is the default Make implementation on most GNU/Linux systems is GNU Make, which is incompatible with FreeBSD's.

Luckily FreeBSD uses bmake nowadays, which is packaged for most systems, if it isn't available in yours, you can download it here: https://crufty.net/help/sjg/bmake.html (and build it yourself).

您可以在 Linux 系统上安装 bmake 并使用它,或者您可以在 BSD 系统上安装 GNU make 并使用 GNU make include 语法:https ://www.gnu.org/software/make/manual/html_node/Include.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM