Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
TimeManager
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
CI / CD
CI / CD
Pipelines
Schedules
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
linux-tools
TimeManager
Commits
72bf620f
Commit
72bf620f
authored
Jun 13, 2019
by
Carit Zhu
🎱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify Makefile for arm yocto platform.
parent
a92bee29
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
5 deletions
+40
-5
Makefile
Makefile
+40
-5
No files found.
Makefile
View file @
72bf620f
# Set DIR
BUILD_DIR
?=
.
SRC_DIR
?=
.
# Set CROSS_COMPILE
CROSS_COMPILE
?=
ARCH
?=
CROSS_COMPILE
?=
ifeq
($(ARCH),
arm)
PKG_CONFIG_DIR
:=
$(PKG_CONFIG_SYSROOT_DIR)
-native
/usr/bin
PKG_CONFIG
:=
$(PKG_CONFIG_DIR)
/pkg-config
else
PKG_CONFIG
:=
pkg-config
endif
# Make variables (CC, etc...)
CC
=
$(CROSS_COMPILE)
gcc
CFLAGS
=
`
pkg-config
--cflags
gtk+-3.0
`
LIBS
=
`
pkg-config
--libs
gtk+-3.0
`
CFLAGS
?=
LIBS
?=
ifeq
($(ARCH),
arm)
CFLAGS
+=
-march
=
armv7-a
-mfpu
=
neon
-mfloat-abi
=
hard
-mcpu
=
cortex-a9
\
--sysroot
=
$(PKG_CONFIG_SYSROOT_DIR)
endif
GLIB_CFLAGS
=
GTK3_CFLAGS
=
$(
shell
$(PKG_CONFIG)
--cflags
gtk+-3.0
)
CFLAGS
+=
$(GLIB_CFLAGS)
$(GTK3_CFLAGS)
ifeq
($(ARCH),
arm)
INCLUDES
:=
\
-I
$(PKG_CONFIG_SYSROOT_DIR)
/usr/include
\
-I
$(PKG_CONFIG_SYSROOT_DIR)
-native
/usr/include
endif
GLIB_LIBS
=
-lglib-2
.0
GTK3_LIBS
=
$(
shell
$(PKG_CONFIG)
--libs
gtk+-3.0
)
LIBS
+=
$(GLIB_LIBS)
$(GTK3_LIBS)
# Objects
objects
=
main.o
...
...
@@ -14,10 +48,11 @@ all: timemanager
# Build objects
timemanager
:
$(objects)
$(CC)
$(CFLAGS)
-o
$@
$<
$(LIBS)
# Temp objects
%.o
:
%.c
$(CC)
$(CFLAGS)
$
<
-o
$@
$(LIBS)
%.o
:
$(SRC_DIR)/
%.c
$(CC)
$(CFLAGS)
$
(INCLUDES)
-c
-o
$@
$<
# Clean
.PHONY
:
clean
...
...
Write
Preview
Markdown
is supported
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