Skip to content

Commit

Permalink
libs/light: Makefile cleanup
Browse files Browse the repository at this point in the history
Rework "libacpi.h" include in "libxl_x86_acpi.c" as to be more
selective about the include path and only add "tools/libacpi/". Also
"libxl_dom.c" don't use "libacpi.h" anymore. Use "-iquote" for libacpi
headers.

Get rid of the weird "$(eval stem =" in the middle of a recipe and use
a make automatic variable "$(*F)" instead.

Signed-off-by: Anthony PERARD <[email protected]>
Reviewed-by: Juergen Gross <[email protected]>
  • Loading branch information
anthonyper-ctx authored and jbeulich committed Feb 8, 2023
1 parent a2a5d09 commit 78c04e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
16 changes: 7 additions & 9 deletions tools/libs/light/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ LDLIBS += $(LDLIBS-y)
$(OBJS-y) $(PIC_OBJS) $(LIBXL_TEST_OBJS): CFLAGS += $(CFLAGS_LIBXL) -include $(XEN_ROOT)/tools/config.h
$(ACPI_OBJS) $(ACPI_PIC_OBJS): CFLAGS += -I. -DLIBACPI_STDUTILS=\"$(CURDIR)/libxl_x86_acpi.h\"
$(TEST_PROG_OBJS) _libxl.api-for-check: CFLAGS += $(CFLAGS_libxentoollog) $(CFLAGS_libxentoolcore)
libxl_dom.o libxl_dom.opic: CFLAGS += -I$(XEN_ROOT)/tools # include libacpi/x86.h
libxl_x86_acpi.o libxl_x86_acpi.opic: CFLAGS += -I$(XEN_ROOT)/tools
libxl_x86_acpi.o libxl_x86_acpi.opic: CFLAGS += -iquote $(ACPI_PATH)
$(SAVE_HELPER_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn) $(CFLAGS_libxenguest)

testidl.o: CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenlight)
Expand Down Expand Up @@ -225,13 +224,12 @@ testidl.o: $(XEN_INCLUDE)/libxl.h
# This exploits the 'multi-target pattern rule' trick.
# gentypes.py should be executed only once to make all the targets.
_libxl_type%.h _libxl_type%_json.h _libxl_type%_private.h _libxl_type%.c: libxl_type%.idl gentypes.py idl.py
$(eval stem = $(notdir $*))
$(PYTHON) gentypes.py libxl_type$(stem).idl __libxl_type$(stem).h __libxl_type$(stem)_private.h \
__libxl_type$(stem)_json.h __libxl_type$(stem).c
$(call move-if-changed,__libxl_type$(stem).h,_libxl_type$(stem).h)
$(call move-if-changed,__libxl_type$(stem)_private.h,_libxl_type$(stem)_private.h)
$(call move-if-changed,__libxl_type$(stem)_json.h,_libxl_type$(stem)_json.h)
$(call move-if-changed,__libxl_type$(stem).c,_libxl_type$(stem).c)
$(PYTHON) gentypes.py libxl_type$(*F).idl __libxl_type$(*F).h __libxl_type$(*F)_private.h \
__libxl_type$(*F)_json.h __libxl_type$(*F).c
$(call move-if-changed,__libxl_type$(*F).h,_libxl_type$(*F).h)
$(call move-if-changed,__libxl_type$(*F)_private.h,_libxl_type$(*F)_private.h)
$(call move-if-changed,__libxl_type$(*F)_json.h,_libxl_type$(*F)_json.h)
$(call move-if-changed,__libxl_type$(*F).c,_libxl_type$(*F).c)

.PRECIOUS: _libxl_type%.h _libxl_type%.c

Expand Down
2 changes: 1 addition & 1 deletion tools/libs/light/libxl_x86_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "libxl_arch.h"
#include <xen/hvm/hvm_info_table.h>
#include <xen/hvm/e820.h>
#include "libacpi/libacpi.h"
#include "libacpi.h"

/* Number of pages holding ACPI tables */
#define NUM_ACPI_PAGES 16
Expand Down

0 comments on commit 78c04e2

Please sign in to comment.