forked from reticulatedpines/magiclantern_simplified
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.inc
108 lines (83 loc) · 3.43 KB
/
Makefile.inc
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
# Extra rules added to Makefile.setup
all:: $(_CONFIGS_to_compile_rules)
_CONFIGS_compile_name = _compile
_CONFIGS_clean_name = _clean
_CONFIGS_install_name = _install
_CONFIGS_to_filter_out = CONFIG_QEMU
_CONFIGS_to_compile = $(filter-out $(_CONFIGS_to_filter_out), $(ML_SETUP_CONFIGS_WITH_DIR))
_CONFIGS_to_compile_rules = $(foreach elem, $(_CONFIGS_to_compile), $(elem)$(_CONFIGS_compile_name))
_CONFIGS_clean=$(patsubst %, %$(_CONFIGS_clean_name), $(_CONFIGS_to_compile))
_CONFIGS_install=$(patsubst %, %$(_CONFIGS_install_name), $(_CONFIGS_to_compile))
clean-all:: clean $(_CONFIGS_clean)
CONFIG_%$(_CONFIGS_compile_name):
+$(MAKE) -C $($*_DIR)
CONFIG_%$(_CONFIGS_clean_name):
+$(MAKE) -C $($*_DIR) clean
CONFIG_%$(_CONFIGS_install_name): CONFIG_%$(_CONFIGS_compile_name)
+$(MAKE) -C $($*_DIR) 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)
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)/
$(INSTALL_ALL_SCRIPTS)
copy-autoexec: autoexec.bin
$(CP) autoexec.bin $(INSTALL_DIR)
$(INSTALL_FINISH)
ptpinstall: autoexec.bin
gvfs-mount -s gphoto2
sleep 2
cat $(TOP_DIR)/src/ptpcam.txt | ptpcam --chdk
diff autoexec.bin autoexec.test
docs:
cd $(DOC_DIR) && RST2LATEX=$(RST2LATEX) $(PYTHON) mkdoc.py
cd $(DOC_DIR) && RST2LATEX=$(RST2LATEX) $(PYTHON) mkdoc-cam.py
docq:
cd $(DOC_DIR) && RST2LATEX=$(RST2LATEX) $(PYTHON) mkdoc.py
cd $(DOC_DIR) && RST2LATEX=$(RST2LATEX) $(PYTHON) mkdoc-cam.py quick
installdoc:
mkdir -p $(INSTALL_DOC_DIR)
-$(CP) -v $(DOC_DIR)/cam/* $(INSTALL_DOC_DIR)
-$(CP) $(DOC_DIR)/README.user $(INSTALL_ML_DIR)/README
-$(CP) $(DOC_DIR)/INSTALL.pdf $(INSTALL_DIR) || echo "warning Unable to copy INSTALL.pdf"
-$(CP) $(DOC_DIR)/UserGuide.pdf $(INSTALL_DIR) || echo "warning Unable to copy UserGuide.pdf"
-$(CP) $(SRC_DIR)/logo.bmp $(INSTALL_ML_DIR)/docs || echo "warning Unable to copy logo.bmp"
prepare_zip: FORCE
$(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)/)
mkdir -p $(INSTALL_DIR)
# zip.txt must be the first item on the list!
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 .
$(call rm_dir, $(INSTALL_DIR)/)
zip:: | prepare_zip
zip:: magiclantern-$(VERSION).zip print_build_info
disk_image: zip
cd $(PLATFORM_PATH)/$(ML_MODEL_DIR)
$(PYTHON3) $(PLATFORM_PATH)/create_disk_image_from_zip.py magiclantern-$(VERSION).zip
install_qemu:: | prepare_zip
install_qemu:: install
$(call build,MTOOLS,cd $(QEMU_PATH)/; ./mtools_copy_ml.sh $(INSTALL_DIR))
clean::
$(call rm_dir, zip)
$(call rm_files, *.zip)
$(call rm_files, sd.qcow2 cf.qcow2 guestmount.pid)
FORCE:
include $(TOP_DIR)/Makefile.obsolete