Permalink
Browse files

Add a makefile and configure script; update test for language changes

  • Loading branch information...
1 parent 323c43c commit 86020497ca912264b01a705ae9a8b18df6b3687a @pcwalton pcwalton committed Jul 5, 2012
Showing with 39 additions and 4 deletions.
  1. +31 −0 Makefile.in
  2. +5 −0 configure
  3. +3 −4 test.rs
View
@@ -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: librustlayers.dummy
+
+%.o: %.c
+ $(CC) $< -o $@ -c $(CFLAGS)
+
+librustlayers.dummy: layers.rc $(RUST_SRC)
+ $(RUSTC) $(RUSTFLAGS) $< -o $@
+ touch $@
+
+layers-test: layers.rc $(RUST_SRC)
+ $(RUSTC) $(RUSTFLAGS) $< -o $@ --test
+
+check: rustlayers-test
+ ./rustlayers-test
+
+.PHONY: clean
+clean:
+ rm -f *.o *.a *.so *.dylib *.dll *.dummy
+
View
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+SRCDIR="$(cd $(dirname $0) && pwd)"
+sed "s#%VPATH%#${SRCDIR}#" ${SRCDIR}/Makefile.in > Makefile
+
View
@@ -99,9 +99,7 @@ fn test_triangle_and_square() unsafe {
let port: port<()> = port();
let chan = chan(port);
- let _result_ch: chan<()> = run_listener(builder, {
- |_port|
-
+ let _result_ch: chan<()> = do run_listener(builder) |port| {
let renderer = @Renderer();
init();
@@ -111,7 +109,8 @@ fn test_triangle_and_square() unsafe {
glutMainLoop();
send(chan, ());
- });
+ };
+
recv(port);
}

0 comments on commit 8602049

Please sign in to comment.