Files
xen/tools/include/xen-foreign/Makefile
T
Anthony PERARD a03b3552d4 libs,tools/include: Clean "clean" targets
There is no need for an extra "cleanlocal" target, we can use
double-colon rules instead.

Generated headers are now in tools/include/, so remove those file
there.

Remove -f flag as it's already in $(RM).

libs.mk:
  - don't try to remove "*.rpm" anymore.

libs/light:
  - "_paths.*.tmp" isn't created anymore.
  - clean "libxenlight_test.so" and "libxl_test_*.opic".

libs/stat:
  - don't remove $(DEPS_RM) from here as it is already done in
    "libs.mk".

libs/util:
  - fix clean of version-script file.

include/xen-foreign:
  - remove __pycache__

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
2022-06-16 16:58:50 +01:00

58 lines
1.9 KiB
Makefile

XEN_ROOT=$(CURDIR)/../../..
include $(XEN_ROOT)/tools/Rules.mk
ROOT = $(XEN_ROOT)/xen/include/public
architectures := arm32 arm64 x86_32 x86_64
headers := $(patsubst %, %.h, $(architectures))
.PHONY: all clean distclean check-headers
all: $(headers) check-headers
clean:
rm -f $(headers)
rm -f checker checker.c
rm -f *.pyc *.o *~
rm -rf __pycache__
distclean: clean
checker: checker.c $(headers)
$(HOSTCC) $(HOSTCFLAGS) -D__XEN_TOOLS__ -o $@ $<
check-headers: checker
./checker > tmp.size
diff -u reference.size tmp.size
rm tmp.size
arm32.h: mkheader.py structs.py $(ROOT)/arch-arm.h $(ROOT)/xen.h
$(PYTHON) $< $(basename $@) $@.tmp $(filter %.h,$^)
#Avoid mixing an alignment directive with a uint64_t cast or sizeof expression
sed 's/(__align8__ \(uint64_t\))/(\1)/g' < $@.tmp > $@.tmp2
rm $@.tmp
$(call move-if-changed,$@.tmp2,$@)
arm64.h: mkheader.py structs.py $(ROOT)/arch-arm.h $(ROOT)/xen.h
$(PYTHON) $< $(basename $@) $@.tmp $(filter %.h,$^)
#Avoid mixing an alignment directive with a uint64_t cast or sizeof expression
sed 's/(__align8__ \(uint64_t\))/(\1)/g' < $@.tmp > $@.tmp2
rm $@.tmp
$(call move-if-changed,$@.tmp2,$@)
x86_32.h: mkheader.py structs.py $(ROOT)/arch-x86/xen-x86_32.h $(ROOT)/arch-x86/xen.h $(ROOT)/xen.h
$(PYTHON) $< $(basename $@) $@.tmp $(filter %.h,$^)
#Avoid mixing an alignment directive with a uint64_t cast or sizeof expression
sed 's/(__align8__ \(uint64_t\))/(\1)/g' < $@.tmp > $@.tmp2
rm $@.tmp
$(call move-if-changed,$@.tmp2,$@)
x86_64.h: mkheader.py structs.py $(ROOT)/arch-x86/xen-x86_64.h $(ROOT)/arch-x86/xen.h $(ROOT)/xen.h
$(PYTHON) $< $(basename $@) $@.tmp $(filter %.h,$^)
#Avoid mixing an alignment directive with a uint64_t cast or sizeof expression
sed 's/(__align8__ \(uint64_t\))/(\1)/g' < $@.tmp > $@.tmp2
rm $@.tmp
$(call move-if-changed,$@.tmp2,$@)
checker.c: mkchecker.py structs.py
$(PYTHON) $< $@ $(architectures)