Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sven Gestegård Robertz
LabComm
Commits
6d847d74
Commit
6d847d74
authored
Oct 25, 2014
by
Sven Gestegård Robertz
Browse files
put back os_compat.mk for use in examples
parent
0c09f573
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/c/Makefile
View file @
6d847d74
## 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
\
...
...
lib/c/os_compat.mk
0 → 100644
View file @
6d847d74
## 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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment