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

Archive builds with vx toolchain.

parent bc52d70a
......@@ -3,3 +3,7 @@
lib/c/liblabcomm.a
compiler/AST/
compiler/labComm.jar
examples/twoway/gen/
lib/csharp/labcomm.dll
lib/java/gen/
lib/java/labcomm.jar
## Macros
UNAME_S=$(shell uname -s)
ALL_DEPS=liblabcomm.a liblabcomm.so.1
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.
LDLIBS=-llabcomm -lrt
MAKESHARED=gcc -o $1 -shared -Wl,-soname,$2 $3 -lc -lrt
......@@ -57,7 +68,7 @@ endif
.PHONY: all run-test clean distclean
all: liblabcomm.a liblabcomm.so.1
all: $(ALL_DEPS)
liblabcomm.a: $(OBJS)
ar -r $@ $^
......
......@@ -24,8 +24,14 @@
#define _LABCOMM_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_scheduler.h"
......
#ifndef _LABCOMM_COMPAT_VXWORKS_H_
#define _LABCOMM_COMPAT_VXWORKS_H_
#ifndef __VXWORKS__
#error "__VXWORKS__" not defined
#endif
#include <types/vxTypes.h>
#include <stdio.h>
#if (CPU == PPC603)
#undef _LITTLE_ENDIAN
#endif
......@@ -10,3 +16,5 @@
#undef _BIG_ENDIAN
#endif
#endif
......@@ -199,7 +199,9 @@ static int decode_typedef_or_sample(struct labcomm_decoder *d, int kind)
LABCOMM_IOCTL_WRITER_GET_BYTES_WRITTEN,
&signature.size);
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;
goto free_signature_name;
}
......@@ -207,7 +209,9 @@ static int decode_typedef_or_sample(struct labcomm_decoder *d, int kind)
LABCOMM_IOCTL_WRITER_GET_BYTE_POINTER,
&signature.signature);
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;
goto free_signature_name;
}
......
......@@ -64,5 +64,7 @@ LABCOMM_ERROR(LABCOMM_ERROR_MEMORY,
"Could not allocate memory")
LABCOMM_ERROR(LABCOMM_ERROR_USER_DEF,
"User defined error")
LABCOMM_ERROR(LABCOMM_ERROR_BAD_WRITER,
"Decoder: writer_ioctl() failed")
#endif
......@@ -98,7 +98,7 @@ static int fd_fill(struct labcomm_reader *r,
int err;
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) {
r->count = 0;
r->error = -EPIPE;
......
......@@ -101,7 +101,7 @@ static int fd_flush(struct labcomm_writer *w,
start = 0;
err = 0;
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) {
break;
}
......
......@@ -28,12 +28,12 @@
#else
#include <endian.h>
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#endif
#include <stdint.h>
//#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "labcomm.h"
/*
......
......@@ -22,8 +22,12 @@
#ifndef _LABCOMM_SCHEDULER_H_
#define _LABCOMM_SCHEDULER_H_
#include <unistd.h>
#include <stdint.h>
#ifdef LABCOMM_COMPAT
#include LABCOMM_COMPAT
#else
#include <unistd.h>
#include <stdint.h>
#endif
struct labcomm_time;
......
......@@ -22,7 +22,12 @@
#ifndef _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"
struct labcomm_time {
......
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