162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci# Makefile for the Linux device tree
362306a36Sopenharmony_ci
462306a36Sopenharmony_ciobj-$(CONFIG_EISA)	        += eisa-bus.o
562306a36Sopenharmony_ciobj-${CONFIG_EISA_PCI_EISA}     += pci_eisa.o
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci# virtual_root.o should be the last EISA root device to initialize,
862306a36Sopenharmony_ci# so leave it at the end of the list.
962306a36Sopenharmony_ciobj-${CONFIG_EISA_VIRTUAL_ROOT} += virtual_root.o
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci# Ugly hack to get DEVICE_NAME_SIZE value...
1362306a36Sopenharmony_ciDEVICE_NAME_SIZE = 50
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci$(obj)/eisa-bus.o: $(obj)/devlist.h
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ciquiet_cmd_eisaid = GEN     $@
1862306a36Sopenharmony_ci      cmd_eisaid = sed -e '/^\#/D' -e 's/^\([[:alnum:]]\{7\}\) \+"\([^"]\{1,$(DEVICE_NAME_SIZE)\}\).*"/EISA_DEVINFO ("\1", "\2"),/' $< > $@
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ciclean-files := devlist.h
2162306a36Sopenharmony_ci$(obj)/devlist.h: $(src)/eisa.ids include/linux/device.h
2262306a36Sopenharmony_ci	$(call cmd,eisaid)
23