Commit d08355fa authored by alex@thinkpad's avatar alex@thinkpad
Browse files

Merged unified into config_var_refactor

--HG--
branch : config_var_refactor
......@@ -85,6 +85,8 @@ modules/*/*.mo
modules/*/*.sym
modules/*/*.rsc
modules/*/hgstamp
modules/*/hgdiff.tmp
modules/*/hginfo.tmp
modules/*/module_strings.h
modules/raw_rec/raw2dng
modules/raw_rec/raw2dng.exe
......
......@@ -5,50 +5,67 @@
#http://www.gnu.org/software/make/manual/make.html#Automatic-Variables
#http://www.gnu.org/software/make/manual/make.html#Variables_002fRecursion
TOP_DIR=$(PWD)
TOP_DIR=.
include Makefile.setup
all: $(SUPPORTED_MODELS)
############################################################################################################
#
# include platform data to build "top level" rules for every model
#
# this allows e.g.
# make 5D3
# make 5D3.113
# make 5D3.123
# make 5D3_install
# make 5D3.113_install
# on this top level Makefile
#
include $(PLATFORM_PATH)/Makefile.platform.map
$(foreach _,$(PLATFORM_MAP),$(eval $(call makerule,$(word 1, $(subst ., ,$_)),$_,$(PLATFORM_PATH)/)))
############################################################################################################
# This rule is able to run make for specific model (defined in ALL_SUPPORTED_MODELS)
#60D 550D 600D 1100D 50D 500D 5D2 5DC 40D 5D3 EOSM 650D 6D 7D_MASTER::
$(ALL_SUPPORTED_MODELS)::
$(call call_make_platform)
7D:: 7D_MASTER
$(MAKE) -C $(PLATFORM_PATH)/7D.203
7DFIR: 7D_MASTER 7D
dd if=$(PLATFORM_PATH)/7D.203/autoexec.bin of=$(PLATFORM_PATH)/7D.203/autoexec.fir bs=288 skip=1 >/dev/null 2>&1
dd if=$(PLATFORM_PATH)/7D_MASTER.203/autoexec.bin of=$(PLATFORM_PATH)/7D_MASTER.203/autoexec.fir bs=288 skip=1 >/dev/null 2>&1
python ../dumper/build_fir7.py -r -s $(PLATFORM_PATH)/7D.203/autoexec.fir -m $(PLATFORM_PATH)/7D_MASTER.203/autoexec.fir $(PLATFORM_PATH)/7D.203/7D000203.FIR $(PLATFORM_PATH)/7D.203/MAGIC.FIR >/dev/null
all: modules_all platform_all
platform_all_model:
$(MAKE) -C $(PLATFORM_PATH) clean-all-model all-model
install: platform_install
install_platform_all_model: platform_all_model
$(MAKE) -C $(PLATFORM_PATH) install-all-model
clean: platform_clean doxygen_clean modules_clean
install: install_platform_all_model
############################
# module rules
############################
modules_all:
$(MAKE) -C modules all
all_modules:
$(MAKE) -C modules
modules_clean:
$(MAKE) -C modules clean
fir:
############################
# fir rules
############################
fir_all:
$(MAKE) -C installer clean_and_fir
install_fir: fir
fir_install: fir
$(MAKE) -C installer install_fir
############################
# platform rules
############################
platform_install:
$(MAKE) -C $(PLATFORM_PATH) install
platform_clean:
$(MAKE) -C platform clean
$(MAKE) -C $(PLATFORM_PATH) clean
modules_clean:
$(MAKE) -C modules clean
platform_all:
$(MAKE) -C $(PLATFORM_PATH) all
clean: platform_clean doxygen_clean modules_clean
############################
# additional clean rules
############################
clean:
$(call rm_files, \
magiclantern.lds \
$(LUA_PATH)/*.o \
......@@ -89,9 +106,9 @@ clean: platform_clean doxygen_clean modules_clean
# during 'make all'. We can't write 'zip: all docs' because
# of possible problem in case of parallel build.
# (see make's '-j' option documentation)
zip: docs
$(MAKE) all
cd $(PLATFORM_PATH)/all; $(MAKE) zip
#zip: docs
# $(MAKE) all
# cd $(PLATFORM_PATH)/all; $(MAKE) zip
docs:
cd $(PLATFORM_PATH)/all; $(MAKE) docs
......@@ -105,11 +122,12 @@ doxygen:
doxygen_clean:
$(call rm_dir, doxygen-doc)
dropbox: all
cp $(PLATFORM_PATH)/all/autoexec.bin ~/Dropbox/Public/bleeding-edge/
features.html: FORCE
cd features; python features-html.py > ../features.html
FORCE:
# we want ML platforms to be built sequentially, to avoid conflicts
# => use .NOTPARALLEL in the upper-level Makefiles only
# parallel build is still used within each platform
.NOTPARALLEL:
......@@ -16,13 +16,13 @@ all::
%.s: %.c
$(call build,CC -S,$(CC) $(CFLAGS) -S -o $@ $<)
%.sym: %
$(call build,SYMBOLS,$(READELF) -sW $< | $(GREP) GLOBAL | $(GREP) -E 'FUNC|OBJECT|ABS|NOTYPE' | $(AWK) '{print $$2 " " $$8;}' | $(GREP) -v '^ ' | $(GREP) -v __config_ | $(GREP) -v -E ' _[a-zA-Z]' | sort > $@)
$(call build,SYMBOLS,$(READELF) -sW $< | $(GREP) GLOBAL | $(GREP) -v " UND " | $(GREP) -E 'FUNC|OBJECT|ABS|NOTYPE' | $(AWK) "{print \$$2 \" \" \$$8;}" | $(GREP) -v '^ ' | $(GREP) -v __config_ | $(GREP) -v -E ' _[a-zA-Z]' | sort > $@)
%.o: %.c
$(call build,CC,$(CC) $(CFLAGS) -c -o $@ $<)
%.o: $(PLATFORM_DIR)/%.c
$(call build,CC,$(CC) $(CFLAGS) -c -o $@ $<)
%.o: $(SRC_DIR)/%.c
$(call build,CC,$(CC) $(CFLAGS) -c -o $@ $<)
%.o: $(PICOC_PATH)/%.c
$(call build,CC,$(CC) $(CFLAGS) -c -mthumb -fwhole-program -o $@ $<)
%.i: %.c
$(call build,CPP,$(CC) $(CFLAGS) -E -c -o $@ $<)
%: %.c
......@@ -31,8 +31,12 @@ all::
$(call build,AS,$(CC) $(AFLAGS) -c -o $@ $<)
%.o: $(SRC_DIR)/%.S
$(call build,AS,$(CC) $(AFLAGS) -c -o $@ $<)
%.o: %.c
$(call build,CC,$(CC) $(CFLAGS) -c -o $@ $<)
autoexec.bin: autoexec $(XOR_CHK)
$(call build,OBJCOPY,$(OBJCOPY) -O binary $< $@)
$(call build,XOR_CHK,$(XOR_CHK) $@)
autoexec-fir.bin: autoexec-fir $(XOR_CHK)
$(call build,OBJCOPY,$(OBJCOPY) -O binary $< $@)
$(call build,XOR_CHK,$(XOR_CHK) $@)
%.bin: %
$(call build,OBJCOPY,$(OBJCOPY) -O binary $< $@)
$(call build,STAT,$(STAT_CMD) $@)
......
......@@ -6,7 +6,7 @@ _CONFIGS_compile_name = _compile
_CONFIGS_clean_name = _clean
_CONFIGS_install_name = _install
_CONFIGS_to_filter_out = CONFIG_PICOC
_CONFIGS_to_filter_out = CONFIG_QEMU
_CONFIGS_to_compile = $(filter-out $(_CONFIGS_to_filter_out), $(ML_SETUP_CONFIGS_WITH_DIR))
......@@ -26,28 +26,19 @@ CONFIG_%$(_CONFIGS_clean_name):
CONFIG_%$(_CONFIGS_install_name): CONFIG_%$(_CONFIGS_compile_name)
+$(MAKE) -C $($*_DIR) install
install:: prepare_install_dir install_extra_data $(_CONFIGS_install)
# some installation media may fail when copying files in parallel
# broken drivers or controller? forcing sequential installation solves the issue...
# fixme: $(_CONFIGS_install) (currently just CONFIG_MODULES_install) does not run $(INSTALL_FINISH)
# it must be executed only once at the end (to unmount the installation media)
install:: prepare_install_dir install_extra_data
for target in $(_CONFIGS_install); do $(MAKE) $$target; done
$(INSTALL_FINISH)
prepare_install_dir:
mkdir -p $(INSTALL_ML_DIR)
mkdir -p $(INSTALL_FONTS_DIR)
mkdir -p $(INSTALL_SETTINGS_DIR)
mkdir -p $(INSTALL_DATA_DIR)
mkdir -p $(INSTALL_CROPMARKS_DIR)
mkdir -p $(INSTALL_SCRIPTS_DIR)
mkdir -p $(INSTALL_LOGS_DIR)
mkdir -p $(INSTALL_DOC_DIR)
install_extra_data: prepare_install_dir
$(CP) $(FONT_DIR)/*.rbf $(INSTALL_FONTS_DIR)/
$(CP) $(VRAM_DIR)/*.lut $(INSTALL_DATA_DIR)/
$(CP) $(CROP_DIR)/*.bmp $(INSTALL_CROPMARKS_DIR)/
#TODO: This should be moved to plugins or something more related
$(CP) $(SCRIPT_DIR)/*.lua $(INSTALL_SCRIPTS_DIR)/
$(CP) $(SCRIPT_DIR)/*.c $(INSTALL_SCRIPTS_DIR)/
$(CP) $(SCRIPT_DIR)/*.py $(INSTALL_SCRIPTS_DIR)/
$(INSTALL_ALL_SCRIPTS)
copy-autoexec: autoexec.bin
$(CP) autoexec.bin $(INSTALL_DIR)
......@@ -76,25 +67,34 @@ installdoc:
-$(CP) $(SRC_DIR)/logo.bmp $(INSTALL_ML_DIR)/docs || echo "warning Unable to copy logo.bmp"
prepare_zip: FORCE
$(eval INSTALL_DIR = $(PWD)/zip)
$(eval INSTALL_DIR = $(PWD_DIR)/zip)
$(eval INSTALL_PREPARE = )
$(eval INSTALL_FINISH = )
$(eval WIFI_SD = )
$(eval export INSTALL_DIR)
$(eval export INSTALL_MODULES_DIR)
$(eval export INSTALL_PREPARE)
$(eval export INSTALL_FINISH)
$(eval export WIFI_SD)
$(call rm_dir, $(INSTALL_DIR)/)
$(warning remove $(INSTALL_DIR))
$(call rm_files, $(PLATFORM_PATH)/*/magiclantern.sym) # only check module dependencies on current camera model
$(warning removing $(PLATFORM_PATH)/*/magiclantern.sym)
mkdir -p $(INSTALL_DIR)
# zip.txt must be the first item on the list!
magiclantern-$(VERSION).zip: install installdoc install_fir
magiclantern-$(VERSION).zip: install installer_check installdoc
-$(call rm_files, $@)
chmod -x $(INSTALL_DIR)/autoexec.bin
cd $(INSTALL_DIR); zip -z ../$@ < \
../$(SRC_DIR)/zip.txt -r .\
../$(SRC_DIR)/zip.txt -r .
$(call rm_dir, $(INSTALL_DIR)/)
zip:: | prepare_zip
zip:: magiclantern-$(VERSION).zip
zip:: magiclantern-$(VERSION).zip print_build_info
install_qemu:: | prepare_zip
install_qemu:: install
$(call build,MTOOLS,cd $(QEMU_PATH)/; ./mtools_copy_ml.sh $(INSTALL_DIR))
clean::
$(call rm_dir, zip)
......
......@@ -8,10 +8,11 @@ include $(TOP_DIR)/Makefile.top
-include $(TOP_DIR)/Makefile.user
-include $(TOP_DIR)/Makefile.setup.toolchain
ifeq ($(CONFIG_CCACHE), y)
CC := $(CCACHE) $(CC)
HOST_CC := $(CCACHE) $(CC)
HOST_CC := $(CCACHE) $(HOST_CC)
endif
# Quiet the build process
......@@ -24,12 +25,12 @@ build = \
$2
define rm_files
@printf "[ RM ] %s\n" "$1";
@printf "[ RM ] %s\n" "$1";
@$(RM) -f $1
endef
define rm_dir
@printf "[ RM dir ] %s\n" "$1";
@printf "[ RM dir ] %s\n" "$1";
@-$(RM) -rf $1
endef
......@@ -47,35 +48,37 @@ TARGET_COMPILER ?= arm-gcc
CFLAGS =
ifeq ($(TARGET_COMPILER), arm-gcc)
CFLAGS += -Os -mthumb-interwork -march=armv5te \
CFLAGS += -Os -march=armv5te \
-D__ARM__
endif
#
# ToDo: remove
# -Wno-implicit-function-declaration
#
# Reason: these warnings make sense! potential crash situations.
#
CFLAGS +=\
$(FLAGS) \
-Wall \
-Wextra \
-Wno-unused-parameter \
-Wno-unused-function \
-Werror-implicit-function-declaration \
-Wno-missing-field-initializers \
-Wno-format \
-Wdouble-promotion \
-ffast-math \
-fsingle-precision-constant \
-fshort-double \
-fno-builtin-printf \
-std=gnu99 \
-Winline \
-I$(PLATFORM_INC) \
-I$(PLATFORM_INC)/include \
-I$(SRC_DIR) \
-I$(PICOC_PATH) \
# The short-double flag is removed in GCC 6+
GCC_DUMPVERSION := $(shell ${CC} -dumpversion)
ifneq (,$(findstring GCC-4,GCC-$(GCC_DUMPVERSION)))
CFLAGS += -fshort-double
endif
ifneq (,$(findstring GCC-5,GCC-$(GCC_DUMPVERSION)))
CFLAGS += -fshort-double
endif
NOT_USED_FLAGS=\
......@@ -91,9 +94,9 @@ ifdef CONFIG_SMALL_FONTS
$(error CONFIG_SMALL_FONTS must be renamed to ML_SRC_SMALL_FONTS)
endif
ifdef CONFIG_STATIC_FONTS
$(error CONFIG_STATIC_FONTS must be renamed to ML_SRC_STATIC_FONTS)
endif
# some recent Linux distros have this defined
# we don't use it, but the checks below will get upset and print a warning
CONFIG_SITE=n
ensureCorrectValue = $(if $(filter $($(1)),y n 1 0), ,$(1)=n $(warning BAD VALUE FOR $(1)=$($(1)) DEFAULTING TO n))
_defined_configs = $(filter CONFIG_%, $(.VARIABLES))
......@@ -127,3 +130,27 @@ ML_SETUP_CONFIGS_WITH_DIR = $(_CONFIGS-with-dir-file)
CFLAGS += $(CFLAG_USER)
FLAGS += $(LFLAG_USER)
AFLAGS += $(AFLAG_USER)
# install preparing targets are called from both platform and modules
# however, placing these rules at the top will select "install_prepare"
# as the default target, which is not what we want
# fixme: better solution?
.DEFAULT_GOAL := all
install_prepare:
$(INSTALL_PREPARE)
install_finish:
$(INSTALL_FINISH)
.PHONY: install_prepare install_finish
prepare_install_dir: install_prepare
@echo "[ MKDIR ] ML directory structure..."
@$(MKDIR) -p $(INSTALL_ML_DIR)
@$(MKDIR) -p $(INSTALL_MODULES_DIR)
@$(MKDIR) -p $(INSTALL_FONTS_DIR)
@$(MKDIR) -p $(INSTALL_DATA_DIR)
@$(MKDIR) -p $(INSTALL_CROPMARKS_DIR)
@$(MKDIR) -p $(INSTALL_SCRIPTS_DIR)
@$(MKDIR) -p $(INSTALL_DOC_DIR)
# toolchain setup, based on preferences from Makefile.user.default and Makefile.user
ifneq ("$(wildcard $(PREFERRED_ARM_PATH)/bin/arm-$(ARM_ABI)-gcc$(GCC_VERSION))","")
# use this one if installed
ARM_BINPATH=$(PREFERRED_ARM_PATH)/bin
CROSS_COMPILE=$(ARM_BINPATH)/arm-$(ARM_ABI)-
CC=$(CROSS_COMPILE)gcc$(GCC_VERSION)
ifeq ("$(MAKELEVEL)","0")
$(info Using $(CC) (preferred).)
endif
else ifneq ("$(shell which arm-$(ARM_ABI)-gcc 2>/dev/null)","")
# otherwise, try whatever is installed on the system
CC=$(shell which arm-$(ARM_ABI)-gcc)
CROSS_COMPILE=$(shell basename '$(CC)' gcc)
ifeq ("$(MAKELEVEL)","0")
$(info Using $(CC) (from PATH).)
endif
else ifneq ("$(wildcard ~/gcc*arm*eabi*/bin/arm-$(ARM_ABI)-gcc$(GCC_VERSION))","")
# nothing found? look for any gcc*arm*eabi* in the home directory,
# matching ARM_ABI and GCC_VERSION from Makefile.user if specified
# if more than one match is found, pick the one with highest version number
ARM_BINPATH=$(shell dirname `ls -v ~/gcc*arm*eabi*/bin/arm-$(ARM_ABI)-gcc$(GCC_VERSION) | tail -1`)
CROSS_COMPILE=$(ARM_BINPATH)/arm-$(ARM_ABI)-
CC=$(CROSS_COMPILE)gcc$(GCC_VERSION)
ifeq ("$(MAKELEVEL)","0")
$(info Using $(CC) (found in home directory).)
endif
else
# still nothing?
$(info )
$(info Please configure a valid ARM cross-compiler.)
$(info If arm-$(ARM_ABI)-gcc is in your executable path, it will be used.)
$(info )
$(info Preferred: gcc 5_4-2016q3 32-bit from https://launchpad.net/gcc-arm-embedded)
$(info Also fine: gcc-arm-embedded 6.x, Linaro arm-eabi 7.x, gcc-arm-none-eabi from Ubuntu,)
$(info gcc-arm-embedded from team-gcc-arm-embedded PPA on Ubuntu, others may work as well.)
$(info )
$(info For GDB+QEMU, you *must* use a 32-bit version, e.g. gdb-arm-none-eabi:i386,)
$(info gcc-arm-embedded:i386 from PPA, 32-bit arm-none-eabi-gdb from gcc-arm-embedded.)
$(info Unfortunately, Linaro's arm-eabi-gdb does not work, whether 32 or 64 bit.)
$(info )
$(error )
endif
# used for NEWLIB_PATH and DIETLIBC_PATH in Makefile.user.default
ARM_ABI_LIB=$(ARM_ABI)
ifeq ($(ARM_ABI),eabi)
# Linaro's "eabi" appears to be compatible with none-eabi; is it the same thing?
ARM_ABI_LIB=none-eabi
endif
MAKE=make
RM=rm
MV=mv
MKDIR=mkdir
......@@ -10,9 +9,7 @@ DATE=date -u
BINARIES_PATH=binaries
LUA_PATH=$(TOP_DIR)/lua
PICOC_DIR=$(TOP_DIR)/picoc
PICOC_PATH=$(PICOC_DIR)
PWD=$(shell pwd)
PWD_DIR=$(shell pwd)
SRC_DIR=$(TOP_DIR)/src
PLATFORM_PATH=$(TOP_DIR)/platform
BUILDER_DIR=$(TOP_DIR)/../dumper
......@@ -22,9 +19,13 @@ CROP_DIR=$(TOP_DIR)/data/cropmks
VRAM_DIR=$(TOP_DIR)/data/vram
SCRIPT_DIR=$(TOP_DIR)/scripts
MODULES_DIR=$(TOP_DIR)/modules
INSTALLER_DIR=$(TOP_DIR)/installer
BIN_FILES=magiclantern magiclantern.bin autoexec.bin autoexec
CF_CARD_ML_DIR = $(CF_CARD)/ML
BUILD_TOOLS_DIR=$(TOP_DIR)/build_tools
XOR_CHK=$(BUILD_TOOLS_DIR)/xor_chk
INSTALL_DIR ?= $(CF_CARD)
INSTALL_ML_DIR = $(INSTALL_DIR)/ML
INSTALL_FONTS_DIR= $(INSTALL_ML_DIR)/fonts
......@@ -35,8 +36,21 @@ INSTALL_CROPMARKS_DIR= $(INSTALL_ML_DIR)/cropmks
INSTALL_SCRIPTS_DIR= $(INSTALL_ML_DIR)/scripts
INSTALL_DOC_DIR = $(INSTALL_ML_DIR)/doc
INSTALL_LOGS_DIR = $(INSTALL_ML_DIR)/logs
INSTALL_PREPARE ?= $(MOUNT_CARD)
INSTALL_FINISH ?= $(UMOUNT) $(CF_CARD)
# this one is called from both platform and modules
# copies all scripts, preserving directory structure
# (simpler way to do this?)
INSTALL_ALL_SCRIPTS = \
$(call build,SCRIPTS,\
for f in $(shell find $(SCRIPT_DIR) -type f -name *.lua); do \
dst=$(INSTALL_SCRIPTS_DIR)/$${f\#\#$(SCRIPT_DIR)/}; \
dstdir=`dirname $$dst`; \
$(MKDIR) -p $$dstdir; \
$(CP) $$f $$dst; \
done)
make_loop = +$(foreach entry, $(1), $(MAKE) -C $(entry) $(2);)
# $1 = root_dir
......@@ -56,3 +70,11 @@ endef
define targets_rules
$(foreach model, $1, $(model)_rule_$(strip $(2)))
endef
# evaluate once and only when used
# https://stackoverflow.com/a/28542922
# example: FOO = $(call eval_once,FOO,$(shell command))
define eval_once
$(eval $1 := $2)$(value $1)
endef
......@@ -11,44 +11,127 @@ ifeq ($(UNAME), Darwin)
else
# Default settings for remaining operating systems
UMOUNT=umount
CF_CARD="/media/EOS_DIGITAL/"
# some distros may require:
# UMOUNT=sudo umount
# CF_CARD=/media/EOS_DIGITAL
CF_CARD = $(call eval_once,CF_CARD,$(shell mount | grep -oE "[^ ]+/EOS_DIGITAL[^ ]*"))
STAT_CMD=stat -c "%n: %s bytes"
endif
# Supported camera models
SUPPORTED_MODELS:=50D 60D 550D 600D 500D 5D2 5D3 7D 650D 700D EOSM 1100D 6D
# change this if you have to mount the card every time you run "make install"
# examples:
# MOUNT_CARD=gio mount -d /dev/mmcblk0p1
# MOUNT_CARD=gio mount dav://192.168.0.1/
MOUNT_CARD=
# Experimental setup for Wi-Fi SD cards
# to enable, run this before "make install":
# export WIFI_SD=y
# alternatives: "make install WIFI_SD=y", "WIFI_SD=y make install"
# override network names and IP address in Makefile.user
# fixme: how to enable it from Makefile.user?
ifeq ($(WIFI_SD),y)
# fill in the name of your regular wifi network
# leave this empty to disable wifi after installation
WIFI_MAIN_NETWORK=<your regular wifi network>
# these are for Toshiba FlashAir; you may have to change them for other wifi cards
# note: if the wifi card connects directly to a router and gets a fixed IP,
# just enter your regular wifi network name here as well
WIFI_CARD_NETWORK=flashair
WIFI_CARD_IP=192.168.0.1
CF_CARD=/run/user/1000/gvfs/dav:host=$(WIFI_CARD_IP),ssl=false
# executed before installation
# connect to WIFI_CARD_NETWORK if not already,
# and mount card directory via WebDAV
# also monitor the connection in background while the card is mounted (signal tends to be weak)
INSTALL_PREPARE=$(call build,WIFI_SET,\
if ! nmcli conn show --active | grep $(WIFI_CARD_NETWORK) > /dev/null; then \
while ! nmcli device wifi list | grep $(WIFI_CARD_NETWORK); do \
if [ `nmcli radio wifi` = disabled ]; \
then nmcli radio wifi on; sleep 5; \
else nmcli dev wifi rescan 2>/dev/null || true; sleep 2; \
fi; \
echo -n "."; \
done; \
nmcli conn up $(WIFI_CARD_NETWORK); \
fi; \
for i in `seq 1 20`; do \
if ping -c 3 -l 3 -W 1 $(WIFI_CARD_IP) > /dev/null; then break; fi; \
echo -n "."; \
done; \
if ping -c 3 -l 3 -W 1 $(WIFI_CARD_IP) > /dev/null; then \
if ! gio mount -l | grep "dav://$(WIFI_CARD_IP)/"; then \
gio mount dav://$(WIFI_CARD_IP)/ ; \
fi; \
else \
echo "$(WIFI_CARD_IP) appears to be offline." ; \
exit 1; \
fi; \
( while gio mount -l | grep -q "dav://$(WIFI_CARD_IP)/"; do \
if ! ping -c 3 -l 3 -W 1 $(WIFI_CARD_IP) > /dev/null; then \
echo -n "!"; \
fi; \
sleep 1; \
done \
) & \
)
# restore connection to your main wifi network
# or just turn it off if you are using a wired network
WIFI_RESTORE=$(call build,WIFI_END,\
if [ "$(WIFI_MAIN_NETWORK)" = "" ]; then \
echo "Turning off Wi-Fi..."; \
nmcli radio wifi off; \
elif ! nmcli conn show --active | grep $(WIFI_MAIN_NETWORK) > /dev/null; then \
echo "Connecting to $(WIFI_MAIN_NETWORK)..."; \
nmcli conn up $(WIFI_MAIN_NETWORK); \
fi; )
UMOUNT_CARD=$(call build,UNMOUNT,\
while ! gio mount -u dav://$(WIFI_CARD_IP)/; do \
sleep 2; \
done \
)
# executed after installation
define INSTALL_FINISH =
$(UMOUNT_CARD)
$(WIFI_RESTORE)
@printf "\nFinished.\nMake sure the camera will not write anything to the card until restart.\n"
endef
endif
# GCC-related stuff
# for yagarto or the official ARM toolchain use ARM_ABI=none-eabi otherwise use ARM_ABI=elf
# for linaro bare-metal toolchain, use ARM_ABI=eabi
ARM_ABI=none-eabi
GCC_VERSION=-4.8.3
DIETLIB_VERSION=0.33
NEWLIB_OPT_LEVEL=O3
# example: GCC_VERSION=-5.4.1
# use default if unspecified
GCC_VERSION=
# use this one if installed on the system
# otherwise, use the one from executable PATH
PREFERRED_ARM_PATH=~/gcc-arm-none-eabi-5_4-2016q3
#PREFERRED_ARM_PATH=~/gcc-linaro-7.1.1-2017.08-i686_arm-eabi
DIETLIB_VERSION=0.33
DIETLIBC_OPT_LEVEL=Os
NEWLIB_OPT_LEVEL=O3
ARM_PATH=~/gcc-arm-none-eabi-4_8-2013q4
ARM_BINPATH=$(ARM_PATH)/bin
ARM_LIBGCC_PATH=$(ARM_PATH)/lib/gcc/arm-$(ARM_ABI)/$(subst -,,$(GCC_VERSION))
NEWLIB_PATH=$(SRC_DIR)/libs/arm-$(ARM_ABI)-$(NEWLIB_OPT_LEVEL)
DIETLIBC_PATH=$(SRC_DIR)/libs/dietlib-$(DIETLIB_VERSION)-$(ARM_ABI)-$(DIETLIBC_OPT_LEVEL)
NEWLIB_PATH=$(SRC_DIR)/libs/arm-$(ARM_ABI_LIB)-$(NEWLIB_OPT_LEVEL)
DIETLIBC_PATH=$(SRC_DIR)/libs/dietlib-$(DIETLIB_VERSION)-$(ARM_ABI_LIB)-$(DIETLIBC_OPT_LEVEL)
# Static libraries used
ARM_LIBGCC_A=$(ARM_LIBGCC_PATH)/libgcc.a
ARM_LIBGCC_A=$(shell $(CC) -print-libgcc-file-name)
NEWLIB_LIBM_A=$(NEWLIB_PATH)/libm.a
NEWLIB_LIBC_A=$(NEWLIB_PATH)/libc.a
DIETLIBC_A=$(DIETLIBC_PATH)/dietlibc.a
ML_LIBC = dietlibc.a newlib-libc.a newlib-libm.a gcc-libgcc.a
CROSS_COMPILE=$(ARM_BINPATH)/arm-$(ARM_ABI)-
ifeq ($(OS),Windows_NT)
CC=$(CROSS_COMPILE)gcc$(GCC_VERSION).exe
else
CC=$(CROSS_COMPILE)gcc$(GCC_VERSION)
endif
OBJCOPY=$(CROSS_COMPILE)objcopy
OBJDUMP=$(CROSS_COMPILE)objdump
AR=$(CROSS_COMPILE)ar
......@@ -95,6 +178,13 @@ AWK=awk
PYTHON=python2
RST2LATEX=rst2latex.py
#
# QEMU installation directory
# used for "make install_qemu"
#
QEMU_DIR ?= qemu-eos
QEMU_PATH=$(TOP_DIR)/../$(QEMU_DIR)
# Naming convention for Magic Lantern builds:
# General rules: