diff --git a/Makefile b/Makefile index 96ffe70..d1f829c 100644 --- a/Makefile +++ b/Makefile @@ -15,26 +15,18 @@ classpathify = $(subst $(eval ) ,:,$1) HAREEXTRAPATH = $(HAREPATH) HAREEXTRAPATH += $(wildcard vendor/*) -all: proctest httpd threads - -proctest: $(wildcard cmd/proctest/*.ha) $(SOURCES) - HAREPATH=$(call classpathify,$(HAREEXTRAPATH)) \ - $(HARE) build $(HAREFLAGS) -o $@ cmd/$@/ +all: httpd httpd: $(wildcard cmd/httpd/*.ha) $(SOURCES) HAREPATH=$(call classpathify,$(HAREEXTRAPATH)) \ $(HARE) build $(HAREFLAGS) -o $@ cmd/$@/ -threads: $(wildcard cmd/threads/*.ha) $(SOURCES) - HAREPATH=$(call classpathify,$(HAREEXTRAPATH)) \ - $(HARE) build $(HAREFLAGS) -o $@ cmd/$@/ - check: HAREPATH=$(HAREPATH):$(HAREEXTRAPATH) \ $(HARE) test $(HAREFLAGS) clean: - rm -f proctest httpd threads + rm -f httpd install: httpd install -Dm755 web $(DESTDIR)$(BINDIR)/httpd diff --git a/cmd/proctest/main.ha b/cmd/proctest/main.ha deleted file mode 100644 index 8e48cc1..0000000 --- a/cmd/proctest/main.ha +++ /dev/null @@ -1,35 +0,0 @@ -use fmt; -use io; -use os::exec; -use os; -use strings; - -export fn main() void = { - let cmd = exec::cmd("./run.sh")!; - - let stdout_pipe = exec::pipe(); - exec::addfile(&cmd, os::stdout_file, stdout_pipe.1); - - let stderr_pipe = exec::pipe(); - exec::addfile(&cmd, os::stderr_file, stderr_pipe.1); - - let proc = exec::start(&cmd)!; - io::close(stdout_pipe.1)!; - io::close(stderr_pipe.1)!; - - let stdout_data = io::drain(stdout_pipe.0)!; - io::close(stdout_pipe.0)!; - - let stderr_data = io::drain(stderr_pipe.0)!; - io::close(stderr_pipe.0)!; - - let status = exec::wait(&proc)!; - let s = exec::exit(&status) as int; - fmt::printfln("status: {}", s)!; - - let out = strings::fromutf8(stdout_data) as str; - fmt::printfln("stdout:\n{}", out)!; - - let out = strings::fromutf8(stderr_data) as str; - fmt::printfln("stderr:\n{}", out)!; -}; diff --git a/cmd/threads/main.ha b/cmd/threads/main.ha deleted file mode 100644 index 02dbddf..0000000 --- a/cmd/threads/main.ha +++ /dev/null @@ -1,17 +0,0 @@ -use types::c; -use fmt; -use thread; - -fn thread_start(data: nullable *opaque) void = { - let arg = data: *u32; - fmt::printfln("hello from another thread. you sent: {}", *arg)!; -}; - -export fn main() void = { - fmt::println("starting a thread")!; - let tid = thread::spawn(&thread_start, &42)!; - - fmt::println("joining")!; - thread::join(tid)!; - fmt::println("joined. good bye.")!; -};