Add a lib name, configure, and makefile
This commit is contained in:
+31
@@ -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
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
SRCDIR="$(cd $(dirname $0) && pwd)"
|
||||
sed "s#%VPATH%#${SRCDIR}#" ${SRCDIR}/Makefile.in > Makefile
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#[link(name = "io_surface",
|
||||
vers = "0.1")];
|
||||
#[crate_type = "lib"];
|
||||
|
||||
extern mod core_foundation;
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user