]> granicus.if.org Git - multimarkdown/commitdiff
improve Makefile; add scan-build support
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Wed, 11 Nov 2015 16:18:21 +0000 (11:18 -0500)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Wed, 11 Nov 2015 16:18:21 +0000 (11:18 -0500)
Makefile

index 8f2d5a37166eddf57b80c31c485455d9b43c6e24..b3dca8c1ed48eec3be1f681701da92bd6d61a6ed 100644 (file)
--- 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 *
+