From 0323644051f4e3f1f82ab44037c490e2c92237fb Mon Sep 17 00:00:00 2001 From: "Fletcher T. Penney" Date: Wed, 11 Nov 2015 11:18:21 -0500 Subject: [PATCH] improve Makefile; add scan-build support --- Makefile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 8f2d5a3..b3dca8c 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,5 @@ BUILD_DIR = build -$(BUILD_DIR_): - -mkdir $(BUILD_DIR_) 2>/dev/null - -cd $(BUILD_DIR); rm -rf * - # The release target will perform additional optimization .PHONY : release release: $(BUILD_DIR) @@ -22,6 +18,13 @@ debug: $(BUILD_DIR) cd $(BUILD_DIR); \ cmake -DTEST=1 .. +# analyze target enables use of clang's scan-build (if installed) +# will then need to run 'scan-build make' to compile and analyze +.PHONY : analyze +analyze: $(BUILD_DIR) + cd $(BUILD_DIR); \ + scan-build cmake -DTEST=1 .. + # Create xcode project .PHONY : xcode xcode: $(BUILD_DIR) @@ -63,3 +66,9 @@ documentation: $(BUILD_DIR) .PHONY : clean clean: rm -rf $(BUILD_DIR)/* + +# Create build directory if it doesn't exist +$(BUILD_DIR): + -mkdir $(BUILD_DIR) 2>/dev/null + -cd $(BUILD_DIR); rm -rf * + -- 2.40.0