Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✏️ update compilation guide in README.md #131

Merged
merged 3 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
UNAME_S := $(shell uname -s)

# Default target on Linux
ifeq ($(UNAME_S), Linux)
RELEASE_TARGET := build-g++
DEBUG_TARGET := debug-g++
endif

# Default target on macOS (Darwin)
ifeq ($(UNAME_S), Darwin)
RELEASE_TARGET := build-clang++
DEBUG_TARGET := debug-clang++
endif

all: build

build:
cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=Release
build: $(RELEASE_TARGET)

build-g++:
cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=$(shell which g++)
$(MAKE) -C build

# force macos to use the clang++ installed by brew instead of the default one
Expand All @@ -14,8 +30,10 @@ build-clang++:
build-docker:
docker build -f docker/dev.Dockerfile -t qsyn-local .

debug:
cmake -S . -B debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=Debug
debug: $(DEBUG_TARGET)

debug-g++:
cmake -S . -B debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=$(shell which g++)
$(MAKE) -C debug

# force macos to use the clang++ installed by brew instead of the default one
Expand Down Expand Up @@ -54,9 +72,13 @@ clean:
rm -rf build
rm -f qsyn

clean-debug:
rm -rf debug
rm -f qsyn-debug

clean-docker:
docker container prune -f
docker rmi qsyn-test-gcc -f
docker rmi qsyn-test-clang -f

.PHONY: all build build-clang++ debug debug-clang++ test test-docker test-update lint publish clean clean-docker
.PHONY: all build build-g++ build-clang++ debug debug-g++ debug-clang++ test test-docker test-update lint publish clean clean-debug clean-docker
Loading
Loading