From fe04eedea0cdb6ea6950b32264249d5a2aeca13d Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 20 Sep 2012 16:57:23 -0700 Subject: [PATCH] Add a lib name, configure, and makefile --- Makefile.in | 31 +++++++++++++++++++++++++++++++ configure | 5 +++++ io_surface.rc | 2 ++ io_surface.rs | 2 +- 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 Makefile.in create mode 100644 configure diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..b23b357 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,31 @@ +VPATH=%VPATH% + +CC ?= gcc +CXX ?= g++ +CXXFLAGS ?= +AR ?= ar +RUSTC ?= rustc +RUSTFLAGS ?= + +RUST_SRC=$(shell find $(VPATH)/. -type f -name '*.rs') + +.PHONE: all +all: librustiosurface.dummy + +%.o: %.c + $(CC) $< -o $@ -c $(CFLAGS) + +librustiosurface.dummy: io_surface.rc $(RUST_SRC) + $(RUSTC) $(RUSTFLAGS) $< -o $@ + touch $@ + +rustiosurface-test: io_surface.rc $(RUST_SRC) + $(RUSTC) $(RUSTFLAGS) $< -o $@ --test + +check: rustiosurface-test + ./rustiosurface-test + +.PHONY: clean +clean: + rm -f *.o *.a *.so *.dylib *.dll *.dummy + diff --git a/configure b/configure new file mode 100644 index 0000000..ed6c06e --- /dev/null +++ b/configure @@ -0,0 +1,5 @@ +#!/bin/bash + +SRCDIR="$(cd $(dirname $0) && pwd)" +sed "s#%VPATH%#${SRCDIR}#" ${SRCDIR}/Makefile.in > Makefile + diff --git a/io_surface.rc b/io_surface.rc index a13a2cb..ad63cfb 100644 --- a/io_surface.rc +++ b/io_surface.rc @@ -1,3 +1,5 @@ +#[link(name = "io_surface", + vers = "0.1")]; #[crate_type = "lib"]; extern mod core_foundation; diff --git a/io_surface.rs b/io_surface.rs index 5a3d5de..651c6d4 100644 --- a/io_surface.rs +++ b/io_surface.rs @@ -4,7 +4,7 @@ use core_foundation::base::{AbstractCFType, CFRelease, CFType, CFTypeOps, CFType use core_foundation::dictionary::{CFDictionary, CFDictionaryRef}; use core_foundation::number::CFNumber; use core_foundation::string::{CFString, CFStringRef}; -use unsafe::transmute; +use cast::transmute; struct __IOSurface { private: () } pub type IOSurfaceRef = *__IOSurface;