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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
########################################
# Tizen Building Block
########################################
RUNNING_MAKE_VERSION := $(MAKE_VERSION)
# Check for minimal make version (note: this check will break at make 10.x)
MIN_MAKE_VERSION = 3.81
ifneq ($(firstword $(sort $(RUNNING_MAKE_VERSION) $(MIN_MAKE_VERSION))),$(MIN_MAKE_VERSION))
$(error You have make '$(RUNNING_MAKE_VERSION)' installed. GNU make >= $(MIN_MAKE_VERSION) is required)
endif
TOPDIR := $(CURDIR)
CONFIG_CONFIG_IN = Config.in
CONFIG = support/kconfig
DATE := $(shell date +%Y%m%d)
BASE_DIR := $(TOPDIR)/output
BUILD_DIR := $(BASE_DIR)/build
INFO_DIR := $(BASE_DIR)/info
CONFIG_DIR := $(CURDIR)
TBB_CONFIG = $(CONFIG_DIR)/.config
-include $(TBB_CONFIG)
export TBB_VERSION := V1.0
export TBB_PLATFORM_VERSION := 6.0
export TBB_SNAPSHOT_ID := latest
# This is our default rule, so must come first
TIC_CONFIG_ENV = \
TBB_CONFIG=$(TBB_CONFIG) \
BUILD_DIR=$(BUILD_DIR) \
INFO_DIR=$(INFO_DIR) \
TBB_INFO_SNAPSHOT_ID=$(TBB_SNAPSHOT_ID) \
TBB_INFO_PLATFORM_VERSION=$(TBB_PLATFORM_VERSION) \
TOPDIR=$(TOPDIR)
ifeq ($(wildcard .config*),)
all: menuconfig
else
all:
@echo "Extract information from $(TBB_CONFIG)..."
@$(TIC_CONFIG_ENV) $(TOPDIR)/support/scripts/extract_info.sh
@echo "Starting to make a image..."
@$(TIC_CONFIG_ENV) $(TOPDIR)/support/scripts/make_image.sh
endif
.ONESHELL: # Only applies to configsdk target
configsdk:
ifeq ($(wildcard $(INFO_DIR)/.bb_list.txt),)
@echo "Please make a image firstly..."
else
@cd $(TOPDIR)/config-sdk
@echo "$(INFO_DIR)/.bb_list.txt|$(TBB_INFO_IMAGE_NAME)|$(TBB_INFO_PLATFORM_VERSION)"
@$(TIC_CONFIG_ENV) ./make_extension.sh $(INFO_DIR)/.bb_list.txt $(TBB_INFO_PROFILE_NAME) $(TBB_PLATFORM_VERSION)
@cd $(TOPDIR)
endif
.ONESHELL: # Only applies to configsdk target
configsdk64:
ifeq ($(wildcard $(INFO_DIR)/.bb_list.txt),)
@echo "Please make a image firstly..."
else
@cd $(TOPDIR)/config-sdk
@echo "$(INFO_DIR)/.bb_list.txt|$(TBB_INFO_IMAGE_NAME)|$(TBB_INFO_PLATFORM_VERSION)"
@$(TIC_CONFIG_ENV) ./make_extension.sh $(INFO_DIR)/.bb_list.txt $(TBB_INFO_PROFILE_NAME) $(TBB_PLATFORM_VERSION) --64bit
@cd $(TOPDIR)
endif
.ONESHELL: # Only applies to configsdk target
cleansdk:
@cd $(TOPDIR)/config-sdk
./clean_data.sh
@cd $(TOPDIR)
HOSTCC := gcc
HOSTCXX := g++
$(BUILD_DIR)/buildroot-config/%onf:
mkdir -p $(@D)/lxdialog
$(MAKE) CC="$(HOSTCC)" HOSTCC="$(HOSTCC)" HOSTCXX="$(HOSTCXX)" \
obj=$(@D) -C $(CONFIG) -f Makefile.tbb $(@F)
xconfig: $(BUILD_DIR)/buildroot-config/qconf
@$(TIC_CONFIG_ENV) $(TOPDIR)/support/scripts/mk_config_from_xml.sh base
@$(TIC_CONFIG_ENV) $(TOPDIR)/support/scripts/mk_config_from_xml.sh unified
@$(TIC_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
@test -e $(TBB_CONFIG) || { echo "There is no config file" ; echo "Please igonre error msg."; echo "Done."; exit 1; }
@echo "Extract information from $(TBB_CONFIG)..."
@$(TIC_CONFIG_ENV) $(TOPDIR)/support/scripts/extract_info.sh
@echo "Done"
menuconfig: $(BUILD_DIR)/buildroot-config/mconf
@$(TIC_CONFIG_ENV) $(TOPDIR)/support/scripts/mk_config_from_xml.sh base
@$(TIC_CONFIG_ENV) $(TOPDIR)/support/scripts/mk_config_from_xml.sh unified
@$(TIC_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
@test -e $(TBB_CONFIG) || { echo "There is no config file" ; echo "Please igonre error msg."; echo "Done."; exit 1; }
@echo "Extract information from $(TBB_CONFIG)..."
@$(TIC_CONFIG_ENV) $(TOPDIR)/support/scripts/extract_info.sh
@echo "Done"
nconfig: $(BUILD_DIR)/buildroot-config/nconf
@$(TIC_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
%_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig
@$(TIC_CONFIG_ENV) TBB_DEFCONFIG=$(TOPDIR)/configs/$@ \
$< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN)
oldconfig: $(BUILD_DIR)/buildroot-config/conf
@$(TIC_CONFIG_ENV) $< --oldconfig $(CONFIG_CONFIG_IN)
printvars:
@$(foreach V, \
$(sort $(if $(VARS),$(filter $(VARS),$(.VARIABLES)),$(.VARIABLES))), \
$(if $(filter-out environment% default automatic, \
$(origin $V)), \
$(info $V=$($V) ($(value $V)))))
clean:
rm -rf $(BUILD_DIR) $(INFO_DIR)
make cleansdk
distclean: clean
rm -rf $(BASE_DIR)
rm -rf $(TOPDIR)/dl $(TBB_CONFIG) $(CONFIG_DIR)/.config.old $(CONFIG_DIR)/..config.tmp
rm -f $(TOPDIR)/advanced/*base* $(TOPDIR)/advanced/*unified* $(TOPDIR)/advanced/20*
help:
@echo 'Cleaning:'
@echo ' clean - delete all files created by build'
@echo ' distclean - delete all non-source files (including .config)'
@echo
@echo 'Build:'
@echo ' all - make'
@echo
@echo 'Configuration:'
@echo ' menuconfig - interactive curses-based configurator'
@echo ' nconfig - interactive ncurses-based configurator'
@echo
@echo 'Infomation:'
@echo ' list-defconfigs - list all defconfigs (pre-configured minimal systems)'
@echo ' printvars - list variables'
@echo ' print-version - print version'
@echo
# List the defconfig files
# $(1): base directory
define list-defconfigs
@first=true; \
for defconfig in $(1)/configs/*_defconfig; do \
[ -f "$${defconfig}" ] || continue; \
if $${first}; then \
printf "Built-in configs:\n"; \
first=false; \
fi; \
defconfig="$${defconfig##*/}"; \
printf " %-35s - Build for %s\n" "$${defconfig}" "$${defconfig%_defconfig}"; \
done; \
$${first} || printf "\n"
endef
list-defconfigs:
$(call list-defconfigs,$(TOPDIR))
print-version:
@echo $(TBB_VERSION)
|