1 # SPDX-License-Identifier: GPL-2.0
3 # Makefile for the drm device driver. This driver provides support for the
4 # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
6 # Add a set of useful warning flags and enable -Werror for CI to prevent
7 # trivial mistakes from creeping in. We have to do this piecemeal as we reject
8 # any patch that isn't warning clean, so turning on -Wall -Wextra (or W=1) we
9 # need to filter out dubious warnings. Still it is our interest
10 # to keep running locally with W=1 C=1 until we are completely clean.
12 # Note the danger in using -Wall -Wextra is that when CI updates gcc we
13 # will most likely get a sudden build breakage... Hopefully we will fix
14 # new warnings before CI updates!
15 subdir-ccflags-y := -Wall -Wextra
16 subdir-ccflags-y += $(call cc-disable-warning, unused-parameter)
17 subdir-ccflags-y += $(call cc-disable-warning, type-limits)
18 subdir-ccflags-y += $(call cc-disable-warning, missing-field-initializers)
19 subdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable)
21 subdir-ccflags-y += $(call cc-disable-warning, sign-compare)
22 subdir-ccflags-y += $(call cc-disable-warning, sometimes-uninitialized)
23 subdir-ccflags-y += $(call cc-disable-warning, initializer-overrides)
24 subdir-ccflags-y += $(call cc-disable-warning, frame-address)
25 subdir-ccflags-$(CONFIG_DRM_XE_WERROR) += -Werror
27 # Fine grained warnings disable
28 CFLAGS_xe_pci.o = $(call cc-disable-warning, override-init)
30 subdir-ccflags-y += -I$(obj) -I$(srctree)/$(src)
33 hostprogs := xe_gen_wa_oob
35 generated_oob := $(obj)/generated/xe_wa_oob.c $(obj)/generated/xe_wa_oob.h
37 quiet_cmd_wa_oob = GEN $(notdir $(generated_oob))
38 cmd_wa_oob = mkdir -p $(@D); $^ $(generated_oob)
40 $(generated_oob) &: $(obj)/xe_gen_wa_oob $(srctree)/$(src)/xe_wa_oob.rules
43 $(obj)/xe_guc.o $(obj)/xe_migrate.o $(obj)/xe_ring_ops.o $(obj)/xe_vm.o $(obj)/xe_wa.o $(obj)/xe_ttm_stolen_mgr.o: $(generated_oob)
45 # Please keep these build lists sorted!
71 xe_gt_tlb_invalidation.o \
83 xe_hw_engine_class_sysfs.o \
114 xe_ttm_stolen_mgr.o \
122 xe_wait_user_fence.o \
126 # graphics hardware monitoring (HWMON) support
127 xe-$(CONFIG_HWMON) += xe_hwmon.o
129 obj-$(CONFIG_DRM_XE) += xe.o
130 obj-$(CONFIG_DRM_XE_KUNIT_TEST) += tests/
132 xe-$(CONFIG_PERF_EVENTS) += xe_pmu.o
135 hdrtest_find_args := -not -path xe_rtp_helpers.h
137 always-$(CONFIG_DRM_XE_WERROR) += \
138 $(patsubst %.h,%.hdrtest, $(shell cd $(srctree)/$(src) && find * -name '*.h' $(hdrtest_find_args)))
140 quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
141 cmd_hdrtest = $(CC) -DHDRTEST $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@
143 $(obj)/%.hdrtest: $(src)/%.h FORCE
144 $(call if_changed_dep,hdrtest)