Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

47 lines (34 sloc) 1.004 kB
VPATH=%VPATH%
CXX ?= g++
RUSTC ?= rustc
AR ?= ar
RUSTFLAGS ?=
EXT_DEPS ?=
CFLAGS += -fPIC
RUSTDOC ?= rustdoc
RUSTDOC_FLAGS ?=
RUSTDOC_TARGET ?= doc
ifeq ($(shell $(CXX) -v 2>&1 | grep -c 'clang version\|Apple.*clang'),1)
CFLAGS += -Wno-c++0x-extensions -Wno-return-type-c-linkage -Wno-invalid-offsetof
endif
RUST_SRC = $(shell find $(VPATH)/src -type f -name '*.rs')
.PHONY: all
all: libjs.dummy
libjs.dummy: src/lib.rs $(RUST_SRC) libjsglue.a $(EXT_DEPS)
$(RUSTC) $(RUSTFLAGS) $< --out-dir .
touch $@
js-test: src/lib.rs $(RUST_SRC) libjsglue.a
$(RUSTC) $(RUSTFLAGS) $< -o $@ --test
libjsglue.a: jsglue.o
$(AR) rcs libjsglue.a jsglue.o
jsglue.o: src/jsglue.cpp
$(CXX) $(CFLAGS) -fno-rtti $< -o $@ -c
.PHONY: doc
doc: $(RUSTDOC_TARGET)/js/index.html
$(RUSTDOC_TARGET)/js/index.html: src/lib.rs $(RUST_SRC) libjsglue.a $(EXT_DEPS)
$(RUSTDOC) $(RUSTDOC_FLAGS) $< -o $(RUSTDOC_TARGET)
check: js-test
./js-test
.PHONY: clean
clean:
rm -f js-test *.o *.a *.so *.dylib *.rlib *.dll *.dummy
Jump to Line
Something went wrong with that request. Please try again.