Hello Philippe,

On Friday 19 of January 2018 13:38:11 Philippe Mathieu-Daudé wrote:
> > diff --git a/hw/can/Makefile.objs b/hw/can/Makefile.objs
> > new file mode 100644
> > index 0000000000..1028d7c455
> > --- /dev/null
> > +++ b/hw/can/Makefile.objs
> > @@ -0,0 +1,6 @@
> > +# CAN bus interfaces emulation and infrastructure
> > +
> > +ifeq ($(CONFIG_CAN_CORE),y)
> > +common-obj-y += can_core.o
>
> Please follow QEMU style:
>
> common-obj-$(CONFIG_CAN_BUS) += can_core.o

I agree that in the first patch it is not logical
to use if but problem is that final Makefile.objs
needs to resolve operating system logic and other
conditions.

ifeq ($(CONFIG_CAN_BUS),y)
common-obj-y += can_core.o
ifeq ($(CONFIG_LINUX),y)
common-obj-y += can_socketcan.o
else
common-obj-y += can_host_stub.o
endif
common-obj-$(CONFIG_CAN_SJA1000) += can_sja1000.o
common-obj-$(CONFIG_CAN_PCI) += can_kvaser_pci.o
common-obj-$(CONFIG_CAN_PCI) += can_pcm3680_pci.o
common-obj-$(CONFIG_CAN_PCI) += can_mioe3680_pci.o
endif

If there is Kconfig style system
controlling mutual options combination then plain
common-obj-$(CONFIG_*) would work but it is not
the case and I have followed seen in another QEMU 

I have followed style found in another subsystems

qemu-git/hw/smbios/Makefile.objs

ifeq ($(CONFIG_SMBIOS),y)
common-obj-y += smbios.o
common-obj-$(CONFIG_IPMI) += smbios_type_38.o
common-obj-$(call lnot,$(CONFIG_IPMI)) += smbios_type_38-stub.o
else
common-obj-y += smbios-stub.o
endif

common-obj-$(CONFIG_ALL) += smbios-stub.o
common-obj-$(CONFIG_ALL) += smbios_type_38-stub.o

qemu-git/hw/timer/Makefile.objs

...
...
qemu-git/hw/vfio/Makefile.objs

I am not sure how to resolve these conditions better way.

Best wishes,

Pavel

Reply via email to