Skip to content

Commit

Permalink
Merge branch 'makefile' of github.com:telatin/fasten into telatin-mak…
Browse files Browse the repository at this point in the history
…efile
  • Loading branch information
lskatz committed Feb 5, 2024
2 parents 4201a65 + 0838287 commit 66e0ea4
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Makefile
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

0 comments on commit 66e0ea4

Please sign in to comment.