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

feat: Handle arguments to build.sh #514

Closed
wants to merge 1 commit into from
Closed
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
22 changes: 13 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
.PHONY: all build_rust copy_library build_go clean
.PHONY: all clean

all: build_rust copy_library build_go
GO_BINARY=mautrix-signal

all: $(GO_BINARY)

LIBRARY_FILENAME=libsignal_ffi.a
RUST_DIR=pkg/libsignalgo/libsignal
GO_BINARY=mautrix-signal

# TODO fix linking with debug library
#ifneq ($(DBG),1)
Expand All @@ -13,16 +14,19 @@ RUST_TARGET_SUBDIR=release
#RUST_TARGET_SUBDIR=debug
#endif

build_rust:
./build-rust.sh
RUST_LIBRARY_DIR=$(RUST_DIR)/target/$(RUST_TARGET_SUBDIR)
RUST_LIBRARY=$(RUST_LIBRARY_DIR)/$(LIBRARY_FILENAME)

copy_library:
cp $(RUST_DIR)/target/$(RUST_TARGET_SUBDIR)/$(LIBRARY_FILENAME) .
$(RUST_LIBRARY):
./build-rust.sh

build_go:
LIBRARY_PATH="$${LIBRARY_PATH}:." ./build-go.sh
$(GO_BINARY): $(RUST_LIBRARY)
LIBRARY_PATH="${RUST_LIBRARY_DIR}:$${LIBRARY_PATH}" \
./build-go.sh $(GO_EXTRA_OPTS)

clean:
rm -f ./$(LIBRARY_FILENAME)
cd $(RUST_DIR) && cargo clean
rm -f $(GO_BINARY)

.PHONY: $(RUST_LIBRARY) $(GO_BINARY)
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
git submodule init
git submodule update
make
make GO_EXTRA_OPTS="$*"
Loading