summaryrefslogtreecommitdiffstats
path: root/src/tempmodule/meson.build
blob: b2c88b91cc90a8371f81a7977a1200c4720be912 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
fw_filename = 'fw.bin'
if get_option('fwbuild')
	espmake = find_program('espmake')

	sourcedir = meson.current_source_dir()
	fw_filenames = ['main.ino', 'indicator.c', 'temperature.c', 'indicator.h', 'temperature.h']
	fw_sources = files(fw_filenames)
	fw = custom_target('fw',
			output : fw_filename,
			input : fw_sources,
			command : [espmake, '-C', sourcedir, '&&', 'cp', '/tmp/mkESP/main_d1_mini/main.bin', '@OUTDIR@/' + fw_filename], install : true, install_dir : resource_dir)

	if get_option('fwflash')
		esptool = find_program('esptool.py')
		run_target('flash_fw', depends : fw, command : [esptool, 'write_flash', '0x0', fw])
	endif
endif