Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contributions related to Medium Article #11

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactoring to eliminate unnecessary dependencies for BSDL parsing
  • Loading branch information
nowinnovation authored and nOw Innovation committed Jun 8, 2022
commit 5cd743d69cdacefae6d0585a1797d4c9b3a74990
11 changes: 11 additions & 0 deletions lib_jtag_core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# CMakeLists files in this project can
# refer to the root source directory of the project as ${STREETVIEWJTAG_SOURCE_DIR} and
# to the root binary directory of the project as ${STREETVIEWJTAG_BINARY_DIR}.
cmake_minimum_required (VERSION 2.8.11)
project (STREETVIEWJTAG)

# Recurse into the "build", "src" and "test" subdirectories.
add_subdirectory (build)
add_subdirectory (src)
add_subdirectory (test)

5 changes: 5 additions & 0 deletions lib_jtag_core/build/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cmake_minimum_required (VERSION 2.8.11)

# Recurse into the "linux" subdirectory.
add_subdirectory (linux)

17 changes: 17 additions & 0 deletions lib_jtag_core/build/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cmake_minimum_required (VERSION 2.8.11)

# Build shared library in place for legacy support
add_custom_target(
libjtag_core ALL
COMMAND make all
COMMENT "Building shared library using legacy support"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

add_custom_target(
libjtag_static
COMMAND make libjtag_core.a
COMMENT "Building static library using legacy support"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

7 changes: 5 additions & 2 deletions lib_jtag_core/build/linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ LDFLAGS +=-arch i386 -dynamiclib -current_version 2.0 -install_name @executable_
EXEC=libjtag_core.dylib
endif

LIB_JTAG_CORE = jtag_core.o dbg_logs.o bsdl_loader.o bsdl_strings.o drv_loader.o script.o env.o fs.o os_interface.o network.o
LIB_JTAG_CORE = jtag_core.o dbg_logs.o bsdl_loader.o jtag_bsdl.o bsdl_strings.o drv_loader.o script.o env.o fs.o os_interface.o network.o
PROBES_DRIVERS = drivers_list.o jlink_jtag_drv.o linux_gpio_jtag_drv.o #lpt_jtag_drv.o ftdi_jtag_drv.o
PROTOCOLS_DRIVERS = i2c_over_jtag.o mdio_over_jtag.o spi_over_jtag.o memory_over_jtag.o
NATSORT = strnatcmp.o
Expand Down Expand Up @@ -55,6 +55,9 @@ dbg_logs.o: $(BASEDIR)/dbg_logs.c
bsdl_loader.o: $(BASEDIR)/bsdl_parser/bsdl_loader.c
$(CC) -o $@ -c $< $(CFLAGS)

jtag_bsdl.o: $(BASEDIR)/bsdl_parser/jtag_bsdl.c
$(CC) -o $@ -c $< $(CFLAGS)

bsdl_strings.o: $(BASEDIR)/bsdl_parser/bsdl_strings.c
$(CC) -o $@ -c $< $(CFLAGS)

Expand Down Expand Up @@ -113,6 +116,6 @@ clean:
rm -rf *.o

mrproper: clean
rm -rf $(EXEC)
rm -rf $(EXEC) libjtag_core.a

.PHONY: clean mrproper
9 changes: 9 additions & 0 deletions lib_jtag_core/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# build a reduced library that supports BSDL parsing only
set(JTAG_BSDL_SRC
bsdl_parser/jtag_bsdl.c
bsdl_parser/bsdl_strings.c
natsort/strnatcmp.c
)

add_library(jtag_bsdl ${JTAG_BSDL_SRC})

Loading