-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'makefile' of github.com:telatin/fasten into telatin-mak…
…efile
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
# Bins: src/bin/*.rs -> target/debug/* | ||
DEBUG_BINS := $(patsubst src/bin/%.rs, target/debug/%, $(wildcard src/bin/*.rs)) | ||
|
||
# Bins: src/bin/*.rs -> target/release/* | ||
RELEASE_BINS := $(patsubst src/bin/%.rs, target/release/%, $(wildcard src/bin/*.rs)) | ||
|
||
all: $(DEBUG_BINS) $(DEBUG_LIBS) | ||
|
||
release: $(RELEASE_BINS) | ||
|
||
debug: $(DEBUG_BINS) | ||
|
||
$(DEBUG_BINS): | ||
cargo build | ||
echo "Built debug binaries at target/debug" | ||
|
||
# Rule to build release binaries | ||
$(RELEASE_BINS): | ||
cargo build --release | ||
echo "Built release binaries at target/release" | ||
|
||
# Test target: runs tests for each binary if corresponding script exists | ||
test: $(DEBUG_BINS) | ||
for bin in clean combine kmer metrics pe quality_filter randomize regex repair replace sample shuffle straighten trim validate sort progress mutate normalize convert inspect; do \ | ||
if [ -e ./tests/fasten_$$bin.sh ]; then \ | ||
bash ./tests/fasten_$$bin.sh; \ | ||
fi; \ | ||
done | ||
|
||
# Clean target: removes the target directories if they exist | ||
clean: | ||
if [[ -e ./target/debug ]]; then \ | ||
rm -rf ./target/debug; \ | ||
fi | ||
if [[ -e ./target/release ]]; then \ | ||
rm -rf ./target/release; \ | ||
fi |