Commit 7ebd3e6b authored by Mart Lubbers's avatar Mart Lubbers
Browse files

Separate different platforms

parent 81da09b8
Clean System Files/[^.]* Clean System Files
TTY TTY
sapl sapl
test test
......
CLEAN_HOME?=/opt/clean CLEAN_HOME?=/opt/clean
test: test.icl TTY.icl TTY.dcl Clean\ System\ Files/ctty.o
clm -dynamics -I $(CLEAN_HOME)/lib/Dynamics $(basename $<) -o $@
ifeq ($(OS), Windows_NT) ifeq ($(OS), Windows_NT)
Clean\ System\ Files/ctty.o: tty_win.c DETECTED_OS=Windows
else else
Clean\ System\ Files/ctty.o: tty_posix.c DETECTED_OS=POSIX
endif endif
test: test.icl TTY.icl TTY.dcl Clean\ System\ Files/ctty.o
clm -dynamics -I $(DETECTED_OS) -I $(CLEAN_HOME)/lib/Dynamics $(basename $<) -o $@
Clean\ System\ Files/ctty.o: $(DETECTED_OS)/tty.c
mkdir -p Clean\ System\ Files mkdir -p Clean\ System\ Files
gcc -c $< -o "$@" gcc -c "$<" -o "$@"
clean: clean:
$(RM) -r Clean\ System\ Files/* test $(RM) -r $(DETECTED_OS)/Clean\ System\ Files/* Clean\ System\ Files/* test
definition module Platform
implementation module Platform
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <termios.h> #include <termios.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include "Clean.h" #include "../Clean.h"
#ifdef DEBUG #ifdef DEBUG
#define debug(s) {puts(s); fflush(stdout);} #define debug(s) {puts(s); fflush(stdout);}
......
...@@ -2,4 +2,9 @@ ...@@ -2,4 +2,9 @@
Serial port library for [clean](http://clean.cs.ru.nl). Build with `make`. Serial port library for [clean](http://clean.cs.ru.nl). Build with `make`.
Tested on Linux and Mac, windows is not supported. Tested on Linux and Mac
Windows support is only available at the moment as a stub.
The functions are not implemented so it will crash.
On windows you need mingw to compile
...@@ -4,6 +4,7 @@ import _SystemArray ...@@ -4,6 +4,7 @@ import _SystemArray
import StdClass import StdClass
import StdString import StdString
import StdChar import StdChar
import Platform
import code from "ctty." import code from "ctty."
......
definition module Platform
implementation module Platform
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
//#include <termios.h> //#include <termios.h>
//#include <sys/ioctl.h> //#include <sys/ioctl.h>
#include "Clean.h" #include "../Clean.h"
#ifdef DEBUG #ifdef DEBUG
#define debug(s) {puts(s); fflush(stdout);} #define debug(s) {puts(s); fflush(stdout);}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment