diff --git a/binary_sdk/component.mk b/binary_sdk/component.mk new file mode 100644 index 0000000..372fb4b --- /dev/null +++ b/binary_sdk/component.mk @@ -0,0 +1,5 @@ +# Component makefile for binary SDK components + +binary_sdk_SRC_DIR = $(binary_sdk_ROOT)libmain $(binary_sdk_ROOT)libnet80211 $(binary_sdk_ROOT)libphy $(binary_sdk_ROOT)libpp $(binary_sdk_ROOT)libwpa + +$(eval $(call component_compile_rules,binary_sdk)) diff --git a/binary_sdk/dump_libraries.sh b/binary_sdk/dump_libraries.sh new file mode 100755 index 0000000..baa5692 --- /dev/null +++ b/binary_sdk/dump_libraries.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# +# Simple bash script to regenerate a set of binary SDK subdirectories +# containing assembler code disassembled using xtobjdis. +# +# +INDIR=$1 +OUTDIR=$2 +if [ -z ${OUTDIR} ] || [ -z ${INDIR}; then + echo "Usage: $0 [Input library dir] [Output binary_sdk dir]" + exit 1 +fi + +INDIR=$(realpath ${INDIR}) +OUTDIR=$(realpath ${OUTDIR}) + +set -e -x + +for LIB in ${INDIR}/*.a; do + LIB=$(basename ${LIB%.a}) + echo $LIB + mkdir -p ${OUTDIR}/${LIB} + cd ${OUTDIR}/$LIB + ar x ${INDIR}/${LIB}.a + for O in *.o; do + O=${O%.o} + xtobjdis --rewrite-as-source ${O}.o > ${O}.S + rm ${O}.o + done +done + + diff --git a/common.mk b/common.mk index 7b236fb..89e2860 100644 --- a/common.mk +++ b/common.mk @@ -80,10 +80,11 @@ OBJDUMP = $(CROSS)objdump # Source components to compile and link. Each of these are subdirectories # of the root, with a 'component.mk' file. -COMPONENTS ?= $(EXTRA_COMPONENTS) FreeRTOS lwip core +COMPONENTS ?= $(EXTRA_COMPONENTS) FreeRTOS lwip core binary_sdk # binary esp-iot-rtos SDK libraries to link. These are pre-processed prior to linking. -SDK_LIBS ?= main net80211 phy pp wpa +#SDK_LIBS ?= main net80211 phy pp wpa +SDK_LIBS = # open source libraries linked in LIBS ?= hal gcc c