1# Copyright JS Foundation and other contributors, http://js.foundation 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15############################################################# 16# Required variables for each makefile 17# Discard this section from all parent makefiles 18# Expected variables (with automatic defaults): 19# CSRCS (all "C" files in the dir) 20# SUBDIRS (all subdirs with a Makefile) 21# GEN_LIBS - list of libs to be generated () 22# GEN_IMAGES - list of object file images to be generated () 23# GEN_BINS - list of binaries to be generated () 24# COMPONENTS_xxx - a list of libs/objs in the form 25# subdir/lib to be extracted and rolled up into 26# a generated lib/image xxx.a () 27# 28# Tabsize : 8 29# 30TARGET = eagle 31FLAVOR = release 32#FLAVOR = debug 33 34#EXTRA_CCFLAGS += -u 35 36ifndef PDIR # { 37GEN_IMAGES= eagle.app.v6.out 38GEN_BINS= eagle.app.v6.bin 39SPECIAL_MKTARGETS=$(APP_MKTARGETS) 40SUBDIRS= user 41endif # } PDIR 42 43# path to the JERRYSCRIPT directory 44JERRYDIR ?= $(CURDIR)/../../.. 45 46LDDIR = $(SDK_PATH)/ld 47 48############################################################# 49# JerryScript requires a modified linker script with specified alignments 50# so we use it instead of the original one from SDK. 51JERRY_LD_FILE = $(CURDIR)/ld/eagle.app.v6.ld 52 53CCFLAGS += -Os -std=c99 54#CCFLAGS += -O0 55 56TARGET_LDFLAGS = \ 57 -nostdlib \ 58 -Wl,-EL \ 59 --longcalls \ 60 --text-section-literals 61 62ifeq ($(FLAVOR),debug) 63 TARGET_LDFLAGS += -O0 -g 64endif 65 66ifeq ($(FLAVOR),release) 67 TARGET_LDFLAGS += -Os 68endif 69 70COMPONENTS_eagle.app.v6 = \ 71 user/libuser.a 72 73LINKFLAGS_eagle.app.v6 = \ 74 -L$(SDK_PATH)/lib \ 75 -Wl,--gc-sections \ 76 -Wl,-Map,output.map \ 77 -nostdlib \ 78 -T$(JERRY_LD_FILE) \ 79 -Wl,--no-check-sections \ 80 -u call_user_start \ 81 -Wl,-static \ 82 -Wl,--start-group \ 83 -lcirom \ 84 -lcrypto \ 85 -lespconn \ 86 -lespnow \ 87 -lfreertos \ 88 -lgcc \ 89 -lhal \ 90 -ljson \ 91 -llwip \ 92 -ldriver \ 93 -lmain \ 94 -lmirom \ 95 -lnet80211 \ 96 -lnopoll \ 97 -lphy \ 98 -lpp \ 99 -lpwm \ 100 -lsmartconfig \ 101 -lspiffs \ 102 -lssl \ 103 -lwpa \ 104 -lwps \ 105 -L./libs \ 106 -ljerry-core \ 107 -ljerry-libm \ 108 $(DEP_LIBS_eagle.app.v6) \ 109 -Wl,--end-group 110 111DEPENDS_eagle.app.v6 = \ 112 $(JERRY_LD_FILE) \ 113 $(LDDIR)/eagle.rom.addr.v6.ld \ 114 ./include/jerry-targetjs.h \ 115 ./libs/libjerry-core.a \ 116 ./libs/libjerry-libm.a 117 118 119############################################################# 120# Configuration i.e. compile options etc. 121# Target specific stuff (defines etc.) goes in here! 122# Generally values applying to a tree are captured in the 123# makefile at its root level - these are then overridden 124# for a subtree within the makefile rooted therein 125# 126 127#UNIVERSAL_TARGET_DEFINES = \ 128 129# Other potential configuration flags include: 130# -DTXRX_TXBUF_DEBUG 131# -DTXRX_RXBUF_DEBUG 132# -DWLAN_CONFIG_CCX 133CONFIGURATION_DEFINES = -DICACHE_FLASH 134 135DEFINES += \ 136 $(UNIVERSAL_TARGET_DEFINES) \ 137 $(CONFIGURATION_DEFINES) 138 139DDEFINES += \ 140 $(UNIVERSAL_TARGET_DEFINES) \ 141 $(CONFIGURATION_DEFINES) 142 143 144############################################################# 145# Recursion Magic - Don't touch this!! 146# 147# Each subtree potentially has an include directory 148# corresponding to the common APIs applicable to modules 149# rooted at that subtree. Accordingly, the INCLUDE PATH 150# of a module can only contain the include directories up 151# its parent path, and not its siblings 152# 153# Required for each makefile to inherit from the parent 154# 155 156INCLUDES := -I $(JERRYDIR)/jerry-core/include 157INCLUDES := $(INCLUDES) -I $(PDIR)include -I $(PDIR)source 158sinclude $(SDK_PATH)/Makefile 159 160.PHONY: FORCE 161 162FORCE: 163