Skip to content

Conversation

@wieczorek1990
Copy link

@wieczorek1990 wieczorek1990 commented Dec 30, 2025

Hello,

I just tried compiling vim with clang.
It is not stright forward.
Thought it should work like this:

gh repo clone vim/vim
cd ./vim/src/
CC=clang make
sudo make install

I added a script and modified Makefile, but in the end would like a simplier solution to use a different compiler.

bin/compile.sh Outdated
@@ -0,0 +1,11 @@
#!/usr/bin/env fish
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't bash be a more common choice?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to sh.

src/Makefile Outdated
#instead of using the default from the "make" program.
#Use a line further down to change the value for CC.
CC=
CC=clang
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not backwards compatible, as not everyone will have the Clang toolchain installed in their environment.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed. Please look.

@chrisbra
Copy link
Member

This is not needed and the provided shell script is trivial. When I am compiling locally, I typically modify the Makefile (as I often need to compile using different feature flags or test with different compilers) and this works just fine. However in your case, you can just use make <args> CC=clang

@chrisbra chrisbra closed this Dec 31, 2025
@wieczorek1990
Copy link
Author

So what I wanted is:

gh repo clone vim/vim
cd ./vim/src/
make CC=clang

Anyway I am for scripts in bin for process related things.

This is not needed and the provided shell script is trivial. When I am compiling locally, I typically modify the Makefile (as I often need to compile using different feature flags or test with different compilers) and this works just fine. However in your case, you can just use make <args> CC=clang

Seems not to work with CC=clang make <args>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants