-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
136 lines (102 loc) · 2.89 KB
/
Makefile
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
#
# All rights reserved. Reproduction, modification, use or disclosure
# to third parties without express authority is forbidden.
# Copyright Magden LLC, California, USA, 2004, 2005, 2006, 2007.
#
include Makefile.inc
#
# Default app to checkout and build.
# Override with make APP=xxx. Choose something from app
#
# Run the end result (in debug mode) as:
#
APP ?= jway/roll_demo
#
# Leave the following path definitions alone.
# They just specify where in the local tree to checkout and build.
#
PLUGIN_PATH=./app/plugins
PLUGIN_ABS_PATH=$(BUILD_ROOT)/$(PLUGIN_PATH)
APP_PATH=./app
APP_ABS_PATH=$(BUILD_ROOT)/$(APP_PATH)
CORE_PATH=./core
CORE_ABS_PATH=$(BUILD_ROOT)/$(CORE_PATH)
#
# For now we will use native compilers.
#
CC=gcc
CXX=g++
#
# Target whose absence is used to trigger a checkout of:
# m1/core
# m1/tools/ddscomp (To compile bitmaps)
# $(COMPILER)
#
CORE_CLONE_TRIGGER=./core/.git/HEAD
APP_CLONE_TRIGGER=./app/.git/HEAD
# .PHONY: kernel check_error update core
.PHONY: o check_error update core
master_all: check_invocation core $(APP)
packfile: core plugins $(PAPP)
db: core plugins $(DAPP)
# all_kernel: master_all kernel
check_invocation:
ifeq ($(APP), nil)
ifeq ($(PAPP), nil)
$(error Usage: $(MAKE) APP="target_platform/skin1 target_platform/skin2 ...")
endif
endif
core: $(CORE_CLONE_TRIGGER)
@echo
@echo "--- Building core with external libs and tools."
@(cd $(CORE_PATH);$(MAKE))
plugins: $(CORE_CLONE_TRIGGER)
@echo
@echo "--- Building plugins."
@(cd $(PLUGIN_PATH);$(MAKE))
# kernel:
# @echo
# @echo "--- Building kernel."
# (cd kernel; $(MAKE) all install)
# @echo
# @echo "--- Building busybox"
# (cd busybox; $(MAKE))
# @echo
# @echo "--- Building udev"
# (cd udev; $(MAKE))
update:
@echo
@echo "--- Updating core."
(cd m1; git pull)
m1e_packfile:
(cd $(CORE_PATH); make packfile)
os_packfile:
$(SHELL) create_os_packfile.sh
packfile: $(PAPP)
m1e_db:
(cd $(CORE_PATH); make dpf)
db: $(DAPP)
$(APP): $(APP_CLONE_TRIGGER)
$(PAPP): $(APP_CLONE_TRIGGER) $(patsubst %,$(APP_ABS_ROOT)/%, $(PAPP))
@echo
@echo "--- Building skin packfile $(@)"
@-rm -rf ptmp
@-mkdir -p $(BUILD_ROOT)/ptmp > /dev/null 2>&1
(cd $(abspath $(APP_ABS_ROOT))/$(@)/; $(MAKE) TARGET_DIR=$(BUILD_ROOT)/ptmp)
(cd $(abspath $(APP_ABS_ROOT))/$(@)/; $(MAKE) pfile TARGET_DIR=$(BUILD_ROOT)/ptmp)
$(DAPP): $(APP_CLONE_TRIGGER) $(patsubst %,$(APP_ABS_ROOT)/%, $(DAPP))
@echo
@echo "--- Building DB packfile $(@)"
@-rm -rf ptmp
@-mkdir -p $(BUILD_ROOT)/ptmp > /dev/null 2>&1
(cd $(abspath $(APP_ABS_ROOT))/$(@)/; $(MAKE) TARGET_DIR=$(BUILD_ROOT)/ptmp)
(cd $(abspath $(APP_ABS_ROOT))/$(@)/; $(MAKE) dfile TARGET_DIR=$(BUILD_ROOT)/ptmp)
$(CORE_CLONE_TRIGGER):
@echo
@echo "--- Checking out m1 core."
git clone -b $(CORE_GIT_BRANCH) $(CORE_GIT_REPO) core
$(APP_CLONE_TRIGGER):
@echo
@echo "--- Checking out m1 app."
git clone -b $(APP_GIT_BRANCH) $(APP_GIT_REPO) app
include Makefile.rules