shithub: lwext4

Download patch

ref: e1bbe336d1736703a6b1565cfa5565fb276643a1
parent: 2df08d93f8dda03f5cf3bb9c6928626540b9ef32
author: ngkaho1234 <ngkaho1234@gmail.com>
date: Fri Jan 22 22:28:20 EST 2016

Add 'lib_only' build target.

Under this target, only a basic library will be built.

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,6 +27,12 @@
     add_definitions(-DCONFIG_DEBUG_PRINTF=0)
     add_definitions(-DCONFIG_DEBUG_ASSERT=0)
     #...
+elseif(LIB_ONLY)
+    add_definitions(-DCONFIG_DEBUG_PRINTF=0)
+    add_definitions(-DCONFIG_DEBUG_ASSERT=0)
+    add_definitions(-DCONFIG_HAVE_OWN_OFLAGS=1)
+    add_definitions(-DCONFIG_HAVE_OWN_ERRNO=1)
+    add_definitions(-DCONFIG_BLOCK_DEV_CACHE_SIZE=16)
 else()
     #Generic example target
     set(BLOCKDEV_TYPE  linux)
--- a/Makefile
+++ b/Makefile
@@ -77,8 +77,13 @@
 	cd build_arm-sim && cmake -G"Unix Makefiles"         \
 	$(COMMON_DEFINITIONS)                                \
 	-DCMAKE_TOOLCHAIN_FILE=../toolchain/arm-sim.cmake ..
-	
-all: generic bf518 cortex-m3 cortex-m4 generic
+
+lib_only:
+	rm -R -f build_lib_only
+	mkdir build_lib_only
+	cd build_lib_only && cmake $(COMMON_DEFINITIONS) -DLIB_ONLY=TRUE ..
+
+all: generic bf518 cortex-m3 cortex-m4 lib_only
 
 
 clean:
--- a/lwext4/CMakeLists.txt
+++ b/lwext4/CMakeLists.txt
@@ -3,6 +3,8 @@
 include_directories(.)
 aux_source_directory(. LWEXT4_SRC)
 add_library(lwext4  ${LWEXT4_SRC})
-add_custom_target(lib_size ALL DEPENDS lwext4 COMMAND ${SIZE} liblwext4.a)
+if  (DEFINED SIZE)
+    add_custom_target(lib_size ALL DEPENDS lwext4 COMMAND ${SIZE} liblwext4.a)
+else()
 
-
+endif()