Commit 6d847d74 authored by Sven Gestegård Robertz's avatar Sven Gestegård Robertz
Browse files

put back os_compat.mk for use in examples

parent 0c09f573
## Macros
UNAME_S=$(shell uname -s)
ALL_DEPS=liblabcomm.a liblabcomm.so.1 liblabcomm2006.a liblabcomm2006.so.1 liblabcomm20141009.a liblabcomm20141009.so.1
include os_compat.mk
ifeq ($(UNAME_S),Linux)
CFLAGS=-std=c99 -g -Wall -Werror -O3 -I. -Itest -I2006
CC=$(CROSS_COMPILE)gcc
LD=$(CROSS_COMPILE)ld
LDFLAGS=-L.
LDLIBS=-llabcomm -llabcomm2006 -lrt
MAKESHARED=gcc -o $1 -shared -Wl,-soname,$2 $3 -lc -lrt
else ifeq ($(UNAME_S),Darwin)
CC=$(CROSS_COMPILE)clang
LD=$(CROSS_COMPILE)ld
CFLAGS=-g -Wall -Werror -O3 -I. -Itest \
-DLABCOMM_COMPAT=\"labcomm_compat_osx.h\" \
-Wno-tautological-compare -Wno-unused-function
LDFLAGS=-L.
LDLIBS=-llabcomm -llabcomm2006
MAKESHARED=clang -o $1 -shared -Wl,-install_name,$2 $3 -lc
else ifneq ($(findstring CYGWIN,$(UNAME_S)),)
CFLAGS=-std=c99 -g -Wall -Werror -O3 -I. -Itest
CC=$(CROSS_COMPILE)gcc
LD=$(CROSS_COMPILE)ld
LDFLAGS=-L.
LDLIBS=-llabcomm -lrt
ALL_DEPS:=$(filter-out %.so.1, $(ALL_DEPS)) # No -fPIC supported in windows?
else
$(error Unknown system $(UNAME_S))
endif
ALL_DEPS=liblabcomm.a liblabcomm.so.1 liblabcomm2006.a liblabcomm2006.so.1 liblabcomm20141009.a liblabcomm20141009.so.1
ifeq ($(CROSS_COMPILE),i586-wrs-vxworks-)
ALL_DEPS:=$(filter-out %.so.1, $(ALL_DEPS)) # PIC is only supported for RTPs
CFLAGS:=$(CFLAGS) -DLABCOMM_COMPAT=\"labcomm_compat_vxworks.h\"
endif
# TODO: Support for Codesourcery ARM toolchain.
OBJS2006=2006/labcomm2006_memory.o \
......
## Macros
UNAME_S=$(shell uname -s)
ifeq ($(UNAME_S),Linux)
CFLAGS=-std=c99 -g -Wall -Werror -O3 -I. -Itest -I2006
CC=$(CROSS_COMPILE)gcc
LD=$(CROSS_COMPILE)ld
LDFLAGS=-L.
LDLIBS=-llabcomm -llabcomm2006 -lrt
MAKESHARED=gcc -o $1 -shared -Wl,-soname,$2 $3 -lc -lrt
else ifeq ($(UNAME_S),Darwin)
CC=$(CROSS_COMPILE)clang
LD=$(CROSS_COMPILE)ld
CFLAGS=-g -Wall -Werror -O3 -I. -Itest \
-DLABCOMM_COMPAT=\"labcomm_compat_osx.h\" \
-Wno-tautological-compare -Wno-unused-function
LDFLAGS=-L.
LDLIBS=-llabcomm -llabcomm2006
MAKESHARED=clang -o $1 -shared -Wl,-install_name,$2 $3 -lc
else ifneq ($(findstring CYGWIN,$(UNAME_S)),)
CFLAGS=-std=c99 -g -Wall -Werror -O3 -I. -Itest
CC=$(CROSS_COMPILE)gcc
LD=$(CROSS_COMPILE)ld
LDFLAGS=-L.
LDLIBS=-llabcomm -lrt
ALL_DEPS:=$(filter-out %.so.1, $(ALL_DEPS)) # No -fPIC supported in windows?
else
$(error Unknown system $(UNAME_S))
endif
ifeq ($(CROSS_COMPILE),i586-wrs-vxworks-)
ALL_DEPS:=$(filter-out %.so.1, $(ALL_DEPS)) # PIC is only supported for RTPs
CFLAGS:=$(CFLAGS) -DLABCOMM_COMPAT=\"labcomm_compat_vxworks.h\"
endif
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