nvim-telescope / telescope-fzf-native.nvim

FZF sorter for telescope written in c
1.38k stars 45 forks source link

Makefile not compatible with OpenBSD #21

Closed ryanreno closed 3 years ago

ryanreno commented 3 years ago

The Makefile assumes a Linux system. Normally, you can install GNU make on a BSD but the Makefile has two lines that prevent it from working even with the GNU make port.

OpenBSD mkdir does not have a verbose (-v) switch. Additionally, OpenBSD base system comes with an ancient gcc and instead uses clang as its default compiler. I do not know for sure but I'd guess the same is true with the other BSD systems.

I was able to compile with gmake on OpenBSD 6.9-current with this diff to the main branch:

diff --git a/Makefile b/Makefile
index 7d89c0f..e1371da 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,10 @@
-CC=gcc
 CFLAGS=-Wall -Werror -fpic
 COVER=#--coverage

 all: build/libfzf.so

 build/libfzf.so: src/fzf.c src/fzf.h
- mkdir -pv build
+ mkdir -p build
  $(CC) -O3 $(CFLAGS) -shared src/fzf.c -o build/libfzf.so

 build/test: build/libfzf.so test/test.c

Without these changes vim-plug fails to run the suggested { 'do': 'make' } line (which I changed to 'do': 'gmake') I can make this a PR if that's acceptable.

Conni2461 commented 3 years ago

PRs are always welcome :)

I have no problem with removing both -v in that file. But i am not sure about CC because you could do make CC=clang (if that works on OpenBSD)

ryanreno commented 3 years ago

22

GNU Make defaults CC to the system cc (which on most Linux distros I'm aware of is just a symlink to the system gcc). That should be a sane default. Additionally, setting CC in the Makefile will override the environment passed in. I put more details in the PR comment.