Add 'lib_only' build target.
authorngkaho1234 <ngkaho1234@gmail.com>
Sat, 23 Jan 2016 03:28:20 +0000 (03:28 +0000)
committerngkaho1234 <ngkaho1234@gmail.com>
Sat, 23 Jan 2016 05:48:11 +0000 (05:48 +0000)
Under this target, only a basic library will be built.

CMakeLists.txt
Makefile
lwext4/CMakeLists.txt

index 33bdb234e77c64aadcddfe64dedd0ab92a861583..b226830631aad446335d7bb1bb5aa5b6273185c5 100644 (file)
@@ -27,6 +27,12 @@ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL  msp430g2210)
     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)
index 023797b350a4989f54c49302e2b3b2bd71695867..1a5ae08b7b79249660ce1cd3a4e7d96958c02b0a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -77,8 +77,13 @@ arm-sim:
        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:
index da4b4a090e90cbbcd37f28d2bf1f8f2e776206c8..78b233d72e7ca3de581695544a815ad038fd1333 100644 (file)
@@ -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()