mirror of
https://github.com/radareorg/radare2
synced 2026-08-22 20:23:32 -04:00
Improve jslinux build times, linking only the r2blob ##build
This commit is contained in:
parent
d3211ca7a0
commit
0bb935e2cf
3 changed files with 40 additions and 12 deletions
21
Makefile
21
Makefile
|
|
@ -47,15 +47,28 @@ endif
|
|||
endif
|
||||
endif
|
||||
|
||||
all: plugins.cfg libr/include/r_version.h
|
||||
# which target to run inside libr/ (all, static, sublibs). see libr/Makefile
|
||||
LIBS_TARGET?=all
|
||||
|
||||
all: libs
|
||||
${MAKE} -C binr
|
||||
|
||||
# everything but the binr/ programs
|
||||
libs: plugins.cfg libr/include/r_version.h
|
||||
@libr/count.sh reset
|
||||
${MAKE} -C shlr sdbs
|
||||
${MAKE} -C shlr/zip
|
||||
${MAKE} -C libr/util
|
||||
${MAKE} -C libr/socket
|
||||
${MAKE} -C shlr
|
||||
${MAKE} -C libr
|
||||
${MAKE} -C binr
|
||||
${MAKE} -C libr $(LIBS_TARGET)
|
||||
|
||||
# just the busybox-style single-binary build: skips the 16 binr/ programs,
|
||||
# libr.a/libr.so and every shared library, because r2blob links the static
|
||||
# per-directory libr_*.a archives and nothing else
|
||||
blob:
|
||||
${MAKE} libs LIBS_TARGET=sublibs WITH_LIBS=0 WITH_LIBR=1
|
||||
${MAKE} -C binr/blob symlinks WITH_LIBS=0 WITH_LIBR=1
|
||||
|
||||
GIT_TAP=$(shell git describe --tags --match '[0-9]*' 2>/dev/null)
|
||||
GIT_TIP=$(shell git rev-parse HEAD 2>/dev/null || echo $(R2_VERSION))
|
||||
|
|
@ -420,6 +433,6 @@ menu nconfig:
|
|||
include mk/meson.mk
|
||||
include ${MKPLUGINS}
|
||||
|
||||
.PHONY: all clean install symstall uninstall deinstall strip
|
||||
.PHONY: all libs blob clean install symstall uninstall deinstall strip
|
||||
.PHONY: libr binr install-man w32dist tests dist shot pkgcfg depgraph.png love
|
||||
.PHONY: purge system-purge
|
||||
|
|
|
|||
10
dist/jslinux/Makefile
vendored
10
dist/jslinux/Makefile
vendored
|
|
@ -49,7 +49,12 @@ BLK_KB ?= 256
|
|||
R2_CFLAGS ?= -Oz -ffunction-sections -fdata-sections
|
||||
# --with-libr builds the static libr_*.a archives the blob links against;
|
||||
# --with-static-themes compiles the color themes into the binary since the
|
||||
# guest image ships no r2 share directory
|
||||
# guest image ships no r2 share directory.
|
||||
#
|
||||
# only `make libs LIBS_TARGET=sublibs WITH_LIBS=0` is run in the r2 tree:
|
||||
# the 16 binr/ programs, the merged libr.a/libr.so and every shared library
|
||||
# are pure waste here, since the blob is one static binary symlinked to all
|
||||
# the tool names inside the image (busybox-style).
|
||||
R2_CONFIGURE_FLAGS ?= --disable-debugger --without-ptrace-wrap --without-qjs \
|
||||
--without-capstone --without-zydis --without-gpl --without-dylink \
|
||||
--disable-loadlibs --with-checks-level=0 --with-libr --with-static-themes
|
||||
|
|
@ -161,7 +166,8 @@ $(WORK)/r2blob: | $(CC_WRAP)
|
|||
cd $(R2_ROOT) && CC=$(CC_WRAP) HOST_CC=cc CFLAGS="$(R2_CFLAGS)" ./configure \
|
||||
--host=riscv64-unknown-linux-musl --with-ostype=gnulinux \
|
||||
--prefix=/usr $(R2_CONFIGURE_FLAGS)
|
||||
$(MAKE) -C $(R2_ROOT) -j$(JOBS) CC=$(CC_WRAP) HOST_CC=cc
|
||||
$(MAKE) -C $(R2_ROOT) libs -j$(JOBS) CC=$(CC_WRAP) HOST_CC=cc \
|
||||
LIBS_TARGET=sublibs WITH_LIBS=0 WITH_LIBR=1
|
||||
cd $(R2_ROOT)/binr/blob && rm -f r2blob && \
|
||||
LDFLAGS="-static -Wl,--gc-sections" $(MAKE) CC=$(CC_WRAP) build
|
||||
@STRIP="$$(ls $(TCDIR)/bin/riscv64-linux-strip 2> /dev/null || \
|
||||
|
|
|
|||
|
|
@ -16,7 +16,20 @@ include libs.mk
|
|||
|
||||
.PHONY: $(LIBS)
|
||||
|
||||
all:
|
||||
all: sublibs
|
||||
ifeq ($(WITH_LIBR),1)
|
||||
$(MAKE) libr.${EXT_AR}
|
||||
$(MAKE) libr.${EXT_SO}
|
||||
endif
|
||||
|
||||
# same as all, but without the merged libr.${EXT_SO}
|
||||
static: sublibs
|
||||
ifeq ($(WITH_LIBR),1)
|
||||
$(MAKE) libr.${EXT_AR}
|
||||
endif
|
||||
|
||||
# only the per-directory libr_*.a / libr_*.so, no merged libr.a or libr.so
|
||||
sublibs:
|
||||
$(MAKE) -C xps
|
||||
$(MAKE) $(LIBS0)
|
||||
$(MAKE) $(LIBS1)
|
||||
|
|
@ -29,10 +42,6 @@ all:
|
|||
ifneq ($(LIBS8),)
|
||||
$(MAKE) $(LIBS8)
|
||||
endif
|
||||
ifeq ($(WITH_LIBR),1)
|
||||
$(MAKE) libr.${EXT_AR}
|
||||
$(MAKE) libr.${EXT_SO}
|
||||
endif
|
||||
|
||||
include ${SHLR}/zip/deps.mk
|
||||
|
||||
|
|
@ -250,4 +259,4 @@ mrproper:
|
|||
for LIB in ${LIBS}; do ( cd $${LIB} && $(MAKE) mrproper ); done
|
||||
|
||||
.PHONY: sloc mrproper clean pkgcfg install deinstall uninstall libr
|
||||
.PHONY: install-includes install-pkgconfig install-symlink all
|
||||
.PHONY: install-includes install-pkgconfig install-symlink all static sublibs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue