1425bb815Sopenharmony_ci# Copyright JS Foundation and other contributors, http://js.foundation
2425bb815Sopenharmony_ci#
3425bb815Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
4425bb815Sopenharmony_ci# you may not use this file except in compliance with the License.
5425bb815Sopenharmony_ci# You may obtain a copy of the License at
6425bb815Sopenharmony_ci#
7425bb815Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
8425bb815Sopenharmony_ci#
9425bb815Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
10425bb815Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS
11425bb815Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12425bb815Sopenharmony_ci# See the License for the specific language governing permissions and
13425bb815Sopenharmony_ci# limitations under the License.
14425bb815Sopenharmony_ci
15425bb815Sopenharmony_ci#############################################################
16425bb815Sopenharmony_ci# Required variables for each makefile
17425bb815Sopenharmony_ci# Discard this section from all parent makefiles
18425bb815Sopenharmony_ci# Expected variables (with automatic defaults):
19425bb815Sopenharmony_ci#   CSRCS (all "C" files in the dir)
20425bb815Sopenharmony_ci#   SUBDIRS (all subdirs with a Makefile)
21425bb815Sopenharmony_ci#   GEN_LIBS - list of libs to be generated ()
22425bb815Sopenharmony_ci#   GEN_IMAGES - list of object file images to be generated ()
23425bb815Sopenharmony_ci#   GEN_BINS - list of binaries to be generated ()
24425bb815Sopenharmony_ci#   COMPONENTS_xxx - a list of libs/objs in the form
25425bb815Sopenharmony_ci#     subdir/lib to be extracted and rolled up into
26425bb815Sopenharmony_ci#     a generated lib/image xxx.a ()
27425bb815Sopenharmony_ci#
28425bb815Sopenharmony_ci# Tabsize : 8
29425bb815Sopenharmony_ci#
30425bb815Sopenharmony_ciTARGET = eagle
31425bb815Sopenharmony_ciFLAVOR = release
32425bb815Sopenharmony_ci#FLAVOR = debug
33425bb815Sopenharmony_ci
34425bb815Sopenharmony_ci#EXTRA_CCFLAGS += -u
35425bb815Sopenharmony_ci
36425bb815Sopenharmony_ciifndef PDIR # {
37425bb815Sopenharmony_ciGEN_IMAGES= eagle.app.v6.out
38425bb815Sopenharmony_ciGEN_BINS= eagle.app.v6.bin
39425bb815Sopenharmony_ciSPECIAL_MKTARGETS=$(APP_MKTARGETS)
40425bb815Sopenharmony_ciSUBDIRS= user
41425bb815Sopenharmony_ciendif # } PDIR
42425bb815Sopenharmony_ci
43425bb815Sopenharmony_ci# path to the JERRYSCRIPT directory
44425bb815Sopenharmony_ciJERRYDIR ?= $(CURDIR)/../../..
45425bb815Sopenharmony_ci
46425bb815Sopenharmony_ciLDDIR = $(SDK_PATH)/ld
47425bb815Sopenharmony_ci
48425bb815Sopenharmony_ci#############################################################
49425bb815Sopenharmony_ci# JerryScript requires a modified linker script with specified alignments
50425bb815Sopenharmony_ci# 	so we use it instead of the original one from SDK.
51425bb815Sopenharmony_ciJERRY_LD_FILE = $(CURDIR)/ld/eagle.app.v6.ld
52425bb815Sopenharmony_ci
53425bb815Sopenharmony_ciCCFLAGS += -Os -std=c99
54425bb815Sopenharmony_ci#CCFLAGS += -O0
55425bb815Sopenharmony_ci
56425bb815Sopenharmony_ciTARGET_LDFLAGS =					\
57425bb815Sopenharmony_ci	-nostdlib					\
58425bb815Sopenharmony_ci	-Wl,-EL						\
59425bb815Sopenharmony_ci	--longcalls					\
60425bb815Sopenharmony_ci	--text-section-literals
61425bb815Sopenharmony_ci
62425bb815Sopenharmony_ciifeq ($(FLAVOR),debug)
63425bb815Sopenharmony_ci	TARGET_LDFLAGS += -O0 -g
64425bb815Sopenharmony_ciendif
65425bb815Sopenharmony_ci
66425bb815Sopenharmony_ciifeq ($(FLAVOR),release)
67425bb815Sopenharmony_ci	TARGET_LDFLAGS += -Os
68425bb815Sopenharmony_ciendif
69425bb815Sopenharmony_ci
70425bb815Sopenharmony_ciCOMPONENTS_eagle.app.v6 =				\
71425bb815Sopenharmony_ci	user/libuser.a
72425bb815Sopenharmony_ci
73425bb815Sopenharmony_ciLINKFLAGS_eagle.app.v6 =				\
74425bb815Sopenharmony_ci	-L$(SDK_PATH)/lib				\
75425bb815Sopenharmony_ci	-Wl,--gc-sections				\
76425bb815Sopenharmony_ci	-Wl,-Map,output.map				\
77425bb815Sopenharmony_ci	-nostdlib					\
78425bb815Sopenharmony_ci	-T$(JERRY_LD_FILE)				\
79425bb815Sopenharmony_ci	-Wl,--no-check-sections				\
80425bb815Sopenharmony_ci	-u call_user_start				\
81425bb815Sopenharmony_ci	-Wl,-static					\
82425bb815Sopenharmony_ci	-Wl,--start-group				\
83425bb815Sopenharmony_ci	-lcirom						\
84425bb815Sopenharmony_ci	-lcrypto					\
85425bb815Sopenharmony_ci	-lespconn					\
86425bb815Sopenharmony_ci	-lespnow					\
87425bb815Sopenharmony_ci	-lfreertos					\
88425bb815Sopenharmony_ci	-lgcc						\
89425bb815Sopenharmony_ci	-lhal						\
90425bb815Sopenharmony_ci	-ljson						\
91425bb815Sopenharmony_ci	-llwip						\
92425bb815Sopenharmony_ci	-ldriver					\
93425bb815Sopenharmony_ci	-lmain						\
94425bb815Sopenharmony_ci	-lmirom						\
95425bb815Sopenharmony_ci	-lnet80211					\
96425bb815Sopenharmony_ci	-lnopoll					\
97425bb815Sopenharmony_ci	-lphy						\
98425bb815Sopenharmony_ci	-lpp						\
99425bb815Sopenharmony_ci	-lpwm						\
100425bb815Sopenharmony_ci	-lsmartconfig					\
101425bb815Sopenharmony_ci	-lspiffs					\
102425bb815Sopenharmony_ci	-lssl						\
103425bb815Sopenharmony_ci	-lwpa						\
104425bb815Sopenharmony_ci	-lwps						\
105425bb815Sopenharmony_ci	-L./libs					\
106425bb815Sopenharmony_ci	-ljerry-core					\
107425bb815Sopenharmony_ci	-ljerry-libm					\
108425bb815Sopenharmony_ci	$(DEP_LIBS_eagle.app.v6)			\
109425bb815Sopenharmony_ci	-Wl,--end-group
110425bb815Sopenharmony_ci
111425bb815Sopenharmony_ciDEPENDS_eagle.app.v6 =					\
112425bb815Sopenharmony_ci	$(JERRY_LD_FILE)				\
113425bb815Sopenharmony_ci	$(LDDIR)/eagle.rom.addr.v6.ld			\
114425bb815Sopenharmony_ci	./include/jerry-targetjs.h			\
115425bb815Sopenharmony_ci	./libs/libjerry-core.a				\
116425bb815Sopenharmony_ci	./libs/libjerry-libm.a
117425bb815Sopenharmony_ci
118425bb815Sopenharmony_ci
119425bb815Sopenharmony_ci#############################################################
120425bb815Sopenharmony_ci# Configuration i.e. compile options etc.
121425bb815Sopenharmony_ci# Target specific stuff (defines etc.) goes in here!
122425bb815Sopenharmony_ci# Generally values applying to a tree are captured in the
123425bb815Sopenharmony_ci#   makefile at its root level - these are then overridden
124425bb815Sopenharmony_ci#   for a subtree within the makefile rooted therein
125425bb815Sopenharmony_ci#
126425bb815Sopenharmony_ci
127425bb815Sopenharmony_ci#UNIVERSAL_TARGET_DEFINES =    \
128425bb815Sopenharmony_ci
129425bb815Sopenharmony_ci# Other potential configuration flags include:
130425bb815Sopenharmony_ci#  -DTXRX_TXBUF_DEBUG
131425bb815Sopenharmony_ci#  -DTXRX_RXBUF_DEBUG
132425bb815Sopenharmony_ci#  -DWLAN_CONFIG_CCX
133425bb815Sopenharmony_ciCONFIGURATION_DEFINES = -DICACHE_FLASH
134425bb815Sopenharmony_ci
135425bb815Sopenharmony_ciDEFINES += \
136425bb815Sopenharmony_ci	$(UNIVERSAL_TARGET_DEFINES) \
137425bb815Sopenharmony_ci	$(CONFIGURATION_DEFINES)
138425bb815Sopenharmony_ci
139425bb815Sopenharmony_ciDDEFINES += \
140425bb815Sopenharmony_ci	$(UNIVERSAL_TARGET_DEFINES) \
141425bb815Sopenharmony_ci	$(CONFIGURATION_DEFINES)
142425bb815Sopenharmony_ci
143425bb815Sopenharmony_ci
144425bb815Sopenharmony_ci#############################################################
145425bb815Sopenharmony_ci# Recursion Magic - Don't touch this!!
146425bb815Sopenharmony_ci#
147425bb815Sopenharmony_ci# Each subtree potentially has an include directory
148425bb815Sopenharmony_ci#   corresponding to the common APIs applicable to modules
149425bb815Sopenharmony_ci#   rooted at that subtree. Accordingly, the INCLUDE PATH
150425bb815Sopenharmony_ci#   of a module can only contain the include directories up
151425bb815Sopenharmony_ci#   its parent path, and not its siblings
152425bb815Sopenharmony_ci#
153425bb815Sopenharmony_ci# Required for each makefile to inherit from the parent
154425bb815Sopenharmony_ci#
155425bb815Sopenharmony_ci
156425bb815Sopenharmony_ciINCLUDES := -I $(JERRYDIR)/jerry-core/include
157425bb815Sopenharmony_ciINCLUDES := $(INCLUDES) -I $(PDIR)include -I $(PDIR)source
158425bb815Sopenharmony_cisinclude $(SDK_PATH)/Makefile
159425bb815Sopenharmony_ci
160425bb815Sopenharmony_ci.PHONY: FORCE
161425bb815Sopenharmony_ci
162425bb815Sopenharmony_ciFORCE:
163