https://bitbucket.org/hudson/magic-lantern
Tip revision: a0426c225644b13fe4bf2db302467b27636f9422 authored by alex@thinkpad on 17 February 2018, 21:38:53 UTC
Merged crop_rec_4k into crop_rec_4k_mlv_lite_snd
Merged crop_rec_4k into crop_rec_4k_mlv_lite_snd
Tip revision: a0426c2
Makefile
#build system for Magic Lantern.
#build and install are working, LUA not tested
#http://www.gnu.org/software/make/manual/make.html#Automatic-Variables
#http://www.gnu.org/software/make/manual/make.html#Variables_002fRecursion
TOP_DIR=.
include Makefile.setup
############################################################################################################
#
# 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)/)))
############################################################################################################
all: modules_all platform_all
install: platform_install
clean: platform_clean doxygen_clean modules_clean
############################
# module rules
############################
modules_all:
$(MAKE) -C modules all
modules_clean:
$(MAKE) -C modules clean
############################
# fir rules
############################
fir_all:
$(MAKE) -C installer clean_and_fir
fir_install: fir
$(MAKE) -C installer install_fir
############################
# platform rules
############################
platform_install:
$(MAKE) -C $(PLATFORM_PATH) install
platform_clean:
$(MAKE) -C $(PLATFORM_PATH) clean
platform_all:
$(MAKE) -C $(PLATFORM_PATH) all
############################
# additional clean rules
############################
clean:
$(call rm_files, \
magiclantern.lds \
$(LUA_PATH)/*.o \
$(LUA_PATH)/.*.d \
$(LUA_PATH)/liblua.a \
doc/Cropmarks550D.png \
doc/credits.tex \
doc/install-body.tex \
doc/install.wiki \
doc/menuindex.txt \
src/menuindexentries.h \
doc/userguide.rst \
doc/INSTALL.aux \
doc/INSTALL.log \
doc/INSTALL.out \
doc/INSTALL.pdf \
doc/INSTALL.rst \
doc/INSTALL.tex \
doc/INSTALL.toc \
doc/UserGuide-cam.aux \
doc/UserGuide-cam.log \
doc/UserGuide-cam.out \
doc/UserGuide-cam.pdf \
doc/UserGuide-cam.tex \
doc/UserGuide.aux \
doc/UserGuide.log \
doc/UserGuide.out \
doc/UserGuide.pdf \
doc/UserGuide.tex \
doc/UserGuide.toc \
*.pdf \
)
$(call rm_dir, doc/cam)
$(call rm_dir, $(BINARIES_PATH))
# We must build the docs first to use fresh doc/menuindex.txt
# 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
docs:
cd $(PLATFORM_PATH)/all; $(MAKE) docs
docq:
cd $(PLATFORM_PATH)/all; $(MAKE) docq
doxygen:
doxygen
doxygen_clean:
$(call rm_dir, doxygen-doc)
features.html: FORCE
cd features; python features-html.py > ../features.html
# static analysis: annotate each function with its caller tasks
# requires a custom build that will generate some invalid code (fixme)
# that's why "make clean" commands are used before AND after the analysis
tasks:
python -m doctest build_tools/check_tasks.py
make -C platform/5D3.113/ clean
make -C platform/5D3.113/ PREPRO=y PYCPARSER=y
make -i -C modules/ clean
make -i -C modules/ PREPRO=y PYCPARSER=y
make -i -C modules/lua clean
cd platform/5D3.113; python ../../build_tools/check_tasks.py *.i ../../modules/*/*.i
make -i -C modules/ clean
make -C platform/5D3.113 clean
tasks-clang:
clang -fsyntax-only -Wthread-safety src/mutex-test.c
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: