diff --git a/Makefile.in b/Makefile.in index 7137aab..5062d5e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -3,6 +3,7 @@ VPATH=%VPATH% RUSTC ?= rustc RUSTDOC ?= rustdoc RUSTFLAGS ?= -O +HOST_RUSTFLAGS ?= -O PHF_SRC := $(VPATH)/src/phf.rs PHF_MAC_SRC := $(VPATH)/src/phf_mac.rs @@ -10,14 +11,22 @@ PHF_TEST_SRC := $(VPATH)/src/test.rs all: $(MAKE) phf.dummy + $(MAKE) phf_host.dummy $(MAKE) phf_mac.dummy phf.dummy: $(PHF_SRC) $(RUSTC) $(RUSTFLAGS) $< --out-dir . touch $@ +# phf_mac depends on phf, so it must be built once for +# the target platform, and again for the host platform. +phf_host.dummy: $(PHF_SRC) + mkdir -p host + $(RUSTC) $(HOST_RUSTFLAGS) $< --out-dir host + touch $@ + phf_mac.dummy: $(PHF_MAC_SRC) - $(RUSTC) $(RUSTFLAGS) -L . $< --out-dir . + $(RUSTC) $(HOST_RUSTFLAGS) -L host $< --out-dir . touch $@ check: phf_test.dummy @@ -26,6 +35,7 @@ phf_test.dummy: $(PHF_TEST_SRC) $(RUSTC) --test $(RUSTFLAGS) -L . $< --out-dir . clean: + rm -rf host rm -f *.o *.a *.so *.dylib *.rlib *.dll *.dummy *.exe *-test .PHONY: all check clean diff --git a/src/test.rs b/src/test.rs index 89d6d1d..446e7de 100644 --- a/src/test.rs +++ b/src/test.rs @@ -3,10 +3,9 @@ #[phase(syntax)] extern crate phf_mac; extern crate phf; -extern crate collections; mod map { - use collections::{HashMap, HashSet}; + use std::collections::{HashMap, HashSet}; use phf::PhfMap; #[allow(dead_code)] @@ -119,7 +118,7 @@ mod map { } mod set { - use collections::HashSet; + use std::collections::HashSet; use phf::PhfSet; #[allow(dead_code)]