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
Erik Jansson
LabComm
Commits
05f371e2
Commit
05f371e2
authored
Apr 16, 2014
by
Tommy Olofsson
Browse files
Cleaned up the support for cross compilation of the C library.
parent
ee278550
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/c/Makefile
View file @
05f371e2
...
@@ -4,21 +4,14 @@ ALL_DEPS=liblabcomm.a liblabcomm.so.1
...
@@ -4,21 +4,14 @@ ALL_DEPS=liblabcomm.a liblabcomm.so.1
ifeq
($(UNAME_S),Linux)
ifeq
($(UNAME_S),Linux)
CFLAGS
=
-std
=
c99
-g
-Wall
-Werror
-O3
-I
.
-Itest
CFLAGS
=
-std
=
c99
-g
-Wall
-Werror
-O3
-I
.
-Itest
ifndef
TARGET
CC
=
$(CROSS_COMPILE)
gcc
CC
=
gcc
LD
=
$(CROSS_COMPILE)
ld
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
else
ifeq
($(UNAME_S),Darwin)
else
ifeq
($(UNAME_S),Darwin)
CC
=
clang
CC
=
$(CROSS_COMPILE)
clang
LD
=
$(CROSS_COMPILE)
ld
CFLAGS
=
-g
-Wall
-Werror
-O3
-I
.
-Itest
\
CFLAGS
=
-g
-Wall
-Werror
-O3
-I
.
-Itest
\
-DLABCOMM_COMPAT
=
\"
labcomm_compat_osx.h
\"
\
-DLABCOMM_COMPAT
=
\"
labcomm_compat_osx.h
\"
\
-Wno-tautological-compare
-Wno-unused-function
-Wno-tautological-compare
-Wno-unused-function
...
@@ -28,6 +21,13 @@ else ifeq ($(UNAME_S),Darwin)
...
@@ -28,6 +21,13 @@ else ifeq ($(UNAME_S),Darwin)
else
else
$(error
Unknown
system
$(UNAME_S))
$(error
Unknown
system
$(UNAME_S))
endif
endif
# TODO: How to handle Cygwin?
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.
OBJS
=
labcomm_memory.o
\
OBJS
=
labcomm_memory.o
\
labcomm_error.o
\
labcomm_error.o
\
...
...
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