Commit f323b4a7 authored by Tommy Olofsson's avatar Tommy Olofsson
Browse files

Archive builds with vx toolchain.

parent bc52d70a
...@@ -3,3 +3,7 @@ ...@@ -3,3 +3,7 @@
lib/c/liblabcomm.a lib/c/liblabcomm.a
compiler/AST/ compiler/AST/
compiler/labComm.jar compiler/labComm.jar
examples/twoway/gen/
lib/csharp/labcomm.dll
lib/java/gen/
lib/java/labcomm.jar
## Macros ## Macros
UNAME_S=$(shell uname -s) UNAME_S=$(shell uname -s)
ALL_DEPS=liblabcomm.a liblabcomm.so.1
ifeq ($(UNAME_S),Linux) ifeq ($(UNAME_S),Linux)
CC=gcc CFLAGS=-std=c99 -g -Wall -Werror -O3 -I. -Itest
CFLAGS=-std=c99 -g -Wall -Werror -O3 -I. -Itest ifndef TARGET
CC=gcc
else ifeq ($(TARGET),vx)
CC=i586-wrs-vxworks-gcc
LD=i586-wrs-vxworks-ld
ALL_DEPS:=$(filter-out %.so.1, $(ALL_DEPS))
CFLAGS:=$(CFLAGS) -DLABCOMM_COMPAT=\"labcomm_compat_vxworks.h\"
else
@echo 'Invalid target.'
endif
LDFLAGS=-L. LDFLAGS=-L.
LDLIBS=-llabcomm -lrt LDLIBS=-llabcomm -lrt
MAKESHARED=gcc -o $1 -shared -Wl,-soname,$2 $3 -lc -lrt MAKESHARED=gcc -o $1 -shared -Wl,-soname,$2 $3 -lc -lrt
...@@ -57,7 +68,7 @@ endif ...@@ -57,7 +68,7 @@ endif
.PHONY: all run-test clean distclean .PHONY: all run-test clean distclean
all: liblabcomm.a liblabcomm.so.1 all: $(ALL_DEPS)
liblabcomm.a: $(OBJS) liblabcomm.a: $(OBJS)
ar -r $@ $^ ar -r $@ $^
......
...@@ -24,8 +24,14 @@ ...@@ -24,8 +24,14 @@
#define _LABCOMM_H_ #define _LABCOMM_H_
#include <stdarg.h> #include <stdarg.h>
#include <stdint.h>
#include <unistd.h> #ifdef LABCOMM_COMPAT
#include LABCOMM_COMPAT
#else
#include <stdint.h>
#include <unistd.h>
#endif
#include "labcomm_error.h" #include "labcomm_error.h"
#include "labcomm_scheduler.h" #include "labcomm_scheduler.h"
......
#ifndef _LABCOMM_COMPAT_VXWORKS_H_
#define _LABCOMM_COMPAT_VXWORKS_H_
#ifndef __VXWORKS__ #ifndef __VXWORKS__
#error "__VXWORKS__" not defined #error "__VXWORKS__" not defined
#endif #endif
#include <types/vxTypes.h>
#include <stdio.h>
#if (CPU == PPC603) #if (CPU == PPC603)
#undef _LITTLE_ENDIAN #undef _LITTLE_ENDIAN
#endif #endif
...@@ -10,3 +16,5 @@ ...@@ -10,3 +16,5 @@
#undef _BIG_ENDIAN #undef _BIG_ENDIAN
#endif #endif
#endif
...@@ -199,7 +199,9 @@ static int decode_typedef_or_sample(struct labcomm_decoder *d, int kind) ...@@ -199,7 +199,9 @@ static int decode_typedef_or_sample(struct labcomm_decoder *d, int kind)
LABCOMM_IOCTL_WRITER_GET_BYTES_WRITTEN, LABCOMM_IOCTL_WRITER_GET_BYTES_WRITTEN,
&signature.size); &signature.size);
if (err < 0) { if (err < 0) {
fprintf(stderr, "Failed to get size: %s\n", strerror(-err)); /* fprintf(stderr, "Failed to get size: %s\n", strerror(-err)); */
labcomm_error_warning(d->error, LABCOMM_ERROR_BAD_WRITER,
"Failed to get size: %s\n", strerror(-err));
result = -ENOENT; result = -ENOENT;
goto free_signature_name; goto free_signature_name;
} }
...@@ -207,7 +209,9 @@ static int decode_typedef_or_sample(struct labcomm_decoder *d, int kind) ...@@ -207,7 +209,9 @@ static int decode_typedef_or_sample(struct labcomm_decoder *d, int kind)
LABCOMM_IOCTL_WRITER_GET_BYTE_POINTER, LABCOMM_IOCTL_WRITER_GET_BYTE_POINTER,
&signature.signature); &signature.signature);
if (err < 0) { if (err < 0) {
fprintf(stderr, "Failed to get pointer: %s\n", strerror(-err)); /* fprintf(stderr, "Failed to get pointer: %s\n", strerror(-err)); */
labcomm_error_warning(d->error, LABCOMM_ERROR_BAD_WRITER,
"Failed to get pointer: %s\n", strerror(-err));
result = -ENOENT; result = -ENOENT;
goto free_signature_name; goto free_signature_name;
} }
......
...@@ -64,5 +64,7 @@ LABCOMM_ERROR(LABCOMM_ERROR_MEMORY, ...@@ -64,5 +64,7 @@ LABCOMM_ERROR(LABCOMM_ERROR_MEMORY,
"Could not allocate memory") "Could not allocate memory")
LABCOMM_ERROR(LABCOMM_ERROR_USER_DEF, LABCOMM_ERROR(LABCOMM_ERROR_USER_DEF,
"User defined error") "User defined error")
LABCOMM_ERROR(LABCOMM_ERROR_BAD_WRITER,
"Decoder: writer_ioctl() failed")
#endif #endif
...@@ -98,7 +98,7 @@ static int fd_fill(struct labcomm_reader *r, ...@@ -98,7 +98,7 @@ static int fd_fill(struct labcomm_reader *r,
int err; int err;
r->pos = 0; r->pos = 0;
err = read(fd_reader->fd, r->data, r->data_size); err = read(fd_reader->fd, (char *)r->data, r->data_size);
if (err <= 0) { if (err <= 0) {
r->count = 0; r->count = 0;
r->error = -EPIPE; r->error = -EPIPE;
......
...@@ -101,7 +101,7 @@ static int fd_flush(struct labcomm_writer *w, ...@@ -101,7 +101,7 @@ static int fd_flush(struct labcomm_writer *w,
start = 0; start = 0;
err = 0; err = 0;
while (start < w->pos) { while (start < w->pos) {
err = write(fd_context->fd, &w->data[start], w->pos - start); err = write(fd_context->fd, (char *)&w->data[start], w->pos - start);
if (err <= 0) { if (err <= 0) {
break; break;
} }
......
...@@ -28,12 +28,12 @@ ...@@ -28,12 +28,12 @@
#else #else
#include <endian.h> #include <endian.h>
#include <stdio.h> #include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#endif #endif
#include <stdint.h>
//#include <stdlib.h> //#include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h>
#include "labcomm.h" #include "labcomm.h"
/* /*
......
...@@ -22,8 +22,12 @@ ...@@ -22,8 +22,12 @@
#ifndef _LABCOMM_SCHEDULER_H_ #ifndef _LABCOMM_SCHEDULER_H_
#define _LABCOMM_SCHEDULER_H_ #define _LABCOMM_SCHEDULER_H_
#include <unistd.h> #ifdef LABCOMM_COMPAT
#include <stdint.h> #include LABCOMM_COMPAT
#else
#include <unistd.h>
#include <stdint.h>
#endif
struct labcomm_time; struct labcomm_time;
......
...@@ -22,7 +22,12 @@ ...@@ -22,7 +22,12 @@
#ifndef _LABCOMM_SCHEDULER_PRIVATE_H_ #ifndef _LABCOMM_SCHEDULER_PRIVATE_H_
#define _LABCOMM_SCHEDULER_PRIVATE_H_ #define _LABCOMM_SCHEDULER_PRIVATE_H_
#include <unistd.h> #ifdef LABCOMM_COMPAT
#include LABCOMM_COMPAT
#else
#include <unistd.h>
#endif
#include "labcomm_scheduler.h" #include "labcomm_scheduler.h"
struct labcomm_time { struct labcomm_time {
......
Supports Markdown
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