From: Fletcher T. Penney Date: Wed, 11 Nov 2015 16:18:21 +0000 (-0500) Subject: improve Makefile; add scan-build support X-Git-Tag: 0.1.0a~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0323644051f4e3f1f82ab44037c490e2c92237fb;p=multimarkdown improve Makefile; add scan-build support --- 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 * +