MultiMarkdown-6/Makefile

128 lines
3.6 KiB
Makefile
Raw Normal View History

2015-06-13 21:59:00 +03:00
BUILD_DIR = build
2017-01-19 06:43:15 +03:00
DOC_DIR = documentation
XCODE_BUILD_DIR = build-xcode
XCODE_DEBUG_BUILD_DIR = build-xcode-debug
2015-06-13 21:59:00 +03:00
# The release target will perform additional optimization
2015-06-29 00:50:35 +03:00
.PHONY : release
2015-06-13 21:59:00 +03:00
release: $(BUILD_DIR)
cd $(BUILD_DIR); \
cmake -DCMAKE_BUILD_TYPE=Release ..
2017-02-28 18:34:40 +03:00
# Also build a shared library
.PHONY : shared
shared: $(BUILD_DIR)
cd $(BUILD_DIR); \
cmake -DCMAKE_BUILD_TYPE=Release -DSHAREDBUILD=1 ..
# Build zip file package
.PHONY : zip
zip: $(BUILD_DIR)
cd $(BUILD_DIR); touch README.html; \
cmake -DCMAKE_BUILD_TYPE=Release -DZIP=1 ..
# debug target enables CuTest unit testing
2015-06-29 00:50:35 +03:00
.PHONY : debug
2015-06-13 21:59:00 +03:00
debug: $(BUILD_DIR)
cd $(BUILD_DIR); \
2017-01-19 06:43:15 +03:00
cmake -DTEST=1 DCMAKE_BUILD_TYPE=DEBUG ..
2015-06-13 21:59:00 +03:00
# analyze target enables use of clang's scan-build (if installed)
# will then need to run 'scan-build make' to compile and analyze
# 'scan-build -V make' will show the results graphically in your
# web browser
.PHONY : analyze
analyze: $(BUILD_DIR)
cd $(BUILD_DIR); \
2017-01-19 06:43:15 +03:00
scan-build cmake -DTEST=1 DCMAKE_BUILD_TYPE=DEBUG ..
.PHONY : map
map:
cd $(BUILD_DIR); \
../tools/enumsToPerl.pl ../Sources/libMultiMarkdown/include/libMultiMarkdown.h enumMap.txt;
# Create xcode project
2015-11-13 00:14:22 +03:00
# You can then build within XCode, or using the commands:
# xcodebuild -configuration Debug
# xcodebuild -configuration Release
2015-06-29 00:50:35 +03:00
.PHONY : xcode
2017-01-19 06:43:15 +03:00
xcode: $(XCODE_BUILD_DIR)
cd $(XCODE_BUILD_DIR); \
2015-06-13 21:59:00 +03:00
cmake -G Xcode ..
.PHONY : xcode-debug
xcode-debug: $(XCODE_DEBUG_BUILD_DIR)
cd $(XCODE_DEBUG_BUILD_DIR); \
cmake -G Xcode -DTEST=1 ..
# Build Swift debug variant
.PHONY : swift
swift: $(BUILD_DIR)
swift build -c debug --build-path ${BUILD_DIR} -Xcc -fbracket-depth=264
# Build Swift release variant
.PHONY : swift-release
swift-release: $(BUILD_DIR)
swift build -c release --build-path ${BUILD_DIR} -Xcc -fbracket-depth=264 -Xcc -DNDEBUG=1
# Cross-compile for Windows using MinGW on *nix
2015-06-29 00:50:35 +03:00
.PHONY : windows
2015-06-13 21:59:00 +03:00
windows: $(BUILD_DIR)
cd $(BUILD_DIR); touch README.html; \
cmake -DCMAKE_TOOLCHAIN_FILE=../tools/Toolchain-MinGW-w64-64bit.cmake -DCMAKE_BUILD_TYPE=Release ..
# Build Windows zip file using MinGW on *nix
.PHONY : windows-zip
windows-zip: $(BUILD_DIR)
cd $(BUILD_DIR); touch README.html; \
cmake -DCMAKE_TOOLCHAIN_FILE=../tools/Toolchain-MinGW-w64-64bit.cmake -DCMAKE_BUILD_TYPE=Release -DZIP=1 ..
# Cross-compile for Windows using MinGW on *nix (32-bit)
.PHONY : windows-32
windows-32: $(BUILD_DIR)
cd $(BUILD_DIR); touch README.html; \
cmake -DCMAKE_TOOLCHAIN_FILE=../tools/Toolchain-MinGW-w64-32bit.cmake -DCMAKE_BUILD_TYPE=Release ..
2015-06-13 21:59:00 +03:00
# Build Windows zip file using MinGW on *nix (32-bit)
.PHONY : windows-zip-32
windows-zip-32: $(BUILD_DIR)
cd $(BUILD_DIR); touch README.html; \
cmake -DCMAKE_TOOLCHAIN_FILE=../tools/Toolchain-mingw32.cmake -DCMAKE_BUILD_TYPE=Release -DZIP=1 ..
2015-06-14 15:23:41 +03:00
# Build the documentation using doxygen
2015-06-29 00:50:35 +03:00
.PHONY : documentation
2017-01-19 06:43:15 +03:00
documentation:
-mkdir $(DOC_DIR) 2>/dev/null; \
cd $(DOC_DIR); \
2015-06-14 15:23:41 +03:00
cmake -DDOCUMENTATION=1 ..; cd ..; \
2017-01-19 06:43:15 +03:00
doxygen $(DOC_DIR)/doxygen.conf
2015-06-14 15:23:41 +03:00
.PHONY : gh-pages
gh-pages: documentation
cp -r $(BUILD_DIR)/documentation/html/* documentation/
2015-06-13 21:59:00 +03:00
# Clean out the build directory
2015-06-29 00:50:35 +03:00
.PHONY : clean
2015-06-13 21:59:00 +03:00
clean:
rm -rf $(BUILD_DIR)/*
# Create build directory if it doesn't exist
$(BUILD_DIR): CHANGELOG
-mkdir $(BUILD_DIR) 2>/dev/null
-cd $(BUILD_DIR); rm -rf *
# Build xcode directories if they don't exist
$(XCODE_BUILD_DIR):
-mkdir $(XCODE_BUILD_DIR) 2>/dev/null
-cd $(XCODE_BUILD_DIR); rm -rf *
$(XCODE_DEBUG_BUILD_DIR):
-mkdir $(XCODE_DEBUG_BUILD_DIR) 2>/dev/null
-cd $(XCODE_DEBUG_BUILD_DIR); rm -rf *
# Generate a list of changes since last commit to 'master' branch
.PHONY : CHANGELOG
CHANGELOG:
git log master..develop --format="* %s" | sort | uniq > CHANGELOG-UNRELEASED