-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCommon.mk
More file actions
129 lines (100 loc) · 4.67 KB
/
Common.mk
File metadata and controls
129 lines (100 loc) · 4.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
## ////////////////////////////////////////////////////////////////////////// //
##
## This file is part of the autoconf-bootstrap project.
## Copyright 2018 Andrea Rigoni Garola <andrea.rigoni@igi.cnr.it>.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
##
## ////////////////////////////////////////////////////////////////////////// //
include $(top_srcdir)/conf/kscripts/build_common.mk
include $(top_srcdir)/conf/kscripts/toolchain.mk
include $(top_srcdir)/conf/kscripts/docker.mk
## ////////////////////////////////////////////////////////////////////////// ##
## /// ACTIVATE HELP TARGET ///////////////////////////////////////////////// ##
## ////////////////////////////////////////////////////////////////////////// ##
@TARGET_SELFHELP@
help: print_banner
print_banner:
@ cat $(top_srcdir)/docs/logo.txt
## /////////////////////////////////////////////////////////////////////////////
## // DIRECTORIES //////////////////////////////////////////////////////////////
## /////////////////////////////////////////////////////////////////////////////
DL ?= $(DOWNLOAD_DIR)
TMP ?= $(abs_top_builddir)
${DL} ${TMP}:
@$(MKDIR_P) $@
## /////////////////////////////////////////////////////////////////////////////
## // DOCKER //////////////////////////////////////////////////////////////////
## /////////////////////////////////////////////////////////////////////////////
locale-gen: USER = root
locale-gen: ##@@docker set locale in the docker container instance
@ locale-gen $${LANG}
ip-address: NIC = eth0
ip-address: HOSTID = 02:42:ac:11:00:aa
ip-address: USER = root
ip-address: ##@@docker set MAC address in the docker container instance
@ ip link set $(NIC) address $(HOSTID)
## ACLOCAL = ${SHELL} /home/andrea/devel/utils/autoconf-bootstrap/conf/missing aclocal
## AUTOCONF = ${SHELL} /home/andrea/devel/utils/autoconf-bootstrap/conf/missing autoconf
## AUTOHEADER = ${SHELL} /home/andrea/devel/utils/autoconf-bootstrap/conf/missing autoheader
## AUTOMAKE = ${SHELL} /home/andrea/devel/utils/autoconf-bootstrap/conf/missing automake
## ////////////////////////////////////////////////////////////////////////// ##
## /// LINUX ////////////////////////////////////////////////////////////// ##
## ////////////////////////////////////////////////////////////////////////// ##
LINUX_CFLAGS ?= "-O2 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard"
LINUX_PACKAGE ?= uImage
LINUX_IMAGE ?= $(TMP)/$(LINUX_PACKAGE)
LINUX_DIR ?= linux
if LINUX_DIR_IN_SRCTREE
LINUX_SRCDIR = $(abs_top_srcdir)/$(LINUX_DIR)
LINUX_BUILDDIR = $(abs_top_builddir)/$(LINUX_DIR)
LINUX_BUILD_O = $(filter-out $(LINUX_SRCDIR),$(LINUX_BUILDDIR))
else
LINUX_SRCDIR = $(abs_top_builddir)/$(LINUX_DIR)
LINUX_BUILDDIR = $(abs_top_builddir)/$(LINUX_DIR)
endif
ARCH ?= arm
WITH_TOOLCHAIN_DIR ?= ${abs_top_builddir}/toolchain
TOOLCHAIN_PATH ?= ${WITH_TOOLCHAIN_DIR}/bin
CROSS_COMPILE ?= arm-linux-gnueabihf-
define _set_export
export ARCH=$(ARCH); \
export CROSS_COMPILE=${CROSS_COMPILE}; \
export PATH=$${PATH}:$(TOOLCHAIN_PATH); \
export O=${LINUX_BUILD_O}
endef
## /////////////////////////////////////////////////////////////////////////////
## // DUMPS ///////////////////////////////////////////////////////////////////
## /////////////////////////////////////////////////////////////////////////////
print-env: ##@micellaneous print environment used for crosscompiling linux
@\
$(_set_export); \
echo ""; \
echo "---[KERNEL BUILD]----------------------------------------------------------"; \
echo " compiler: $${CROSS_COMPILE}${CC}"; \
echo " arch : ${ARCH}"; \
echo " flags : ${LINUX_CFLAGS}"; \
echo " TOOLCH : ${TOOLCHAIN_PATH}"; \
echo " PATH : $${PATH}"; \
echo " builddir: $${O}"; \
echo " "; \
echo " LINUX_IMAGE : ${LINUX_IMAGE}"; \
echo " LINUX_DIR : ${LINUX_DIR}"; \
echo " LINUX_SRCDIR : ${LINUX_SRCDIR}"; \
echo " LINUX_BUILDDIR : ${LINUX_BUILDDIR}"; \
echo " LINUX_GIT : ${LINUX_GIT}"; \
echo " MAKE : $${MAKE}"; \
echo " "; \
echo "---------------------------------------------------------------------------"; \
echo ""