Make target check-source is for checking the source code itself. For
now, there's just one such check, make target check-headers. It
checks basic header sanity: for each header "FOO.h", test whether
#include "qemu/osdep.h"
#include "FOO.h"
#include "FOO.h"
compiles.
The test works only in a git tree, with git installed. It is skipped
unless $(SRC_PATH)/.git exists.
Third-party headers we don't intend to clean up are excluded from this
test. So are a few "funny" headers. See make variable
excluded-headers.
Numerous headers don't pass this test, by design or by accident. To
keep things more manageable, exclude all headers outside include/ for
now.
Headers known to fail the test are marked with
/* FIXME Does not pass make check-headers, yet! */
Headers known to work only in certain configurations are marked like
/* FIXME Does not pass make check-headers without CONFIG_WIN32, yet! */
I tried to find and mark all of them by testing various
configurations. Still, "make check" might fail for configurations I
didn't test.
Known issue: some of these don't actually need fixing; they're *meant*
to work only in certain configurations. We'll want to invent a
suitable marker that doesn't claim FIXME.
Some headers may only be included into target-dependent code: they use
identifiers poisoned by exec/poison.h, or include cpu.h. These
headers are marked with a comment
/* NOTE: May only be included into target-dependent code */
The test treats them specially.
Known issue: some of these are intended for specific targets. The
test should skip them for other targets, but doesn't. They're marked
FIXME instead, which is wrong.
New make target check-bad-headers runs the test for headers expected
to fail it. This helps with examining the failures.
Signed-off-by: Markus Armbruster
---
Makefile | 4 +-
Makefile.target | 20 +
include/block/raw-aio.h | 3 +
include/block/write-threshold.h | 3 +
include/chardev/char-win.h| 3 +
include/chardev/spice.h | 2 +
include/disas/disas.h | 2 +
include/exec/cpu-all.h| 4 +
include/exec/cpu-defs.h | 3 +
include/exec/cpu_ldst.h | 4 +
include/exec/cpu_ldst_template.h | 3 +
include/exec/cpu_ldst_useronly_template.h | 3 +
include/exec/cputlb.h | 3 +
include/exec/exec-all.h | 3 +
include/exec/gen-icount.h | 2 +
include/exec/helper-gen.h | 2 +
include/exec/helper-proto.h | 2 +
include/exec/helper-tcg.h | 2 +
include/exec/ioport.h | 2 +
include/exec/memory-internal.h| 2 +
include/exec/memory_ldst.inc.h| 2 +
include/exec/memory_ldst_cached.inc.h | 2 +
include/exec/memory_ldst_phys.inc.h | 2 +
include/exec/ram_addr.h | 3 +
include/exec/softmmu-semi.h | 3 +
include/exec/tb-hash.h| 3 +
include/exec/tb-lookup.h | 3 +
include/exec/translator.h | 3 +
include/exec/user/abitypes.h | 2 +
include/exec/user/thunk.h | 4 +
include/fpu/softfloat-macros.h| 2 +
include/fpu/softfloat.h | 2 +
include/hw/acpi/pci.h | 3 +
include/hw/acpi/tco.h | 3 +
include/hw/adc/stm32f2xx_adc.h| 2 +
include/hw/arm/allwinner-a10.h| 2 +
include/hw/arm/armsse.h | 3 +
include/hw/arm/armv7m.h | 3 +
include/hw/arm/aspeed_soc.h | 2 +
include/hw/arm/bcm2835_peripherals.h | 2 +
include/hw/arm/bcm2836.h | 2 +
include/hw/arm/digic.h| 3 +
include/hw/arm/exynos4210.h | 3 +-
include/hw/arm/fsl-imx25.h| 2 +
include/hw/arm/fsl-imx31.h| 2 +
include/hw/arm/fsl-imx6.h | 3 +
include/hw/arm/fsl-imx6ul.h | 3 +
include/hw/arm/fsl-imx7.h | 3 +
include/hw/arm/msf2-soc.h | 3 +
include/hw/arm/nrf51_soc.h| 3 +
include/hw/arm/omap.h | 2 +
include/hw/arm/sharpsl.h | 3 +
include/hw/arm/stm32f205_soc.h| 3 +
include/hw/arm/xlnx-zynqmp.h | 2 +
include/hw/block/fdc.h| 2 +
include/hw/block/flash.h | 2 +
include/hw/char/escc.h| 2 +
include/hw/char/xilinx_uartlite.h | 2 +
include/hw/core/generic-loader.h | 2 +
include/hw/cris/etraxfs.h | 2 +
include/hw/cris/etraxfs_dma.h | 2 +
include/hw/display/bcm2835_fb.h | 2 +
include/hw/display/i2c-ddc.h