Skip to content

Commit

Permalink
lib_ustname:keep the incrementally compiled version time updated
Browse files Browse the repository at this point in the history
fix phoney target mismatch issue, always rebuild ustname

Signed-off-by: xuxin19 <[email protected]>
  • Loading branch information
xuxin930 committed Aug 13, 2024
1 parent 155517b commit cebac74
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions libs/libc/misc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,12 @@ if(CONFIG_FDCHECK)
list(APPEND SRCS lib_fdcheck.c)
endif()

if(NOT CONFIG_LIBC_UNAME_DISABLE_TIMESTAMP)
add_custom_target(
always_rebuild_lib_utsname
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_SOURCE_DIR}/lib_utsname.c)

add_dependencies(c always_rebuild_lib_utsname)
endif()

target_sources(c PRIVATE ${SRCS})
2 changes: 1 addition & 1 deletion libs/libc/misc/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ endif
# add lib_utsname.o to phony target for force rebuild

#if !defined(CONFIG_LIBC_UNAME_DISABLE_TIMESTAMP)
.PHONY: lib_utsname$(OBJEXT)
.PHONY: bin$(DELIM)lib_utsname$(OBJEXT) kbin$(DELIM)lib_utsname$(OBJEXT)
#endif

# Add the misc directory to the build
Expand Down

0 comments on commit cebac74

Please sign in to comment.