Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

3 votes
3 answers
525 views
Always build specified targets with FreeBSD make (as with the GNU make -B flag)
I would like to force `make` on FreeBSD to execute the target I specify no matter if it's up to date or not. I know that it could be done with a `-B` flag in GNU make but I cannot find anything similar in the FreeBSD make manual page.
I would like to force make on FreeBSD to execute the target I specify no matter if it's up to date or not. I know that it could be done with a -B flag in GNU make but I cannot find anything similar in the FreeBSD make manual page.
Mateusz Piotrowski (4983 rep)
Mar 29, 2018, 02:40 PM • Last activity: Jun 21, 2025, 05:35 AM
3 votes
2 answers
370 views
Convert Debian Makefile for FreeBSD
I'm trying to follow a guide to compile a program for Debian in FreeBSD. I have the following makefile: obj-m += kernelinfo.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean I'm confused as to how I would compile t...
I'm trying to follow a guide to compile a program for Debian in FreeBSD. I have the following makefile: obj-m += kernelinfo.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean I'm confused as to how I would compile this on FreeBSD since I do not have a /lib/modules folder on the machine. I have installed all of the default headers on FreeBSD in the /usr/src/ directory but I can't find a modules folder. I'm guessing the Makefile needs to be translated for FreeBSD, though I am very new to Linux and so I have no idea. Any help is much appreciated.
user3250889 (33 rep)
Jun 15, 2017, 03:01 PM • Last activity: Jan 27, 2023, 11:18 AM
2 votes
1 answers
1944 views
make don't know how to make CXXFLAGS. Stop
I am very new to both FreeBSD and compiling code from source and would really appreciate any help. I am trying to compile [fastText](https://github.com/facebookresearch/fastText) from source. When I execute the make command it returns the following message: make don't know how to make CXXFLAGS. Stop...
I am very new to both FreeBSD and compiling code from source and would really appreciate any help. I am trying to compile [fastText](https://github.com/facebookresearch/fastText) from source. When I execute the make command it returns the following message: make don't know how to make CXXFLAGS. Stop Here are first few lines from Makefile(complete file is available on the fastText github repo mentioned above): CXX = c++ CXXFLAGS = -pthread -std=c++0x OBJS = args.o dictionary.o matrix.o vector.o model.o utils.o INCLUDES = -I. opt: CXXFLAGS += -O3 -funroll-loops opt: fasttext debug: CXXFLAGS += -g -O0 -fno-inline debug: fasttext FreeBSD version: 10.3 FreeBSD clang version: 3.4.1 gmake version: 4.1_2
Imran Ali (123 rep)
Aug 22, 2016, 08:15 AM • Last activity: Jan 27, 2023, 11:12 AM
4 votes
1 answers
1434 views
bmake error on Mandrive: "bmake: no system rules (sys.mk)"
I'm trying to use bmake to build OS161 on Mandriva. When I try to run bmake, I get the following error: bmake: no system rules (sys.mk) I get the same error, even when I run bmake -m /usr/local/share/mk/sys.mk I've checked, and the path I listed above exists, but regardless of what path I give it, e...
I'm trying to use bmake to build OS161 on Mandriva. When I try to run bmake, I get the following error: bmake: no system rules (sys.mk) I get the same error, even when I run bmake -m /usr/local/share/mk/sys.mk I've checked, and the path I listed above exists, but regardless of what path I give it, even if I give it a garbage path, I get the same error. This happens no matter what directory I run bmake in, so it's definitely not an OS161 problem. Does anybody know how to fix this?
Joey Eremondi (291 rep)
Sep 11, 2013, 06:47 PM • Last activity: Jan 27, 2023, 10:42 AM
1 votes
1 answers
405 views
Is there any possibility to use the same Makefile in CentOS and FreeBSD?
Unfortunately, in some old FreeBSD environments I can't use "gmake", so I need to write a Makefile which will work with FreeBSD make also. And the last problem I can't solve - use shell commands, for example, I need to get full path to Python executable: PYTHON := $(shell which python2.7 || which py...
Unfortunately, in some old FreeBSD environments I can't use "gmake", so I need to write a Makefile which will work with FreeBSD make also. And the last problem I can't solve - use shell commands, for example, I need to get full path to Python executable: PYTHON := $(shell which python2.7 || which python) But FreeBSD make simply ignores this. test: echo == $(PYTHON) == Then I run make test: $ make test echo == == == == Can anyone help, please? **Update #1:** To those who can't read closely and accidentally downvotes the question: Whole test script: PYTHON != which python2.7 || which python test: $(PYTHON) -c 'print "hello world"' Run on FreeBSD: make /usr/bin/python -c 'print "hello world"' hello world Run on CentOS: make test_make:1: *** missing separator. Stop. And if I use command $(shell ...) it works on CentOS and doesn't work on FreeBSD. So, is there any solution without gmake? **Update #2:** Eventually I found solution (put command in backticks): PYTHON ?= which python2.7 || which python I don't know why it prints itself: make which python2.7 || which python -c 'print "hello world"' hello world But it works! You can use it, guys :)
Sergius (833 rep)
Sep 18, 2018, 03:07 PM • Last activity: Jan 27, 2023, 10:42 AM
1 votes
1 answers
431 views
How do I use a shell assignment in a makefile so that it works with both FreeBSD make (bmake) and macOS make (GNU Make 3.81)?
I'd like to use the shell assignment operator (i.e., `!=`) in a makefile that is going to be executed on FreeBSD, macOS, and Linux. Here's an example: ``` a!= seq 3 .PHONY: all all: $a .PHONY: $a $a: @echo $@ ``` Here's the expected output: ```console $ touch 1 2 3 $ make all 1 2 3 ``` Unfortunately...
I'd like to use the shell assignment operator (i.e., !=) in a makefile that is going to be executed on FreeBSD, macOS, and Linux. Here's an example:
a!= seq 3

.PHONY: all
all: $a

.PHONY: $a
$a:
	@echo $@
Here's the expected output:
$ touch 1 2 3
$ make all
1
2
3
Unfortunately, the shell assignment operator is not supported by the GNU Make shipped with macOS Monterey 12.6.1 and the output of the example is empty. It works in more recent versions of GNU Make though (e.g., 4.4), which are likely to be encountered in recent Linux distributions. What should I do if I want this makefile to work with any version of GNU make and bmake?
Mateusz Piotrowski (4983 rep)
Jan 27, 2023, 10:38 AM
Showing page 1 of 6 total questions