Skip to content

Commit

Permalink
Merge pull request #614 from DrTimothyAldenDavis/dev2
Browse files Browse the repository at this point in the history
build system: split "make distclean/purge" for root CMakeLists.txt and root Makefile
  • Loading branch information
DrTimothyAldenDavis authored Dec 21, 2023
2 parents 79f654b + 1692b35 commit 1c70a34
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 19 deletions.
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -505,3 +505,19 @@ include ( SuiteSparseReport )

include ( CTest )

#-------------------------------------------------------------------------------
# rule to remove all files in build directory
#-------------------------------------------------------------------------------

file ( GLOB SUITESPARSE_BUILT_FILES ${PROJECT_BINARY_DIR}/* )
file ( REAL_PATH ${PROJECT_SOURCE_DIR} _real_project_source_dir )
file ( REAL_PATH ${PROJECT_BINARY_DIR} _real_project_binary_dir )
if ( _real_project_source_dir STREQUAL _real_project_binary_dir )
add_custom_target ( purge
COMMENT "The target 'purge' is a no-op for in-tree builds. Consider building out of the source tree." )
else ( )
add_custom_target ( purge
COMMAND ${CMAKE_COMMAND} -E echo "Removing files..."
COMMAND ${CMAKE_COMMAND} -E rm -rf ${SUITESPARSE_BUILT_FILES}
COMMENT "Purge all files in the build tree" )
endif ( )
3 changes: 2 additions & 1 deletion GraphBLAS/JITpackage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
cmake_minimum_required ( VERSION 3.20 ) # GraphBLAS can be built stand-alone
project ( jitpackage LANGUAGES C )
add_executable ( grb_jitpackage "Source/grb_jitpackage.c" )
target_include_directories ( grb_jitpackage PRIVATE ../zstd/zstd_subset )
target_include_directories ( grb_jitpackage PRIVATE ../zstd/zstd_subset
../zstd )
if ( NOT WIN32 )
target_link_libraries ( grb_jitpackage PRIVATE m )
endif ( )
Expand Down
2 changes: 1 addition & 1 deletion GraphBLAS/JITpackage/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#-------------------------------------------------------------------------------

go:
( cd build && cmake $(CMAKE_OPTIONS) .. && cmake --build . )
( cd build && cmake $(CMAKE_OPTIONS) .. && cmake --build . && cmake --build . --target GB_JITpackage )

clean: distclean

Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ purge:
- ( cd ParU && $(MAKE) purge )
- ( cd LAGraph && $(MAKE) purge )
- $(RM) -r include/* bin/* lib/*
- $(RM) -r build/*

clean: purge

Expand Down
32 changes: 16 additions & 16 deletions Mongoose/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -520,22 +520,22 @@ if ( BUILD_TESTING )

endif ( )

add_custom_target ( purge
COMMAND rm -rf ${PROJECT_BINARY_DIR}/*
# COMMAND rm -f ${PROJECT_SOURCE_DIR}/Lib/libmongoose.*
COMMAND rm -f ${PROJECT_SOURCE_DIR}/Doc/title-info.tex
COMMAND rm -f ${PROJECT_SOURCE_DIR}/Doc/title-info.tex.aux
COMMAND rm -f ${PROJECT_SOURCE_DIR}/Doc/Mongoose_UserGuide.idx
COMMAND rm -f ${PROJECT_SOURCE_DIR}/Doc/Mongoose_UserGuide.log
COMMAND rm -f ${PROJECT_SOURCE_DIR}/Doc/Mongoose_UserGuide.out
COMMAND rm -f ${PROJECT_SOURCE_DIR}/Doc/Mongoose_UserGuide.aux
COMMAND rm -f ${PROJECT_SOURCE_DIR}/Doc/Mongoose_UserGuide.toc
COMMAND rm -f ${PROJECT_SOURCE_DIR}/Doc/Mongoose_UserGuide.bbl
COMMAND rm -f ${PROJECT_SOURCE_DIR}/Doc/Mongoose_UserGuide.blg
COMMAND rm -f ${PROJECT_SOURCE_DIR}/Matrix/*.tar.gz
COMMAND rm -f ${PROJECT_SOURCE_DIR}/Matrix/*.csv
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)
#add_custom_target ( purge
# COMMAND rm -rf ${PROJECT_BINARY_DIR}/*
## COMMAND rm -f ${PROJECT_SOURCE_DIR}/Lib/libmongoose.*
# COMMAND rm -f ${PROJECT_SOURCE_DIR}/Doc/title-info.tex
# COMMAND rm -f ${PROJECT_SOURCE_DIR}/Doc/title-info.tex.aux
# COMMAND rm -f ${PROJECT_SOURCE_DIR}/Doc/Mongoose_UserGuide.idx
# COMMAND rm -f ${PROJECT_SOURCE_DIR}/Doc/Mongoose_UserGuide.log
# COMMAND rm -f ${PROJECT_SOURCE_DIR}/Doc/Mongoose_UserGuide.out
# COMMAND rm -f ${PROJECT_SOURCE_DIR}/Doc/Mongoose_UserGuide.aux
# COMMAND rm -f ${PROJECT_SOURCE_DIR}/Doc/Mongoose_UserGuide.toc
# COMMAND rm -f ${PROJECT_SOURCE_DIR}/Doc/Mongoose_UserGuide.bbl
# COMMAND rm -f ${PROJECT_SOURCE_DIR}/Doc/Mongoose_UserGuide.blg
# COMMAND rm -f ${PROJECT_SOURCE_DIR}/Matrix/*.tar.gz
# COMMAND rm -f ${PROJECT_SOURCE_DIR}/Matrix/*.csv
# WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
# )

add_custom_target(userguide
COMMAND make
Expand Down

0 comments on commit 1c70a34

Please sign in to comment.