| 1 | not-y := n |
| 2 | not-n := y |
| 3 | m-not-y := n |
| 4 | m-not-n := m |
| 5 | |
| 6 | ifeq ($(CONFIG_X86_MICPCI),) |
| 7 | CONFIG_X86_MICPCI := n |
| 8 | endif |
| 9 | ifeq ($(CONFIG_X86_MICPCI)$(MIC_CARD_ARCH),n) |
| 10 | $(error building for host, but $$(MIC_CARD_ARCH) is unset) |
| 11 | endif |
| 12 | ifneq ($(MIC_CARD_ARCH),$(firstword $(filter l1om k1om,$(MIC_CARD_ARCH)))) |
| 13 | $(error $$(MIC_CARD_ARCH) must be l1om or k1om) |
| 14 | endif |
| 15 | |
| 16 | # Force optimization to -O2 in case the kernel was configured to use |
| 17 | # -Os. The main reason is pretty dumb -- -Os has a warning -O2 doesn't, |
| 18 | # and we compile with -Werror internally. Another reason is that -O2 is |
| 19 | # what we're used to in terms of validation and performance analysis. We |
| 20 | # should probably get rid of this, though. |
| 21 | subdir-ccflags-y += -O2 |
| 22 | |
| 23 | # Makes it easy to inject "-Werror" from the environment |
| 24 | subdir-ccflags-y += $(KERNWARNFLAGS) |
| 25 | |
| 26 | # Bake some information about who built the module(s), and what version |
| 27 | # of the source code they started with. Possibly useful during debug. |
| 28 | subdir-ccflags-y += -DBUILD_NUMBER=\"'$(MPSS_BUILDNO)'\" |
| 29 | subdir-ccflags-y += -DBUILD_BYWHOM=\"'$(MPSS_BUILTBY)'\" |
| 30 | subdir-ccflags-y += -DBUILD_ONDATE=\"'$(MPSS_BUILTON)'\" |
| 31 | subdir-ccflags-y += -DBUILD_SCMVER=\"'$(MPSS_COMMIT)'\" |
| 32 | subdir-ccflags-y += -DBUILD_VERSION=\"'$(or $(MPSS_VERSION),0.0) ($(MPSS_BUILTBY))'\" |
| 33 | |
| 34 | # Code common with the host mustn't use CONFIG_M[LK]1OM directly. |
| 35 | # But of course it does anyway. Arrgh. |
| 36 | subdir-ccflags-$(CONFIG_ML1OM) += -DMIC_IS_L1OM |
| 37 | subdir-ccflags-$(CONFIG_MK1OM) += -DMIC_IS_K1OM |
| 38 | ifeq ($(MIC_CARD_ARCH),l1om) |
| 39 | subdir-ccflags-y += -DMIC_IS_L1OM -DCONFIG_ML1OM |
| 40 | endif |
| 41 | ifeq ($(MIC_CARD_ARCH),k1om) |
| 42 | subdir-ccflags-y += -DMIC_IS_K1OM -DCONFIG_MK1OM |
| 43 | endif |
| 44 | |
| 45 | # a shorthand for "runs on the card"? |
| 46 | subdir-ccflags-$(CONFIG_X86_MICPCI) += -D_MIC_SCIF_ |
| 47 | |
| 48 | # "runs on the host" |
| 49 | subdir-ccflags-$(not-$(CONFIG_X86_MICPCI)) += -DHOST -DUSE_VCONSOLE |
| 50 | |
| 51 | # always set? what's this thing's purpose? |
| 52 | subdir-ccflags-y += -D__LINUX_GPL__ -D_MODULE_SCIF_ |
| 53 | |
| 54 | subdir-ccflags-y += -I$(M)/include |
| 55 | |
| 56 | obj-$(CONFIG_X86_MICPCI) += dma/ micscif/ pm_scif/ ras/ |
| 57 | obj-$(CONFIG_X86_MICPCI) += vcons/ vnet/ mpssboot/ ramoops/ virtio/ |
| 58 | |
| 59 | obj-$(m-not-$(CONFIG_X86_MICPCI)) += mic.o |
| 60 | |
| 61 | mic-objs := |
| 62 | mic-objs += dma/mic_dma_lib.o |
| 63 | mic-objs += dma/mic_dma_md.o |
| 64 | mic-objs += host/acptboot.o |
| 65 | mic-objs += host/ioctl.o |
| 66 | mic-objs += host/linpm.o |
| 67 | mic-objs += host/linpsmi.o |
| 68 | mic-objs += host/linscif_host.o |
| 69 | mic-objs += host/linsysfs.o |
| 70 | mic-objs += host/linux.o |
| 71 | mic-objs += host/linvcons.o |
| 72 | mic-objs += host/linvnet.o |
| 73 | mic-objs += host/micpsmi.o |
| 74 | mic-objs += host/micscif_pm.o |
| 75 | mic-objs += host/pm_ioctl.o |
| 76 | mic-objs += host/pm_pcstate.o |
| 77 | mic-objs += host/tools_support.o |
| 78 | mic-objs += host/uos_download.o |
| 79 | mic-objs += host/vhost/mic_vhost.o |
| 80 | mic-objs += host/vhost/mic_blk.o |
| 81 | mic-objs += host/vmcore.o |
| 82 | mic-objs += micscif/micscif_api.o |
| 83 | mic-objs += micscif/micscif_debug.o |
| 84 | mic-objs += micscif/micscif_fd.o |
| 85 | mic-objs += micscif/micscif_intr.o |
| 86 | mic-objs += micscif/micscif_nm.o |
| 87 | mic-objs += micscif/micscif_nodeqp.o |
| 88 | mic-objs += micscif/micscif_ports.o |
| 89 | mic-objs += micscif/micscif_rb.o |
| 90 | mic-objs += micscif/micscif_rma_dma.o |
| 91 | mic-objs += micscif/micscif_rma_list.o |
| 92 | mic-objs += micscif/micscif_rma.o |
| 93 | mic-objs += micscif/micscif_select.o |
| 94 | mic-objs += micscif/micscif_smpt.o |
| 95 | mic-objs += micscif/micscif_sysfs.o |
| 96 | mic-objs += micscif/micscif_va_gen.o |
| 97 | mic-objs += micscif/micscif_va_node.o |
| 98 | mic-objs += vnet/micveth_dma.o |
| 99 | mic-objs += vnet/micveth_param.o |
| 100 | |
| 101 | version-le = $(shell printf '%s\n' $(1) | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -c >/dev/null 2>&1 && echo t) |
| 102 | ifeq ($(call version-le, 2.6.23 $(KERNELRELEASE)),t) |
| 103 | ccflags-y += $(mic-cflags) |
| 104 | else |
| 105 | $(error building against kernels <= 2.6.23 is broken) |
| 106 | endif |