Hello,
I have a Makefile that is working on MacOS and not on FreeBSD.
1.
From what I have understood $(RM) is a variable which is commonly defined somewhere for designing
2. Using "shell" word/variable
Picked somewhere on internet I ended with :
But it does not work on FreeBSD. The git version is not displayed. Why and what should I do ?
Again Why I should use "shell" keyword" ? I used "rm -f" before and not "shell rm -f"
3. Conditional
I was looking at the Makefile from Google gRPC project which I have understood is using (GNU)make and is not compatible on FreeBSD.
So I started writing my own with a (BSD ???) style (same as PMake ???) :
And again, it does not work. No Hello, No sweety... Why and how to solve
4. using along GNU make / BSD make
From this thread https://forums.freebsd.org/threads/48534/, the moderator answered :
"It's quite common on FreeBSD to use devel/gmake. A lot of ports use it."
So my question is : Could I have 2 "Make" available in same time and switch between both.
And if yes, what is the procedure to do so; and at last can I build a library with one and use it in project built with the other ?
Hope you could help.
Olive
I have a Makefile that is working on MacOS and not on FreeBSD.
1.
$(RM)
From what I have understood $(RM) is a variable which is commonly defined somewhere for designing
rm -f
. Looks like it is not defined on my distrib. If I want, where should I go/see/modify to define this variable outside this make.2. Using "shell" word/variable
Picked somewhere on internet I ended with :
Code:
DISTRIB=myprog-$(shell git describe --always).tar.gz
package: clean
tar -czf $(DISTRIB) $(MY_SOURCES)
Again Why I should use "shell" keyword" ? I used "rm -f" before and not "shell rm -f"
3. Conditional
I was looking at the Makefile from Google gRPC project which I have understood is using (GNU)make and is not compatible on FreeBSD.
So I started writing my own with a (BSD ???) style (same as PMake ???) :
Code:
HAS_GCC = $(shell which gcc > /dev/null 2> /dev/null && echo true || echo false)
HAS_CC = $(shell which cc > /dev/null 2> /dev/null && echo true || echo false)
TRUE= $(echo true)
FALSE = $(echo false)
.if $(HAS_CC) == $(TRUE)
@echo hello
.else echo "hello sweety again"
.endif
4. using along GNU make / BSD make
From this thread https://forums.freebsd.org/threads/48534/, the moderator answered :
"It's quite common on FreeBSD to use devel/gmake. A lot of ports use it."
So my question is : Could I have 2 "Make" available in same time and switch between both.
And if yes, what is the procedure to do so; and at last can I build a library with one and use it in project built with the other ?
Hope you could help.
Olive