Hollis Blanchard
2005-Sep-20 14:46 UTC
[Xen-devel] [patch 1/2] rename libxc Makefile variables
Apparently the BUILD_ naming is left over from when libxenguest was going to be called libxenbuild. I was confused until I discovered "BUILD" has nothing to do with the act of compiling source code. Also, prefix the un-prefixed variables with "CTRL" to match. Build-tested on i386. Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> diff -r d1cbfaf804d9 tools/libxc/Makefile --- a/tools/libxc/Makefile Mon Sep 19 17:10:20 2005 +++ b/tools/libxc/Makefile Mon Sep 19 16:24:08 2005 @@ -12,35 +12,35 @@ XEN_ROOT = ../.. include $(XEN_ROOT)/tools/Rules.mk -SRCS :-BUILD_SRCS :-SRCS += xc_bvtsched.c -SRCS += xc_core.c -SRCS += xc_domain.c -SRCS += xc_evtchn.c -SRCS += xc_gnttab.c -SRCS += xc_misc.c -SRCS += xc_physdev.c -SRCS += xc_private.c -SRCS += xc_sedf.c -BUILD_SRCS += xc_linux_build.c -BUILD_SRCS += xc_load_bin.c -BUILD_SRCS += xc_load_elf.c +CTRL_SRCS :+GUEST_SRCS :+CTRL_SRCS += xc_bvtsched.c +CTRL_SRCS += xc_core.c +CTRL_SRCS += xc_domain.c +CTRL_SRCS += xc_evtchn.c +CTRL_SRCS += xc_gnttab.c +CTRL_SRCS += xc_misc.c +CTRL_SRCS += xc_physdev.c +CTRL_SRCS += xc_private.c +CTRL_SRCS += xc_sedf.c +GUEST_SRCS += xc_linux_build.c +GUEST_SRCS += xc_load_bin.c +GUEST_SRCS += xc_load_elf.c ifeq ($(XEN_TARGET_ARCH),ia64) -BUILD_SRCS += xc_ia64_stubs.c +GUEST_SRCS += xc_ia64_stubs.c else ifeq ($(XEN_TARGET_ARCH),x86_32) -SRCS += xc_ptrace.c -SRCS += xc_ptrace_core.c +CTRL_SRCS += xc_ptrace.c +CTRL_SRCS += xc_ptrace_core.c endif -BUILD_SRCS += xc_load_aout9.c -BUILD_SRCS += xc_linux_restore.c -BUILD_SRCS += xc_linux_save.c -BUILD_SRCS += xc_vmx_build.c +GUEST_SRCS += xc_load_aout9.c +GUEST_SRCS += xc_linux_restore.c +GUEST_SRCS += xc_linux_save.c +GUEST_SRCS += xc_vmx_build.c endif -BUILD_SRCS += xg_private.c +GUEST_SRCS += xg_private.c CFLAGS += -Wall CFLAGS += -Werror @@ -52,11 +52,11 @@ LDFLAGS += -L. DEPS = .*.d -LIB_OBJS := $(patsubst %.c,%.o,$(SRCS)) -PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS)) +LIB_CTRL_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS)) +PIC_CTRL_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS)) -LIB_BUILD_OBJS := $(patsubst %.c,%.o,$(BUILD_SRCS)) -PIC_BUILD_OBJS := $(patsubst %.c,%.opic,$(BUILD_SRCS)) +LIB_GUEST_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS)) +PIC_GUEST_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS)) LIB := libxenctrl.a LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR) @@ -104,7 +104,7 @@ .PHONY: TAGS clean rpm install all TAGS: - etags -t $(SRCS) *.h + etags -t $(CTRL_SRCS) *.h clean: rm -rf *.a *.so* *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen @@ -120,7 +120,7 @@ # libxenctrl -libxenctrl.a: $(LIB_OBJS) +libxenctrl.a: $(LIB_CTRL_OBJS) $(AR) rc $@ $^ libxenctrl.so: libxenctrl.so.$(MAJOR) @@ -128,12 +128,12 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR) ln -sf $< $@ -libxenctrl.so.$(MAJOR).$(MINOR): $(PIC_OBJS) +libxenctrl.so.$(MAJOR).$(MINOR): $(PIC_CTRL_OBJS) $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenctrl.so.$(MAJOR) -shared -o $@ $^ # libxenguest -libxenguest.a: $(LIB_BUILD_OBJS) +libxenguest.a: $(LIB_GUEST_OBJS) $(AR) rc $@ $^ libxenguest.so: libxenguest.so.$(MAJOR) @@ -141,7 +141,7 @@ libxenguest.so.$(MAJOR): libxenguest.so.$(MAJOR).$(MINOR) ln -sf $< $@ -libxenguest.so.$(MAJOR).$(MINOR): $(PIC_BUILD_OBJS) libxenctrl.so +libxenguest.so.$(MAJOR).$(MINOR): $(PIC_GUEST_OBJS) libxenctrl.so $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenguest.so.$(MAJOR) -shared -o $@ $^ -lz -lxenctrl -include $(DEPS) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hollis Blanchard
2005-Sep-20 14:49 UTC
[Xen-devel] [patch 2/2] rename libxc Makefile variables
This illustrates the concept I was talking about earlier, where we can remove XEN_TARGET_ARCH tests. This patch includes a slight hack to set the appropriate makefile variables, and obviously that should move into a global Config.mk as I mentioned earlier. This will greatly ease trying to insert PowerPC-specific files into the libxc build. Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> diff -r dfe0a61a0099 -r 02f9fedb6b68 tools/libxc/Makefile --- a/tools/libxc/Makefile Mon Sep 19 21:29:57 2005 +++ b/tools/libxc/Makefile Tue Sep 20 14:43:29 2005 @@ -12,35 +12,35 @@ XEN_ROOT = ../.. include $(XEN_ROOT)/tools/Rules.mk -CTRL_SRCS :-GUEST_SRCS :-CTRL_SRCS += xc_bvtsched.c -CTRL_SRCS += xc_core.c -CTRL_SRCS += xc_domain.c -CTRL_SRCS += xc_evtchn.c -CTRL_SRCS += xc_gnttab.c -CTRL_SRCS += xc_misc.c -CTRL_SRCS += xc_physdev.c -CTRL_SRCS += xc_private.c -CTRL_SRCS += xc_sedf.c -GUEST_SRCS += xc_linux_build.c -GUEST_SRCS += xc_load_bin.c -GUEST_SRCS += xc_load_elf.c +$(XEN_TARGET_ARCH) = y +TARGET_ARCH := $(patsubst x86%,x86,$(XEN_TARGET_ARCH)) +$(TARGET_ARCH) = y -ifeq ($(XEN_TARGET_ARCH),ia64) -GUEST_SRCS += xc_ia64_stubs.c -else -ifeq ($(XEN_TARGET_ARCH),x86_32) -CTRL_SRCS += xc_ptrace.c -CTRL_SRCS += xc_ptrace_core.c -endif -GUEST_SRCS += xc_load_aout9.c -GUEST_SRCS += xc_linux_restore.c -GUEST_SRCS += xc_linux_save.c -GUEST_SRCS += xc_vmx_build.c -endif +CTRL_SRCS-y :+GUEST_SRCS-y :+CTRL_SRCS-y += xc_bvtsched.c +CTRL_SRCS-y += xc_core.c +CTRL_SRCS-y += xc_domain.c +CTRL_SRCS-y += xc_evtchn.c +CTRL_SRCS-y += xc_gnttab.c +CTRL_SRCS-y += xc_misc.c +CTRL_SRCS-y += xc_physdev.c +CTRL_SRCS-y += xc_private.c +CTRL_SRCS-y += xc_sedf.c +GUEST_SRCS-y += xc_linux_build.c +GUEST_SRCS-y += xc_load_bin.c +GUEST_SRCS-y += xc_load_elf.c -GUEST_SRCS += xg_private.c +GUEST_SRCS-$(ia64) += xc_ia64_stubs.c + +CTRL_SRCS-$(x86_32) += xc_ptrace.c +CTRL_SRCS-$(x86_32) += xc_ptrace_core.c +GUEST_SRCS-$(x86) += xc_load_aout9.c +GUEST_SRCS-$(x86) += xc_linux_restore.c +GUEST_SRCS-$(x86) += xc_linux_save.c +GUEST_SRCS-$(x86) += xc_vmx_build.c + +GUEST_SRCS-y += xg_private.c CFLAGS += -Wall CFLAGS += -Werror @@ -52,11 +52,11 @@ LDFLAGS += -L. DEPS = .*.d -LIB_CTRL_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS)) -PIC_CTRL_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS)) +LIB_CTRL_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y)) +PIC_CTRL_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y)) -LIB_GUEST_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS)) -PIC_GUEST_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS)) +LIB_GUEST_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS-y)) +PIC_GUEST_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y)) LIB := libxenctrl.a LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel