Commit 4a24cda9 authored by Mart Lubbers's avatar Mart Lubbers

Cleanup, new packages

parent f9ce405f
linux:
image: gcc:latest
script:
- cd src
- make
- mkdir CleanSerial
- mv -v "Clean System Files" {TTY,iTasksTTY}.[id]cl POSIX/Platform.[id]cl CleanSerial
- tar czf ../CleanSerial-linux-x64.tar.gz CleanSerial
artifacts:
paths:
- ./*.tar.gz
windows-x86:
pkg:
image: debian:latest
script:
before_script:
- apt-get update -qq
- apt-get install -yy build-essential gcc-mingw-w64 zip
- cd src
- make DETECTED_OS=Windows CC=x86_64-w64-mingw32-gcc-win32 CFLAGS=-m32
- mkdir CleanSerial
- mv -v "Clean System Files" {TTY,iTasksTTY}.[id]cl Windows/Platform.[id]cl CleanSerial
- zip -rv ../CleanSerial-windows-x86.zip CleanSerial
artifacts:
paths:
- ./*.zip
windows-x64:
image: debian:latest
script:
- apt-get update -qq
- apt-get install -yy build-essential gcc-mingw-w64 zip
- cd src
- make DETECTED_OS=Windows CC=x86_64-w64-mingw32-gcc CFLAGS=-m64
- mkdir CleanSerial
- mv -v "Clean System Files" {TTY,iTasksTTY}.[id]cl Windows/Platform.[id]cl CleanSerial
- zip -rv ../CleanSerial-windows-x64.zip CleanSerial
- ./pkg.sh
artifacts:
paths:
- ./*.tar.gz
- ./*.zip
CFLAGS?=-Wall -Wextra
ifeq ($(OS), Windows_NT)
DETECTED_OS?=Windows
CC=gcc
PLATFORMDIR=src-windows
else
DETECTED_OS?=POSIX
PLATFORMDIR=src-posix
endif
LIBFILES=$(wildcard $(PLATFORMDIR)/CleanSerial/*library)
VPATH = src:./csource
all: $(addprefix src/Clean\ System\ Files/,ctty.o $(LIBFILES))
src/Clean\ System\ Files/%: %
mkdir -p "src/Clean System Files"
cp "$<" "src/Clean System Files"
ctty.o: tty.c
$(COMPILE.c) $(OUTPUT_OPTION) $<
clean:
$(RM) -rf *.o $(addsuffix /Clean\ System\ Files,src $(PLATFORMDIR)) CleanSerial
pkg: all
mkdir CleanSerial
cp -R src/* CleanSerial
cp -R $(PLATFORMDIR)/* CleanSerial
......@@ -2,10 +2,9 @@
Serial port library for [clean](http://clean.cs.ru.nl). Build with `make`.
Linux x64, mac x64 and windows x86 and x64 supported.
Autobuilds are available for [linux x64][linux64], windows [x86][windows86] and [x64][windows64].
The autobuilds can be extracted in the lib folder on linux or the Libraries
folder on windows
Linux x86, linux x64, mac x64, windows x86 and windows x64 are supported.
Autobuilds are available for [linux x86][linux86] [linux x64][linux64], windows [x86][windows86] and [x64][windows64].
The autobuilds can be extracted in the lib folder on linux or the Libraries folder on windows
## Build it yourself
### Linux and mac
......@@ -15,8 +14,9 @@ Run `make`.
Run `make` in a mingw msys2 shell.
### Build the windows version on another OS
See `.gitlab-ci.yml`
See `pkgs.sh`
[linux64]: https://gitlab.science.ru.nl/mlubbers/CleanSerial/builds/artifacts/master/file/CleanSerial-linux-x64.tar.gz?job=linux
[windows64]: https://gitlab.science.ru.nl/mlubbers/CleanSerial/builds/artifacts/master/file/CleanSerial-windows-x64.zip?job=windows-x64
[windows86]: https://gitlab.science.ru.nl/mlubbers/CleanSerial/builds/artifacts/master/file/CleanSerial-windows-x86.zip?job=windows-x86
[linux86]: https://gitlab.science.ru.nl/mlubbers/CleanSerial/builds/artifacts/master/file/CleanSerial-linux-x86.tar.gz?job=pkg
[linux64]: https://gitlab.science.ru.nl/mlubbers/CleanSerial/builds/artifacts/master/file/CleanSerial-linux-x64.tar.gz?job=pkg
[windows64]: https://gitlab.science.ru.nl/mlubbers/CleanSerial/builds/artifacts/master/file/CleanSerial-windows-x64.zip?job=pkg
[windows86]: https://gitlab.science.ru.nl/mlubbers/CleanSerial/builds/artifacts/master/file/CleanSerial-windows-x86.zip?job=pkg
......@@ -8,7 +8,7 @@ import System.Time
import iTasks
import TTY, iTasksTTY
import CleanSerial, CleanSerial.iTasks
Start w = flip doTasks w $
parallel [] [OnAction (Action "+") $ always (Embedded, addDevice)]
......
#!/bin/bash
set -e
trap "rm -rf CleanSerial" EXIT
mkpkg() {
rm -rf CleanSerial
mkdir -p CleanSerial
make -B $1 -C src clean all
cp -Rv src/"Clean System Files" CleanSerial
cp -v src/{TTY,iTasksTTY}.[id]cl src/$2/Platform.[id]cl CleanSerial
file CleanSerial/*/*.o
$3 CleanSerial-$4 CleanSerial
}
#linux
mkpkg "" POSIX "tar -czvf" linux64.tar.gz
#windows64
mkpkg "DETECTED_OS=Windows CC=x86_64-w64-mingw32-gcc CFLAGS=-m64" Windows "zip -rv" win64.zip
#windows32
mkpkg "DETECTED_OS=Windows CC=x86_64-w64-mingw32-gcc-win32 CFLAGS=-m32" Windows "zip -rv" win32.zip
#/bin/sh
# 64 bit linux
make clean pkg
tar czf CleanSerial-linux-x64.tar.gz CleanSerial
# 32 bit linux
make CFLAGS=-m32 clean pkg
tar czf CleanSerial-linux-x86.tar.gz CleanSerial
make clean
# 64 bit windows
make DETECTED_OS=Windows CC=x86_64-w64-mingw32-gcc-win32 CFLAGS=-m64 PLATFORMDIR=src-windows pkg
zip -rq CleanSerial-windows-x64.zip CleanSerial
# 32 bit windows
make DETECTED_OS=Windows CC=x86_64-w64-mingw32-gcc-win32 CFLAGS=-m32 PLATFORMDIR=src-windows clean pkg
zip -rq CleanSerial-windows-x86.zip CleanSerial
definition module Platform
definition module CleanSerial.Platform
getDevices :: !*World -> *([String], !*World)
implementation module Platform
implementation module CleanSerial.Platform
import Data.Error
import StdMisc, StdOverloaded, StdString
......
definition module Platform
definition module CleanSerial.Platform
getDevices :: !*World -> *([String], !*World)
implementation module Platform
implementation module CleanSerial.Platform
import code from library "CleanSerial_library"
import code from library "CleanSerial2_library"
......
definition module TTY
definition module CleanSerial
from StdClass import class zero
......
implementation module TTY
implementation module CleanSerial
import StdEnv
import System.OS
import Text
import Platform
import CleanSerial.Platform
import code from "ctty.o"
......
definition module iTasksTTY
definition module CleanSerial.iTasks
from iTasks.Internal.Generic.Visualization import generic gText, :: TextFormat
from iTasks.SDS.Definition import :: Shared, class RWShared, class Readable, class Writeable, class Modifiable, class Registrable, class Identifiable
......@@ -13,7 +13,7 @@ from Data.Either import :: Either
from Text.GenJSON import generic JSONEncode, generic JSONDecode, :: JSONNode
from System.Time import :: Timespec
from TTY import :: TTYSettings
from CleanSerial import :: TTYSettings
derive class iTask TTYSettings
......
implementation module iTasksTTY
implementation module CleanSerial.iTasks
import Data.Tuple
import StdEnv
......@@ -15,7 +15,7 @@ import iTasks.Internal.Task
import iTasks.Internal.TaskEval
import iTasks.Internal.TaskState
import TTY
import CleanSerial
:: *Resource | TTYd String *TTY
......
CFLAGS?=-Wall -Wextra
ifeq ($(OS), Windows_NT)
DETECTED_OS?=Windows
CC=gcc
else
DETECTED_OS?=POSIX
endif
LIBFILES=$(wildcard $(DETECTED_OS)/*library)
VPATH = src:../csource
all: $(addprefix Clean\ System\ Files/,ctty.o $(LIBFILES))
Clean\ System\ Files/%: %
mkdir -p "Clean System Files"
cp "$<" "Clean System Files"
ctty.o: tty.c
$(COMPILE.c) $(OUTPUT_OPTION) $<
clean:
$(RM) -rf *.o Clean\ System\ Files
ifeq ($(OS), Windows_NT)
DETECTED_OS=Windows
else
DETECTED_OS=POSIX
endif
all: listDevices
.SECONDARY: listDevices.prj
%: %.prj %.icl
cpm $<
%.prj:
cpm project $(basename $@) create
cpm project $@ target iTasks
cpm project $@ set -h 2000m -s 20m -dynamics
cpm project $@ root ..
cpm project $@ path add "$$PWD/../$(DETECTED_OS)"
cpm project $@ path add "$$PWD/.."
module listDevices
import TTY
import CleanSerial
import Text
import Data.Tuple
......
Version: 1.4
Global
ProjectRoot: .
Target: iTasks
Exec: {Project}/listDevices
CodeGen
CheckStacks: False
CheckIndexes: True
Application
HeapSize: 2097152000
StackSize: 20971520
ExtraMemory: 8192
IntialHeapSize: 204800
HeapSizeMultiplier: 4096
ShowExecutionTime: False
ShowGC: False
ShowStackSize: False
MarkingCollector: False
DisableRTSFlags: False
StandardRuntimeEnv: True
Profile
Memory: False
MemoryMinimumHeapSize: 0
Time: False
Stack: False
Dynamics: True
GenericFusion: False
DescExL: False
Output
Output: ShowConstructors
Font: Monaco
FontSize: 9
WriteStdErr: False
Link
LinkMethod: Static
GenerateRelocations: False
GenerateSymbolTable: False
GenerateLinkMap: False
LinkResources: False
ResourceSource:
GenerateDLL: False
ExportedNames:
Paths
Path: {Project}*..*src-posix
Path: {Project}
Path: {Project}*..*src
Precompile:
Postlink:
MainModule
Name: listDevices
Dir: {Project}
Compiler
NeverMemoryProfile: False
NeverTimeProfile: False
StrictnessAnalysis: True
ListTypes: StrictExportTypes
ListAttributes: True
Warnings: True
Verbose: True
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
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