make static-lib, do more things in make install/uninstall

This commit is contained in:
dzaima 2023-10-29 21:34:59 +02:00
parent 60efae9895
commit 31bfaff9dd
2 changed files with 18 additions and 2 deletions

View File

@ -70,6 +70,7 @@ Alternatively, `build/build` (aka build.bqn) can be invoked manually, though not
- `make wasi-reactor-o3` - build producing a WASI Reactor
- `make debug` - unoptimized build with extra assertion checks (also includes `-g`)
- `make static-bin` - build a statically linked executable (for a fully standalone binary, try `make static-bin CC=musl-gcc REPLXX=0`)
- `make static-lib` - build a static library archive
All of the above will go through build.bqn. If that causes problems, `make o3-makeonly` or `make c-makeonly` can be used. These still enable REPLXX by default, but do not support Singeli. Furthermore, these targets don't support some of the build flags that the others do.

View File

@ -80,6 +80,8 @@ shared-o3:
@"${MAKE}" to-bqn-build REPLXX=0 i_SHARED=1
shared-c:
@"${MAKE}" to-bqn-build REPLXX=0 i_SHARED=1 i_build_opts=c
static-lib:
@"${MAKE}" to-bqn-build REPLXX=0 i_build_opts="static-lib"
static-bin:
@"${MAKE}" to-bqn-build FFI=0 i_build_opts="static-bin"
@ -344,14 +346,27 @@ endif # replxx
# dependency files
-include $(bd)/*.d
DESTDIR =
PREFIX = /usr/local
install: uninstall
install:
rm -f "$(DESTDIR)$(PREFIX)/bin/bqn"
cp -f BQN "$(DESTDIR)$(PREFIX)/bin/bqn"
cp -f include/bqnffi.h "$(DESTDIR)$(PREFIX)/include/bqnffi.h"
@if [ -f libcbqn.so ]; then \
rm -f "$(DESTDIR)$(PREFIX)/lib/libcbqn.so"; \
cp -f libcbqn.so "$(DESTDIR)$(PREFIX)/lib/libcbqn.so"; \
echo 'cp -f libcbqn.so "$(DESTDIR)$(PREFIX)/lib/libcbqn.so"'; \
else \
echo "Not installing libcbqn.so as it wasn't built"; \
fi
uninstall:
rm -f "$(DESTDIR)$(PREFIX)/bin/bqn"
rm -f "$(DESTDIR)$(PREFIX)/include/bqnffi.h"
rm -f "$(DESTDIR)$(PREFIX)/lib/libcbqn.so"
clean-build:
rm -f build/obj/*/*.o