162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ciobj-$(CONFIG_SPEAKUP_SYNTH_ACNTSA) += speakup_acntsa.o
362306a36Sopenharmony_ciobj-$(CONFIG_SPEAKUP_SYNTH_ACNTPC) += speakup_acntpc.o
462306a36Sopenharmony_ciobj-$(CONFIG_SPEAKUP_SYNTH_APOLLO) += speakup_apollo.o
562306a36Sopenharmony_ciobj-$(CONFIG_SPEAKUP_SYNTH_AUDPTR) += speakup_audptr.o
662306a36Sopenharmony_ciobj-$(CONFIG_SPEAKUP_SYNTH_BNS) += speakup_bns.o
762306a36Sopenharmony_ciobj-$(CONFIG_SPEAKUP_SYNTH_DECTLK) += speakup_dectlk.o
862306a36Sopenharmony_ciobj-$(CONFIG_SPEAKUP_SYNTH_DECEXT) += speakup_decext.o
962306a36Sopenharmony_ciobj-$(CONFIG_SPEAKUP_SYNTH_DECPC) += speakup_decpc.o
1062306a36Sopenharmony_ciobj-$(CONFIG_SPEAKUP_SYNTH_DTLK) += speakup_dtlk.o
1162306a36Sopenharmony_ciobj-$(CONFIG_SPEAKUP_SYNTH_KEYPC) += speakup_keypc.o
1262306a36Sopenharmony_ciobj-$(CONFIG_SPEAKUP_SYNTH_LTLK) += speakup_ltlk.o
1362306a36Sopenharmony_ciobj-$(CONFIG_SPEAKUP_SYNTH_SOFT) += speakup_soft.o
1462306a36Sopenharmony_ciobj-$(CONFIG_SPEAKUP_SYNTH_SPKOUT) += speakup_spkout.o
1562306a36Sopenharmony_ciobj-$(CONFIG_SPEAKUP_SYNTH_TXPRT) += speakup_txprt.o
1662306a36Sopenharmony_ciobj-$(CONFIG_SPEAKUP_SYNTH_DUMMY) += speakup_dummy.o
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ciobj-$(CONFIG_SPEAKUP) += speakup.o
1962306a36Sopenharmony_cispeakup-y := \
2062306a36Sopenharmony_ci	buffers.o \
2162306a36Sopenharmony_ci	devsynth.o \
2262306a36Sopenharmony_ci	i18n.o \
2362306a36Sopenharmony_ci	fakekey.o \
2462306a36Sopenharmony_ci	main.o \
2562306a36Sopenharmony_ci	keyhelp.o \
2662306a36Sopenharmony_ci	kobjects.o \
2762306a36Sopenharmony_ci	selection.o \
2862306a36Sopenharmony_ci	spk_ttyio.o \
2962306a36Sopenharmony_ci	synth.o \
3062306a36Sopenharmony_ci	thread.o \
3162306a36Sopenharmony_ci	varhandlers.o
3262306a36Sopenharmony_cispeakup-$(CONFIG_SPEAKUP_SERIALIO) += serialio.o
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ciclean-files := mapdata.h speakupmap.h
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ci# Generate mapdata.h from headers
3962306a36Sopenharmony_cihostprogs += makemapdata
4062306a36Sopenharmony_cimakemapdata-objs := makemapdata.o
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ciquiet_cmd_mkmap = MKMAP   $@
4362306a36Sopenharmony_ci      cmd_mkmap = TOPDIR=$(srctree) \
4462306a36Sopenharmony_ci		  SPKDIR=$(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD),$(srctree)/drivers/accessibility/speakup) \
4562306a36Sopenharmony_ci		  $(obj)/makemapdata > $@
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci$(obj)/mapdata.h: $(obj)/makemapdata
4862306a36Sopenharmony_ci	$(call cmd,mkmap)
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ci# Generate speakupmap.h from mapdata.h
5262306a36Sopenharmony_cihostprogs += genmap
5362306a36Sopenharmony_cigenmap-objs := genmap.o
5462306a36Sopenharmony_ci$(obj)/genmap.o: $(obj)/mapdata.h
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ciquiet_cmd_genmap = GENMAP  $@
5762306a36Sopenharmony_ci      cmd_genmap = $(obj)/genmap $< > $@
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci$(obj)/speakupmap.h: $(src)/speakupmap.map $(obj)/genmap
6062306a36Sopenharmony_ci	$(call cmd,genmap)
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci$(obj)/main.o: $(obj)/speakupmap.h
63