Switch over to Makefile based builds

Rustpkg is not really usable
This commit is contained in:
Steven Fackler 2014-01-18 13:46:39 -08:00
parent b030a0b7e7
commit 96221c8a47
7 changed files with 45 additions and 16 deletions

4
.gitignore vendored
View File

@ -1,4 +1,2 @@
/.rust/
/doc/
/test
/rust-postgres
/build/

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "submodules/rust-openssl"]
path = submodules/rust-openssl
url = git://github.com/sfackler/rust-openssl

View File

@ -9,4 +9,4 @@ before_script:
- ./travis/setup.sh
script:
- make
- make test
- make check

View File

@ -1,15 +1,41 @@
RUSTPKG ?= rustpkg
RUSTC ?= rustc
RUST_FLAGS ?= -Z debug-info -O
export RUSTC = rustc
BUILDDIR = build
export RUSTFLAGS = -O -Z debug-info
all:
$(RUSTPKG) $(RUST_FLAGS) install
POSTGRES_LIB = lib.rs
POSTGRES = $(BUILDDIR)/$(shell $(RUSTC) --crate-file-name $(POSTGRES_LIB))
POSTGRES_TEST = $(BUILDDIR)/$(shell $(RUSTC) --test --crate-file-name $(POSTGRES_LIB))
OPENSSL_DIR = submodules/rust-openssl
OPENSSL = $(OPENSSL_DIR)/$(shell $(MAKE) -s -C $(OPENSSL_DIR) print-target)
test:
$(RUSTC) $(RUST_FLAGS) --test lib.rs
./rust-postgres
all: $(POSTGRES)
.PHONY: test
-include $(BUILDDIR)/postgres.d
-include $(BUILDDIR)/postgres_test.d
$(BUILDDIR):
mkdir -p $@
$(BUILDDIR)/rust-openssl-trigger: submodules/rust-openssl-trigger | $(BUILDDIR)
git submodule init
git submodule update
touch $@
$(OPENSSL): $(BUILDDIR)/rust-openssl-trigger | $(BUILDDIR)
$(MAKE) -C $(OPENSSL_DIR)
$(POSTGRES): $(POSTGRES_LIB) $(OPENSSL) | $(BUILDDIR)
$(RUSTC) $(RUSTFLAGS) --dep-info $(@D)/postgres.d --out-dir $(@D) \
-L $(dir $(OPENSSL)) $<
$(POSTGRES_TEST): $(POSTGRES_LIB) $(OPENSSL) | $(BUILDDIR)
$(RUSTC) $(RUSTFLAGS) --dep-info $(@D)/postgres_test.d --out-dir $(@D) \
-L $(dir $(OPENSSL)) --test $<
check: $(POSTGRES_TEST)
$<
clean:
rm -rf .rust rust-postgres rust-postgres.dSYM
rm -rf $(BUILDDIR)
.PHONY: all check clean

4
lib.rs
View File

@ -55,7 +55,7 @@ fn main() {
```
*/
#[crate_id="github.com/sfackler/rust-postgres"];
#[crate_id="github.com/sfackler/rust-postgres#postgres:0.0"];
#[crate_type="lib"];
#[doc(html_root_url="http://sfackler.github.io/rust-postgres/doc/")];
@ -65,7 +65,7 @@ fn main() {
#[macro_escape];
extern mod extra;
extern mod openssl = "github.com/sfackler/rust-openssl";
extern mod openssl;
use extra::container::Deque;
use extra::hex::ToHex;

@ -0,0 +1 @@
Subproject commit f6243490d3f600f7eb6e60d5bcd00c24bc1ba2e8

View File

@ -0,0 +1 @@
Sat Jan 18 13:39:47 PST 2014