summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in5
-rw-r--r--kdump/Makefile17
-rw-r--r--kexec/Makefile50
-rw-r--r--kexec/arch/i386/Makefile18
-rw-r--r--kexec/arch/ia64/Makefile10
-rw-r--r--kexec/arch/ppc/Makefile12
-rw-r--r--kexec/arch/ppc64/Makefile14
-rw-r--r--kexec/arch/s390/Makefile6
-rw-r--r--kexec/arch/sh/Makefile10
-rw-r--r--kexec/arch/x86_64/Makefile20
-rw-r--r--kexec_test/Makefile13
-rw-r--r--purgatory/Makefile32
-rw-r--r--purgatory/arch/alpha/Makefile3
-rw-r--r--purgatory/arch/i386/Makefile22
-rw-r--r--purgatory/arch/ia64/Makefile8
-rw-r--r--purgatory/arch/ppc/Makefile6
-rw-r--r--purgatory/arch/ppc64/Makefile8
-rw-r--r--purgatory/arch/s390/Makefile4
-rw-r--r--purgatory/arch/sh/Makefile4
-rw-r--r--purgatory/arch/x86_64/Makefile23
-rw-r--r--util_lib/Makefile11
21 files changed, 136 insertions, 160 deletions
diff --git a/Makefile.in b/Makefile.in
index b4b293a..7df7032 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -120,6 +120,11 @@ all: $(TARGETS)
@$(MKDIR) -p $(@D)
$(COMPILE.S) -MD -o $@ $<
+# utility function for converting a list of files (with extension) to
+# file.o (or file.d) format.
+objify = $(addsuffix .o, $(basename $(1)))
+depify = $(addsuffix .d, $(basename $(1)))
+
# Utility function library
#
include $(srcdir)/util_lib/Makefile
diff --git a/kdump/Makefile b/kdump/Makefile
index 0e3bf14..2c8f9ea 100644
--- a/kdump/Makefile
+++ b/kdump/Makefile
@@ -2,15 +2,13 @@
# kdump (reading a crashdump from memory)
#
-KDUMP_C_SRCS:= kdump/kdump.c
+KDUMP_SRCS:= kdump/kdump.c
-KDUMP_C_OBJS:= $(patsubst %.c, %.o, $(KDUMP_C_SRCS))
-KDUMP_C_DEPS:= $(patsubst %.c, %.d, $(KDUMP_C_SRCS))
-KDUMP_SRCS:= $(KDUMP_C_SRCS)
-KDUMP_OBJS:= $(KDUMP_C_OBJS)
-KDUMP_DEPS:= $(KDUMP_C_DEPS)
-KDUMP:= $(SBINDIR)/kdump
-KDUMP_MANPAGE:= $(MANDIR)/man8/kdump.8
+KDUMP_OBJS = $(call objify, $(KDUMP_SRCS))
+KDUMP_DEPS = $(call depify, $(KDUMP_OBJS))
+
+KDUMP = $(SBINDIR)/kdump
+KDUMP_MANPAGE = $(MANDIR)/man8/kdump.8
-include $(KDUMP_DEPS)
@@ -22,9 +20,6 @@ $(KDUMP_MANPAGE): kdump/kdump.8
$(MKDIR) -p $(MANDIR)/man8
cp kdump/kdump.8 $(KDUMP_MANPAGE)
echo::
- @echo "KDUMP_C_SRCS $(KDUMP_C_SRCS)"
- @echo "KDUMP_C_DEPS $(KDUMP_C_DEPS)"
- @echo "KDUMP_C_OBJS $(KDUMP_C_OBJS)"
@echo "KDUMP_SRCS $(KDUMP_SRCS)"
@echo "KDUMP_DEPS $(KDUMP_DEPS)"
@echo "KDUMP_OBJS $(KDUMP_OBJS)"
diff --git a/kexec/Makefile b/kexec/Makefile
index 6f7a49c..3d9db29 100644
--- a/kexec/Makefile
+++ b/kexec/Makefile
@@ -1,37 +1,35 @@
#
# kexec (linux booting linux)
#
-PURGATORY_HEX_C:= kexec/purgatory.c
+PURGATORY_HEX_C = kexec/purgatory.c
$(PURGATORY_HEX_C): $(PURGATORY) $(BIN_TO_HEX)
$(MKDIR) -p $(@D)
$(BIN_TO_HEX) purgatory < $(PURGATORY) > $@
-KEXEC_C_SRCS:= kexec/kexec.c
-KEXEC_C_SRCS+= kexec/ifdown.c
-KEXEC_C_SRCS+= kexec/kexec-elf.c
-KEXEC_C_SRCS+= kexec/kexec-elf-exec.c
-KEXEC_C_SRCS+= kexec/kexec-elf-core.c
-KEXEC_C_SRCS+= kexec/kexec-elf-rel.c
-KEXEC_C_SRCS+= kexec/kexec-elf-boot.c
-KEXEC_C_SRCS+= kexec/kexec-iomem.c
-KEXEC_C_SRCS+= kexec/crashdump.c
-KEXEC_C_SRCS+= kexec/crashdump-xen.c
-KEXEC_C_GENERATED_SRCS+= $(PURGATORY_HEX_C)
-KEXEC_S_SRCS:=
-KEXEC_S_GENERATED_SRCS:=
+KEXEC_SRCS =
+KEXEC_GENERATED_SRCS =
+
+KEXEC_SRCS += kexec/kexec.c
+KEXEC_SRCS += kexec/ifdown.c
+KEXEC_SRCS += kexec/kexec-elf.c
+KEXEC_SRCS += kexec/kexec-elf-exec.c
+KEXEC_SRCS += kexec/kexec-elf-core.c
+KEXEC_SRCS += kexec/kexec-elf-rel.c
+KEXEC_SRCS += kexec/kexec-elf-boot.c
+KEXEC_SRCS += kexec/kexec-iomem.c
+KEXEC_SRCS += kexec/crashdump.c
+KEXEC_SRCS += kexec/crashdump-xen.c
+
+KEXEC_GENERATED_SRCS += $(PURGATORY_HEX_C)
include $(srcdir)/kexec/arch/$(ARCH)/Makefile
-KEXEC_C_OBJS:= $(patsubst %.c, %.o, $(KEXEC_C_SRCS) $(KEXEC_C_GENERATED_SRCS))
-KEXEC_C_DEPS:= $(patsubst %.c, %.d, $(KEXEC_C_SRCS))
-KEXEC_S_OBJS:= $(patsubst %.S, %.o, $(KEXEC_S_SRCS) $(KEXEC_S_GENERATED_SRCS))
-KEXEC_S_DEPS:= $(patsubst %.S, %.d, $(KEXEC_S_SRCS))
-KEXEC_SRCS:= $(KEXEC_C_SRCS) $(KEXEC_S_SRCS)
-KEXEC_OBJS:= $(KEXEC_C_OBJS) $(KEXEC_S_OBJS)
-KEXEC_DEPS:= $(KEXEC_C_DEPS) $(KEXEC_S_DEPS)
-KEXEC:= $(SBINDIR)/kexec
-KEXEC_MANPAGE:= $(MANDIR)/man8/kexec.8
+KEXEC_OBJS = $(call objify, $(KEXEC_SRCS) $(KEXEC_GENERATED_SRCS))
+KEXEC_DEPS = $(call depify, $(KEXEC_OBJS))
+
+KEXEC = $(SBINDIR)/kexec
+KEXEC_MANPAGE = $(MANDIR)/man8/kexec.8
-include $(KEXEC_DEPS)
@@ -45,12 +43,6 @@ $(KEXEC_MANPAGE): kexec/kexec.8
@$(MKDIR) -p $(MANDIR)/man8
cp kexec/kexec.8 $(KEXEC_MANPAGE)
echo::
- @echo "KEXEC_C_SRCS $(KEXEC_C_SRCS)"
- @echo "KEXEC_C_DEPS $(KEXEC_C_DEPS)"
- @echo "KEXEC_C_OBJS $(KEXEC_C_OBJS)"
- @echo "KEXEC_S_SRCS $(KEXEC_S_SRCS)"
- @echo "KEXEC_S_DEPS $(KEXEC_S_DEPS)"
- @echo "KEXEC_S_OBJS $(KEXEC_S_OBJS)"
@echo "KEXEC_SRCS $(KEXEC_SRCS)"
@echo "KEXEC_DEPS $(KEXEC_DEPS)"
@echo "KEXEC_OBJS $(KEXEC_OBJS)"
diff --git a/kexec/arch/i386/Makefile b/kexec/arch/i386/Makefile
index d77b064..7bda300 100644
--- a/kexec/arch/i386/Makefile
+++ b/kexec/arch/i386/Makefile
@@ -1,12 +1,12 @@
#
# kexec i386 (linux booting linux)
#
-KEXEC_C_SRCS+= kexec/arch/i386/kexec-x86.c
-KEXEC_C_SRCS+= kexec/arch/i386/kexec-elf-x86.c
-KEXEC_C_SRCS+= kexec/arch/i386/kexec-elf-rel-x86.c
-KEXEC_C_SRCS+= kexec/arch/i386/kexec-bzImage.c
-KEXEC_C_SRCS+= kexec/arch/i386/kexec-multiboot-x86.c
-KEXEC_C_SRCS+= kexec/arch/i386/kexec-beoboot-x86.c
-KEXEC_C_SRCS+= kexec/arch/i386/kexec-nbi.c
-KEXEC_C_SRCS+= kexec/arch/i386/x86-linux-setup.c
-KEXEC_C_SRCS+= kexec/arch/i386/crashdump-x86.c
+KEXEC_SRCS += kexec/arch/i386/kexec-x86.c
+KEXEC_SRCS += kexec/arch/i386/kexec-elf-x86.c
+KEXEC_SRCS += kexec/arch/i386/kexec-elf-rel-x86.c
+KEXEC_SRCS += kexec/arch/i386/kexec-bzImage.c
+KEXEC_SRCS += kexec/arch/i386/kexec-multiboot-x86.c
+KEXEC_SRCS += kexec/arch/i386/kexec-beoboot-x86.c
+KEXEC_SRCS += kexec/arch/i386/kexec-nbi.c
+KEXEC_SRCS += kexec/arch/i386/x86-linux-setup.c
+KEXEC_SRCS += kexec/arch/i386/crashdump-x86.c
diff --git a/kexec/arch/ia64/Makefile b/kexec/arch/ia64/Makefile
index a8a94fe..ea0bdb0 100644
--- a/kexec/arch/ia64/Makefile
+++ b/kexec/arch/ia64/Makefile
@@ -1,9 +1,9 @@
#
# kexec ia64 (linux booting linux)
#
-KEXEC_C_SRCS+= kexec/arch/ia64/kexec-iomem.c
-KEXEC_C_SRCS+= kexec/arch/ia64/kexec-ia64.c
-KEXEC_C_SRCS+= kexec/arch/ia64/kexec-elf-ia64.c
-KEXEC_C_SRCS+= kexec/arch/ia64/kexec-elf-rel-ia64.c
-KEXEC_C_SRCS+= kexec/arch/ia64/crashdump-ia64.c
+KEXEC_SRCS += kexec/arch/ia64/kexec-iomem.c
+KEXEC_SRCS += kexec/arch/ia64/kexec-ia64.c
+KEXEC_SRCS += kexec/arch/ia64/kexec-elf-ia64.c
+KEXEC_SRCS += kexec/arch/ia64/kexec-elf-rel-ia64.c
+KEXEC_SRCS += kexec/arch/ia64/crashdump-ia64.c
diff --git a/kexec/arch/ppc/Makefile b/kexec/arch/ppc/Makefile
index 972a2f2..52295ae 100644
--- a/kexec/arch/ppc/Makefile
+++ b/kexec/arch/ppc/Makefile
@@ -1,9 +1,9 @@
#
# kexec ppc (linux booting linux)
#
-KEXEC_C_SRCS+= kexec/arch/ppc/kexec-ppc.c
-KEXEC_C_SRCS+= kexec/arch/ppc/kexec-elf-ppc.c
-KEXEC_C_SRCS+= kexec/arch/ppc/kexec-elf-rel-ppc.c
-KEXEC_C_SRCS+= kexec/arch/ppc/kexec-dol-ppc.c
-KEXEC_S_SRCS+= kexec/arch/ppc/ppc-setup-simple.S
-KEXEC_S_SRCS+= kexec/arch/ppc/ppc-setup-dol.S
+KEXEC_SRCS += kexec/arch/ppc/kexec-ppc.c
+KEXEC_SRCS += kexec/arch/ppc/kexec-elf-ppc.c
+KEXEC_SRCS += kexec/arch/ppc/kexec-elf-rel-ppc.c
+KEXEC_SRCS += kexec/arch/ppc/kexec-dol-ppc.c
+KEXEC_SRCS += kexec/arch/ppc/ppc-setup-simple.S
+KEXEC_SRCS += kexec/arch/ppc/ppc-setup-dol.S
diff --git a/kexec/arch/ppc64/Makefile b/kexec/arch/ppc64/Makefile
index 187a303..b3de3a6 100644
--- a/kexec/arch/ppc64/Makefile
+++ b/kexec/arch/ppc64/Makefile
@@ -1,11 +1,9 @@
#
# kexec ppc64 (linux booting linux)
#
-KEXEC_C_SRCS+= kexec/arch/ppc64/kexec-elf-rel-ppc64.c
-KEXEC_C_SRCS+= kexec/arch/ppc64/kexec-zImage-ppc64.c
-KEXEC_C_SRCS+= kexec/arch/ppc64/fs2dt.c
-KEXEC_C_SRCS+= kexec/arch/ppc64/kexec-elf-ppc64.c
-KEXEC_C_SRCS+= kexec/arch/ppc64/kexec-ppc64.c
-KEXEC_C_SRCS+= kexec/arch/ppc64/crashdump-ppc64.c
-
-KEXEC_S_SRCS+=
+KEXEC_SRCS += kexec/arch/ppc64/kexec-elf-rel-ppc64.c
+KEXEC_SRCS += kexec/arch/ppc64/kexec-zImage-ppc64.c
+KEXEC_SRCS += kexec/arch/ppc64/fs2dt.c
+KEXEC_SRCS += kexec/arch/ppc64/kexec-elf-ppc64.c
+KEXEC_SRCS += kexec/arch/ppc64/kexec-ppc64.c
+KEXEC_SRCS += kexec/arch/ppc64/crashdump-ppc64.c
diff --git a/kexec/arch/s390/Makefile b/kexec/arch/s390/Makefile
index 1d26e81..2e496b0 100644
--- a/kexec/arch/s390/Makefile
+++ b/kexec/arch/s390/Makefile
@@ -1,6 +1,6 @@
#
# kexec s390 (linux booting linux)
#
-KEXEC_C_SRCS+= kexec/arch/s390/kexec-s390.c
-KEXEC_C_SRCS+= kexec/arch/s390/kexec-image.c
-KEXEC_C_SRCS+= kexec/arch/s390/kexec-elf-rel-s390.c
+KEXEC_SRCS += kexec/arch/s390/kexec-s390.c
+KEXEC_SRCS += kexec/arch/s390/kexec-image.c
+KEXEC_SRCS += kexec/arch/s390/kexec-elf-rel-s390.c
diff --git a/kexec/arch/sh/Makefile b/kexec/arch/sh/Makefile
index 753e073..4d49490 100644
--- a/kexec/arch/sh/Makefile
+++ b/kexec/arch/sh/Makefile
@@ -1,8 +1,8 @@
#
# kexec sh (linux booting linux)
#
-KEXEC_C_SRCS+= kexec/arch/sh/kexec-sh.c
-KEXEC_C_SRCS+= kexec/arch/sh/kexec-zImage-sh.c
-KEXEC_C_SRCS+= kexec/arch/sh/kexec-netbsd-sh.c
-KEXEC_C_SRCS+= kexec/arch/sh/kexec-elf-rel-sh.c
-KEXEC_S_SRCS+= kexec/arch/sh/netbsd_booter.S
+KEXEC_SRCS += kexec/arch/sh/kexec-sh.c
+KEXEC_SRCS += kexec/arch/sh/kexec-zImage-sh.c
+KEXEC_SRCS += kexec/arch/sh/kexec-netbsd-sh.c
+KEXEC_SRCS += kexec/arch/sh/kexec-elf-rel-sh.c
+KEXEC_SRCS += kexec/arch/sh/netbsd_booter.S
diff --git a/kexec/arch/x86_64/Makefile b/kexec/arch/x86_64/Makefile
index 799e2a4..c3a4d4e 100644
--- a/kexec/arch/x86_64/Makefile
+++ b/kexec/arch/x86_64/Makefile
@@ -1,13 +1,13 @@
#
# kexec x86_64 (linux booting linux)
#
-KEXEC_C_SRCS+= kexec/arch/i386/kexec-elf-x86.c
-KEXEC_C_SRCS+= kexec/arch/i386/kexec-bzImage.c
-KEXEC_C_SRCS+= kexec/arch/i386/kexec-multiboot-x86.c
-KEXEC_C_SRCS+= kexec/arch/i386/kexec-beoboot-x86.c
-KEXEC_C_SRCS+= kexec/arch/i386/kexec-nbi.c
-KEXEC_C_SRCS+= kexec/arch/i386/x86-linux-setup.c
-KEXEC_C_SRCS+= kexec/arch/x86_64/crashdump-x86_64.c
-KEXEC_C_SRCS+= kexec/arch/x86_64/kexec-x86_64.c
-KEXEC_C_SRCS+= kexec/arch/x86_64/kexec-elf-x86_64.c
-KEXEC_C_SRCS+= kexec/arch/x86_64/kexec-elf-rel-x86_64.c
+KEXEC_SRCS += kexec/arch/i386/kexec-elf-x86.c
+KEXEC_SRCS += kexec/arch/i386/kexec-bzImage.c
+KEXEC_SRCS += kexec/arch/i386/kexec-multiboot-x86.c
+KEXEC_SRCS += kexec/arch/i386/kexec-beoboot-x86.c
+KEXEC_SRCS += kexec/arch/i386/kexec-nbi.c
+KEXEC_SRCS += kexec/arch/i386/x86-linux-setup.c
+KEXEC_SRCS += kexec/arch/x86_64/crashdump-x86_64.c
+KEXEC_SRCS += kexec/arch/x86_64/kexec-x86_64.c
+KEXEC_SRCS += kexec/arch/x86_64/kexec-elf-x86_64.c
+KEXEC_SRCS += kexec/arch/x86_64/kexec-elf-rel-x86_64.c
diff --git a/kexec_test/Makefile b/kexec_test/Makefile
index 000f832..4a7d94c 100644
--- a/kexec_test/Makefile
+++ b/kexec_test/Makefile
@@ -2,13 +2,12 @@
# kexec_test Debugging payload to be certain the infrastructure works
#
RELOC:=0x10000
-KEXEC_TEST_S_SRCS:= kexec_test/kexec_test16.S kexec_test/kexec_test.S
-KEXEC_TEST_S_OBJS:=$(patsubst %.S, %.o, $(KEXEC_TEST_S_SRCS))
-KEXEC_TEST_S_DEPS:=$(patsubst %.S, %.d, $(KEXEC_TEST_S_SRCS))
-KEXEC_TEST_SRCS:= $(KEXEC_TEST_S_SRCS)
-KEXEC_TEST_OBJS:= $(KEXEC_TEST_S_OBJS)
-KEXEC_TEST_DEPS:= $(KEXEC_TEST_S_DEPS)
-KEXEC_TEST:=$(PKGLIBDIR)/kexec_test
+KEXEC_TEST_SRCS:= kexec_test/kexec_test16.S kexec_test/kexec_test.S
+
+KEXEC_TEST_OBJS = $(call objify, $(KEXEC_TEST_SRCS))
+KEXEC_TEST_DEPS = $(call depify, $(KEXEC_TEST_OBJS))
+
+KEXEC_TEST = $(PKGLIBDIR)/kexec_test
-include $(KEXEC_TEST_DEPS)
diff --git a/purgatory/Makefile b/purgatory/Makefile
index 35fd473..852ead9 100644
--- a/purgatory/Makefile
+++ b/purgatory/Makefile
@@ -7,22 +7,16 @@
# should keep us from accidentially include unsafe library functions
# or headers.
-PURGATORY_C_SRCS:=
-PURGATORY_C_SRCS += purgatory/purgatory.c
-PURGATORY_C_SRCS += purgatory/printf.c
-PURGATORY_C_SRCS += purgatory/string.c
-PURGATORY_S_OBJS:=
-PURGATORY:= purgatory/purgatory.ro
+PURGATORY = purgatory/purgatory.ro
+PURGATORY_SRCS =
+PURGATORY_SRCS += purgatory/purgatory.c
+PURGATORY_SRCS += purgatory/printf.c
+PURGATORY_SRCS += purgatory/string.c
include $(srcdir)/purgatory/arch/$(ARCH)/Makefile
-PURGATORY_C_OBJS:= $(patsubst %.c, %.o, $(PURGATORY_C_SRCS))
-PURGATORY_C_DEPS:= $(patsubst %.c, %.d, $(PURGATORY_C_SRCS))
-PURGATORY_S_OBJS:= $(patsubst %.S, %.o, $(PURGATORY_S_SRCS))
-PURGATORY_S_DEPS:= $(patsubst %.S, %.d, $(PURGATORY_S_SRCS))
-PURGATORY_SRCS:= $(PURGATORY_S_SRCS) $(PURGATORY_C_SRCS)
-PURGATORY_OBJS:= $(PURGATORY_S_OBJS) $(PURGATORY_C_OBJS) purgatory/sha256.o
-PURGATORY_DEPS:= $(PURGATORY_S_DEPS) $(PURGATORY_C_DEPS)
+PURGATORY_OBJS = $(call objify, $(PURGATORY_SRCS)) purgatory/sha256.o
+PURGATORY_DEPS = $(call depify, $(PURGATORY_OBJS))
-include $(PURGATORY_DEPS)
@@ -51,12 +45,6 @@ $(PURGATORY): $(PURGATORY_OBJS)
# $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) --no-undefined -e purgatory_start -r -o $@ $(PURGATORY_OBJS) $(UTIL_LIB)
echo::
- @echo "PURGATORY_C_SRCS $(PURGATORY_C_SRCS)"
- @echo "PURGATORY_C_DEPS $(PURGATORY_C_DEPS)"
- @echo "PURGATORY_C_OBJS $(PURGATORY_C_OBJS)"
- @echo "PURGATORY_S_SRCS $(PURGATORY_S_SRCS)"
- @echo "PURGATORY_S_DEPS $(PURGATORY_S_DEPS)"
- @echo "PURGATORY_S_OBJS $(PURGATORY_S_OBJS)"
- @echo "PURGATORY_SRCS $(PURGATORY_SRCS)"
- @echo "PURGATORY_DEPS $(PURGATORY_DEPS)"
- @echo "PURGATORY_OBJS $(PURGATORY_OBJS)"
+ @echo "PURGATORY_SRCS $(PURGATORY_SRCS)"
+ @echo "PURGATORY_DEPS $(PURGATORY_DEPS)"
+ @echo "PURGATORY_OBJS $(PURGATORY_OBJS)"
diff --git a/purgatory/arch/alpha/Makefile b/purgatory/arch/alpha/Makefile
index a626bbd..02f62b2 100644
--- a/purgatory/arch/alpha/Makefile
+++ b/purgatory/arch/alpha/Makefile
@@ -2,6 +2,5 @@
# Purgatory alpha
#
-PURGATORY_C_SRCS+=
-PURGATORY_S_SRCS+=
+PURGATORY_SRCS +=
diff --git a/purgatory/arch/i386/Makefile b/purgatory/arch/i386/Makefile
index 97478f4..55cc7af 100644
--- a/purgatory/arch/i386/Makefile
+++ b/purgatory/arch/i386/Makefile
@@ -2,14 +2,14 @@
# Purgatory i386
#
-PURGATORY_S_SRCS+= purgatory/arch/i386/entry32-16.S
-PURGATORY_S_SRCS+= purgatory/arch/i386/entry32-16-debug.S
-PURGATORY_S_SRCS+= purgatory/arch/i386/entry32.S
-PURGATORY_S_SRCS+= purgatory/arch/i386/setup-x86.S
-PURGATORY_S_SRCS+= purgatory/arch/i386/stack.S
-PURGATORY_S_SRCS+= purgatory/arch/i386/compat_x86_64.S
-PURGATORY_C_SRCS+= purgatory/arch/i386/purgatory-x86.c
-PURGATORY_C_SRCS+= purgatory/arch/i386/console-x86.c
-PURGATORY_C_SRCS+= purgatory/arch/i386/vga.c
-PURGATORY_C_SRCS+= purgatory/arch/i386/pic.c
-PURGATORY_C_SRCS+= purgatory/arch/i386/crashdump_backup.c
+PURGATORY_SRCS += purgatory/arch/i386/entry32-16.S
+PURGATORY_SRCS += purgatory/arch/i386/entry32-16-debug.S
+PURGATORY_SRCS += purgatory/arch/i386/entry32.S
+PURGATORY_SRCS += purgatory/arch/i386/setup-x86.S
+PURGATORY_SRCS += purgatory/arch/i386/stack.S
+PURGATORY_SRCS += purgatory/arch/i386/compat_x86_64.S
+PURGATORY_SRCS += purgatory/arch/i386/purgatory-x86.c
+PURGATORY_SRCS += purgatory/arch/i386/console-x86.c
+PURGATORY_SRCS += purgatory/arch/i386/vga.c
+PURGATORY_SRCS += purgatory/arch/i386/pic.c
+PURGATORY_SRCS += purgatory/arch/i386/crashdump_backup.c
diff --git a/purgatory/arch/ia64/Makefile b/purgatory/arch/ia64/Makefile
index 12d9f75..9dda91d 100644
--- a/purgatory/arch/ia64/Makefile
+++ b/purgatory/arch/ia64/Makefile
@@ -1,10 +1,10 @@
#
# Purgatory ia64
#
-PURGATORY_S_SRCS+= purgatory/arch/ia64/entry.S
-PURGATORY_C_SRCS+= purgatory/arch/ia64/purgatory-ia64.c
-PURGATORY_C_SRCS+= purgatory/arch/ia64/console-ia64.c
-PURGATORY_C_SRCS+= purgatory/arch/ia64/vga.c
+PURGATORY_SRCS += purgatory/arch/ia64/entry.S
+PURGATORY_SRCS += purgatory/arch/ia64/purgatory-ia64.c
+PURGATORY_SRCS += purgatory/arch/ia64/console-ia64.c
+PURGATORY_SRCS += purgatory/arch/ia64/vga.c
$(PURGATORY): CFLAGS += -ffixed-r28
diff --git a/purgatory/arch/ppc/Makefile b/purgatory/arch/ppc/Makefile
index 4ce40fe..c40b4b5 100644
--- a/purgatory/arch/ppc/Makefile
+++ b/purgatory/arch/ppc/Makefile
@@ -2,7 +2,7 @@
# Purgatory ppc
#
-PURGATORY_S_SRCS+= purgatory/arch/ppc/misc.S
-PURGATORY_C_SRCS+= purgatory/arch/ppc/purgatory-ppc.c
-PURGATORY_C_SRCS+= purgatory/arch/ppc/console-ppc.c
+PURGATORY_SRCS += purgatory/arch/ppc/misc.S
+PURGATORY_SRCS += purgatory/arch/ppc/purgatory-ppc.c
+PURGATORY_SRCS += purgatory/arch/ppc/console-ppc.c
diff --git a/purgatory/arch/ppc64/Makefile b/purgatory/arch/ppc64/Makefile
index 792a0b3..a62484e 100644
--- a/purgatory/arch/ppc64/Makefile
+++ b/purgatory/arch/ppc64/Makefile
@@ -2,10 +2,10 @@
# Purgatory ppc
#
-PURGATORY_S_SRCS += purgatory/arch/ppc64/v2wrap.S
-PURGATORY_C_SRCS += purgatory/arch/ppc64/purgatory-ppc64.c
-PURGATORY_C_SRCS += purgatory/arch/ppc64/console-ppc64.c
-PURGATORY_C_SRCS += purgatory/arch/ppc64/crashdump_backup.c
+PURGATORY_SRCS += purgatory/arch/ppc64/v2wrap.S
+PURGATORY_SRCS += purgatory/arch/ppc64/purgatory-ppc64.c
+PURGATORY_SRCS += purgatory/arch/ppc64/console-ppc64.c
+PURGATORY_SRCS += purgatory/arch/ppc64/crashdump_backup.c
$(PURGATORY): CFLAGS += -m64 -mcall-aixdesc
$(PURGATORY): ASFLAGS += -m64 -mcall-aixdesc
diff --git a/purgatory/arch/s390/Makefile b/purgatory/arch/s390/Makefile
index 63dac9d..9c795d1 100644
--- a/purgatory/arch/s390/Makefile
+++ b/purgatory/arch/s390/Makefile
@@ -2,6 +2,6 @@
# Purgatory s390
#
-PURGATORY_C_SRCS+=
-PURGATORY_S_SRCS+=
+PURGATORY_SRCS +=
+PURGATORY_SRCS +=
diff --git a/purgatory/arch/sh/Makefile b/purgatory/arch/sh/Makefile
index a626bbd..537d260 100644
--- a/purgatory/arch/sh/Makefile
+++ b/purgatory/arch/sh/Makefile
@@ -2,6 +2,6 @@
# Purgatory alpha
#
-PURGATORY_C_SRCS+=
-PURGATORY_S_SRCS+=
+PURGATORY_SRCS +=
+PURGATORY_SRCS +=
diff --git a/purgatory/arch/x86_64/Makefile b/purgatory/arch/x86_64/Makefile
index 29f4340..e8fe96c 100644
--- a/purgatory/arch/x86_64/Makefile
+++ b/purgatory/arch/x86_64/Makefile
@@ -2,15 +2,14 @@
# Purgatory x86_64
#
-PURGATORY_S_SRCS+= purgatory/arch/i386/entry32-16.S
-PURGATORY_S_SRCS+= purgatory/arch/i386/entry32-16-debug.S
-PURGATORY_S_SRCS+= purgatory/arch/x86_64/entry64-32.S
-PURGATORY_S_SRCS+= purgatory/arch/x86_64/entry64.S
-PURGATORY_S_SRCS+= purgatory/arch/x86_64/setup-x86_64.S
-PURGATORY_S_SRCS+= purgatory/arch/x86_64/stack.S
-PURGATORY_C_SRCS+= purgatory/arch/x86_64/purgatory-x86_64.c
-PURGATORY_C_SRCS+= purgatory/arch/i386/crashdump_backup.c
-PURGATORY_C_SRCS+= purgatory/arch/i386/console-x86.c
-PURGATORY_C_SRCS+= purgatory/arch/i386/vga.c
-PURGATORY_C_SRCS+= purgatory/arch/i386/pic.c
-
+PURGATORY_SRCS += purgatory/arch/i386/entry32-16.S
+PURGATORY_SRCS += purgatory/arch/i386/entry32-16-debug.S
+PURGATORY_SRCS += purgatory/arch/x86_64/entry64-32.S
+PURGATORY_SRCS += purgatory/arch/x86_64/entry64.S
+PURGATORY_SRCS += purgatory/arch/x86_64/setup-x86_64.S
+PURGATORY_SRCS += purgatory/arch/x86_64/stack.S
+PURGATORY_SRCS += purgatory/arch/x86_64/purgatory-x86_64.c
+PURGATORY_SRCS += purgatory/arch/i386/crashdump_backup.c
+PURGATORY_SRCS += purgatory/arch/i386/console-x86.c
+PURGATORY_SRCS += purgatory/arch/i386/vga.c
+PURGATORY_SRCS += purgatory/arch/i386/pic.c
diff --git a/util_lib/Makefile b/util_lib/Makefile
index f7a7d82..35ee9e7 100644
--- a/util_lib/Makefile
+++ b/util_lib/Makefile
@@ -1,11 +1,12 @@
#
# Utility function library
#
-UTIL_LIB_SRCS:=util_lib/compute_ip_checksum.c
-UTIL_LIB_SRCS+=util_lib/sha256.c
-UTIL_LIB_OBJS:=$(patsubst %.c, %.o, $(UTIL_LIB_SRCS))
-UTIL_LIB_DEPS:=$(patsubst %.c, %.d, $(UTIL_LIB_SRCS))
-UTIL_LIB:=libutil.a
+UTIL_LIB_SRCS +=
+UTIL_LIB_SRCS += util_lib/compute_ip_checksum.c
+UTIL_LIB_SRCS += util_lib/sha256.c
+UTIL_LIB_OBJS =$(call objify, $(UTIL_LIB_SRCS))
+UTIL_LIB_DEPS =$(call depify, $(UTIL_LIB_OBJS))
+UTIL_LIB = libutil.a
-include $(UTIL_LIB_DEPS)