mirror of
https://github.com/pyenv/pyenv.git
synced 2025-04-12 14:43:46 +00:00
On systems that support both C compiling and dynamic loading, we can speed up `realpath()` (where most time in rbenv is spent) by replacing it with a dynamically loaded bash builtin. When `make -C src` is called in the project's root, `libexec/rbenv-realpath.dylib` will be created. If it exists, rbenv will attempt to load it as a builtin command. If it fails, execution will fall back to the old `realpath()` shell function.
10 lines
219 B
Makefile
10 lines
219 B
Makefile
SHOBJ_LDFLAGS = -dynamiclib -current_version 1.0
|
|
|
|
.c.o:
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
../libexec/rbenv-realpath.dylib: realpath.o
|
|
$(CC) $(CFLAGS) $(SHOBJ_LDFLAGS) -o $@ realpath.o
|
|
|
|
clean:
|
|
rm -f *.o ../libexec/*.dylib
|