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

Makefile: update the process to include new multihop dependencies #160

Merged
merged 2 commits into from
Oct 26, 2023
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
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
$MAKEFILES = $(shell find . -maxdepth 3 -type f -name Makefile)
SUBDIRS = $(filter-out ./,$(dir $($MAKEFILES)))
SUBDIRS := contracts/factory contracts/multihop contracts/pool contracts/pool_stable contracts/stake contracts/token
BUILD_FLAGS ?=

default: build

all: test

build:
@for dir in $(SUBDIRS) ; do \
$(MAKE) -C $$dir build || exit 1; \
$(MAKE) -C $$dir build BUILD_FLAGS=$(BUILD_FLAGS) || exit 1; \
done

test: build
@for dir in $(SUBDIRS) ; do \
$(MAKE) -C $$dir test || exit 1; \
$(MAKE) -C $$dir test BUILD_FLAGS=$(BUILD_FLAGS) || exit 1; \
done

fmt:
Expand All @@ -21,6 +21,9 @@ fmt:
done

lints: fmt
@for dir in contracts/multihop contracts/pool ; do \
$(MAKE) -C $$dir build || exit 1; \
done
@for dir in $(SUBDIRS) ; do \
$(MAKE) -C $$dir clippy || exit 1; \
done
Expand Down
9 changes: 7 additions & 2 deletions contracts/factory/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
ifeq (,$(BUILD_FLAGS))
DEPS = ../stake ../pool
endif

default: all

all: lint build test
Expand All @@ -6,8 +10,9 @@ test: build # because of token dependency
cargo test

build:
$(MAKE) -C ../stake build || break;
$(MAKE) -C ../pair build || break;
@for dir in $(DEPS) ; do \
$(MAKE) -C $$dir build || break; \
done
cargo build --target wasm32-unknown-unknown --release

lint: fmt clippy
Expand Down
9 changes: 7 additions & 2 deletions contracts/multihop/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
ifeq (,$(BUILD_FLAGS))
DEPS = ../factory ../pool
endif

default: all

all: lint build test
Expand All @@ -8,8 +12,9 @@ test:
cargo test

build:
$(MAKE) -C ../factory build || break;
$(MAKE) -C ../pool build || break;
@for dir in $(DEPS) ; do \
$(MAKE) -C $$dir build || break; \
done
cargo build --target wasm32-unknown-unknown --release

lint: fmt clippy
Expand Down