-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
106 lines (84 loc) · 2.76 KB
/
Copy pathMakefile
File metadata and controls
106 lines (84 loc) · 2.76 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
##
## MIT License
##
## This file is part of cupkee project.
##
## Copyright (c) 2016 Lixing Ding <ding.lixing@gmail.com>
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "Software"), to deal
## in the Software without restriction, including without limitation the rights
## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
## copies of the Software, and to permit persons to whom the Software is
## furnished to do so, subject to the following conditions:
##
## The above copyright notice and this permission notice shall be included in all
## copies or substantial portions of the Software.
##
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
## SOFTWARE.
##
ifeq (${CPU},)
$(info "Target processor not specified...")
endif
# Define default target processor
export CPU ?= test
ifeq (${BASE_DIR},)
BASE_DIR = ${PWD}
else
MAIN_DIR = ${PWD}
endif
export BASE_DIR
export MAIN_DIR
export MAKE_DIR = ${BASE_DIR}/make
export INC_DIR = ${BASE_DIR}/include
export BSP_DIR = ${BASE_DIR}/bsp
export SYS_DIR = ${BASE_DIR}/system
export TST_DIR = ${BASE_DIR}/test
export FRAMEWORK_DIR = ${BASE_DIR}/frameworks
export SHARE_DIR = ${BASE_DIR}/share
export LANG_DIR = ${SHARE_DIR}/panda
ifeq (${MAIN_DIR},)
BUILD_DIR = ${BASE_DIR}/build/${CPU}
else
BUILD_DIR = ${MAIN_DIR}/build/${CPU}
endif
export BUILD_DIR
export BSP_BUILD_DIR = ${BUILD_DIR}/bsp
export SYS_BUILD_DIR = ${BUILD_DIR}/sys
export MOD_BUILD_DIR = ${BUILD_DIR}/modules
export LANG_BUILD_DIR = ${BUILD_DIR}/lang
all: test
@printf "ok\n"
setup:
git pull
git submodule init
git submodule update
make -C share/libopencm3
build:
@mkdir -p ${LANG_BUILD_DIR} ${BSP_BUILD_DIR} ${SYS_BUILD_DIR}
bsp:
@make -C ${BSP_BUILD_DIR} -f ${MAKE_DIR}/bsp.mk
sys:
@make -C ${SYS_BUILD_DIR} -f ${MAKE_DIR}/sys.mk
lang:
@make -C ${LANG_BUILD_DIR} -f ${MAKE_DIR}/lang.mk
module: build bsp sys lang
@mkdir -p ${BUILD_DIR}/lib
@make -C ${BUILD_DIR} -f ${MAKE_DIR}/module.mk extend
ogin: build bsp sys
@make -C ${BUILD_DIR} -f ${MAKE_DIR}/ogin.mk extend
atom: build bsp sys lang
@make -C ${BUILD_DIR} -f ${MAKE_DIR}/atom.mk extend
test: build sys lang
@rm -rf ${BUILD_DIR}/test.elf
@make -C ${BUILD_DIR} -f ${MAKE_DIR}/test.mk
${BUILD_DIR}/test.elf
clean:
@rm -rf ${BUILD_DIR}
.PHONY: clean build main bsp lang sys ogin atom