Add a lib name, configure, and makefile

This commit is contained in:
Patrick Walton
2012-09-20 16:57:23 -07:00
parent 7b77ca7b9f
commit fe04eedea0
4 changed files with 39 additions and 1 deletions
+31
View File
@@ -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
Vendored
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
SRCDIR="$(cd $(dirname $0) && pwd)"
sed "s#%VPATH%#${SRCDIR}#" ${SRCDIR}/Makefile.in > Makefile
+2
View File
@@ -1,3 +1,5 @@
#[link(name = "io_surface",
vers = "0.1")];
#[crate_type = "lib"];
extern mod core_foundation;
+1 -1
View File
@@ -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;