summaryrefslogtreecommitdiff
path: root/purgatory
diff options
context:
space:
mode:
Diffstat (limited to 'purgatory')
-rw-r--r--purgatory/Makefile24
-rw-r--r--purgatory/arch/alpha/Makefile4
-rw-r--r--purgatory/arch/arm/Makefile5
-rw-r--r--purgatory/arch/i386/Makefile28
-rw-r--r--purgatory/arch/ia64/Makefile13
-rw-r--r--purgatory/arch/ppc/Makefile9
-rw-r--r--purgatory/arch/ppc64/Makefile19
-rw-r--r--purgatory/arch/s390/Makefile5
-rw-r--r--purgatory/arch/sh/Makefile7
-rw-r--r--purgatory/arch/x86_64/Makefile29
10 files changed, 94 insertions, 49 deletions
diff --git a/purgatory/Makefile b/purgatory/Makefile
index e7d2f15..9ffa522 100644
--- a/purgatory/Makefile
+++ b/purgatory/Makefile
@@ -13,7 +13,20 @@ PURGATORY_SRCS += purgatory/purgatory.c
PURGATORY_SRCS += purgatory/printf.c
PURGATORY_SRCS += purgatory/string.c
-include $(srcdir)/purgatory/arch/$(ARCH)/Makefile
+dist += purgatory/Makefile $(PURGATORY_SRCS) \
+ purgatory/include/purgatory.h purgatory/include/string.h
+
+include $(srcdir)/purgatory/arch/alpha/Makefile
+include $(srcdir)/purgatory/arch/arm/Makefile
+include $(srcdir)/purgatory/arch/i386/Makefile
+include $(srcdir)/purgatory/arch/ia64/Makefile
+include $(srcdir)/purgatory/arch/ppc/Makefile
+include $(srcdir)/purgatory/arch/ppc64/Makefile
+include $(srcdir)/purgatory/arch/s390/Makefile
+include $(srcdir)/purgatory/arch/sh/Makefile
+include $(srcdir)/purgatory/arch/x86_64/Makefile
+
+PURGATORY_SRCS+=$($(ARCH)_PURGATORY_SRCS)
PURGATORY_OBJS = $(call objify, $(PURGATORY_SRCS)) purgatory/sha256.o
PURGATORY_DEPS = $(call depify, $(PURGATORY_OBJS))
@@ -31,13 +44,16 @@ purgatory/sha256.o: $(srcdir)/util_lib/sha256.c
$(COMPILE.c) -o $@ $^
$(PURGATORY): CC=$(TARGET_CC)
-$(PURGATORY): CFLAGS+=-Os -fno-builtin -ffreestanding \
+$(PURGATORY): CFLAGS+=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
+ -Os -fno-builtin -ffreestanding \
-fno-zero-initialized-in-bss
-$(PURGATORY): CPPFLAGS+=-I$(srcdir)/purgatory/include \
+$(PURGATORY): CPPFLAGS+=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
+ -I$(srcdir)/purgatory/include \
-I$(srcdir)/purgatory/arch/$(ARCH)/include \
-I$(shell $(CC) -print-file-name=include)
-$(PURGATORY): LDFLAGS+=--no-undefined -nostartfiles -nostdlib -nodefaultlibs \
+$(PURGATORY): LDFLAGS+=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\
+ --no-undefined -nostartfiles -nostdlib -nodefaultlibs \
-e purgatory_start -r
$(PURGATORY): $(PURGATORY_OBJS)
diff --git a/purgatory/arch/alpha/Makefile b/purgatory/arch/alpha/Makefile
index 02f62b2..c58693f 100644
--- a/purgatory/arch/alpha/Makefile
+++ b/purgatory/arch/alpha/Makefile
@@ -2,5 +2,7 @@
# Purgatory alpha
#
-PURGATORY_SRCS +=
+alpha_PURGATORY_SRCS =
+
+dist += purgatory/arch/alpha/Makefile $(alpha_PURGATORY_SRCS)
diff --git a/purgatory/arch/arm/Makefile b/purgatory/arch/arm/Makefile
index 566ff42..690377e 100644
--- a/purgatory/arch/arm/Makefile
+++ b/purgatory/arch/arm/Makefile
@@ -2,5 +2,8 @@
# Purgatory arm
#
-PURGATORY_SRCS +=
+arm_PURGATORY_SRCS =
+
+dist += purgatory/arch/arm/Makefile $(arm_PURGATORY_SRCS)
+
diff --git a/purgatory/arch/i386/Makefile b/purgatory/arch/i386/Makefile
index 55cc7af..1532219 100644
--- a/purgatory/arch/i386/Makefile
+++ b/purgatory/arch/i386/Makefile
@@ -2,14 +2,20 @@
# Purgatory i386
#
-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
+i386_PURGATORY_SRCS = purgatory/arch/i386/entry32-16.S
+i386_PURGATORY_SRCS += purgatory/arch/i386/entry32-16-debug.S
+i386_PURGATORY_SRCS += purgatory/arch/i386/entry32.S
+i386_PURGATORY_SRCS += purgatory/arch/i386/setup-x86.S
+i386_PURGATORY_SRCS += purgatory/arch/i386/stack.S
+i386_PURGATORY_SRCS += purgatory/arch/i386/compat_x86_64.S
+i386_PURGATORY_SRCS += purgatory/arch/i386/purgatory-x86.c
+i386_PURGATORY_SRCS += purgatory/arch/i386/console-x86.c
+i386_PURGATORY_SRCS += purgatory/arch/i386/vga.c
+i386_PURGATORY_SRCS += purgatory/arch/i386/pic.c
+i386_PURGATORY_SRCS += purgatory/arch/i386/crashdump_backup.c
+
+dist += purgatory/arch/i386/Makefile $(i386_PURGATORY_SRCS) \
+ purgatory/arch/i386/purgatory-x86.h \
+ purgatory/arch/i386/include/arch/io.h \
+ purgatory/arch/i386/include/arch/debug.h
+
diff --git a/purgatory/arch/ia64/Makefile b/purgatory/arch/ia64/Makefile
index 9dda91d..32c3d97 100644
--- a/purgatory/arch/ia64/Makefile
+++ b/purgatory/arch/ia64/Makefile
@@ -1,10 +1,13 @@
#
# Purgatory ia64
#
-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
+ia64_PURGATORY_SRCS += purgatory/arch/ia64/entry.S
+ia64_PURGATORY_SRCS += purgatory/arch/ia64/purgatory-ia64.c
+ia64_PURGATORY_SRCS += purgatory/arch/ia64/console-ia64.c
+ia64_PURGATORY_SRCS += purgatory/arch/ia64/vga.c
-$(PURGATORY): CFLAGS += -ffixed-r28
+ia64_PURGATORY_EXTRA_CFLAGS = -ffixed-r28
+
+dist += purgatory/arch/ia64/Makefile $(ia64_PURGATORY_SRCS) \
+ purgatory/arch/ia64/io.h purgatory/arch/ia64/purgatory-ia64.h
diff --git a/purgatory/arch/ppc/Makefile b/purgatory/arch/ppc/Makefile
index c40b4b5..69fd46c 100644
--- a/purgatory/arch/ppc/Makefile
+++ b/purgatory/arch/ppc/Makefile
@@ -2,7 +2,10 @@
# Purgatory ppc
#
-PURGATORY_SRCS += purgatory/arch/ppc/misc.S
-PURGATORY_SRCS += purgatory/arch/ppc/purgatory-ppc.c
-PURGATORY_SRCS += purgatory/arch/ppc/console-ppc.c
+ppc_PURGATORY_SRCS += purgatory/arch/ppc/misc.S
+ppc_PURGATORY_SRCS += purgatory/arch/ppc/purgatory-ppc.c
+ppc_PURGATORY_SRCS += purgatory/arch/ppc/console-ppc.c
+
+dist += purgatory/arch/ppc/Makefile $(ppc_PURGATORY_SRCS) \
+ purgatory/arch/ppc/purgatory-ppc.h purgatory/arch/ppc/ppc_asm.h
diff --git a/purgatory/arch/ppc64/Makefile b/purgatory/arch/ppc64/Makefile
index a62484e..aaa4046 100644
--- a/purgatory/arch/ppc64/Makefile
+++ b/purgatory/arch/ppc64/Makefile
@@ -1,12 +1,15 @@
#
-# Purgatory ppc
+# Purgatory ppc64
#
-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
+ppc64_PURGATORY_SRCS += purgatory/arch/ppc64/v2wrap.S
+ppc64_PURGATORY_SRCS += purgatory/arch/ppc64/purgatory-ppc64.c
+ppc64_PURGATORY_SRCS += purgatory/arch/ppc64/console-ppc64.c
+ppc64_PURGATORY_SRCS += purgatory/arch/ppc64/crashdump_backup.c
-$(PURGATORY): CFLAGS += -m64 -mcall-aixdesc
-$(PURGATORY): ASFLAGS += -m64 -mcall-aixdesc
-$(PURGATORY): LDFLAGS += -melf64ppc
+ppc64_PURGATORY_EXTRA_CFLAGS += -m64 -mcall-aixdesc
+ppc64_PURGATORY_EXTRA_ASFLAGS += -m64 -mcall-aixdesc
+ppc64_PURGATORY_EXTRA_LDFLAGS += -melf64ppc
+
+dist += purgatory/arch/ppc64/Makefile $(ppc64_PURGATORY_SRCS) \
+ purgatory/arch/ppc64/purgatory-ppc64.h
diff --git a/purgatory/arch/s390/Makefile b/purgatory/arch/s390/Makefile
index 9c795d1..d5f3068 100644
--- a/purgatory/arch/s390/Makefile
+++ b/purgatory/arch/s390/Makefile
@@ -2,6 +2,7 @@
# Purgatory s390
#
-PURGATORY_SRCS +=
-PURGATORY_SRCS +=
+s390_PURGATORY_SRCS =
+
+dist += purgatory/arch/s390/Makefile $(s390_PURGATORY_SRCS)
diff --git a/purgatory/arch/sh/Makefile b/purgatory/arch/sh/Makefile
index 537d260..33ad4db 100644
--- a/purgatory/arch/sh/Makefile
+++ b/purgatory/arch/sh/Makefile
@@ -1,7 +1,8 @@
#
-# Purgatory alpha
+# Purgatory sh
#
-PURGATORY_SRCS +=
-PURGATORY_SRCS +=
+sh_PURGATORY_SRCS =
+
+dist += purgatory/arch/sh/Makefile $(sh_PURGATORY_SRCS)
diff --git a/purgatory/arch/x86_64/Makefile b/purgatory/arch/x86_64/Makefile
index e8fe96c..01fbbf3 100644
--- a/purgatory/arch/x86_64/Makefile
+++ b/purgatory/arch/x86_64/Makefile
@@ -2,14 +2,21 @@
# Purgatory x86_64
#
-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
+x86_64_PURGATORY_SRCS += purgatory/arch/x86_64/entry64-32.S
+x86_64_PURGATORY_SRCS += purgatory/arch/x86_64/entry64.S
+x86_64_PURGATORY_SRCS += purgatory/arch/x86_64/setup-x86_64.S
+x86_64_PURGATORY_SRCS += purgatory/arch/x86_64/stack.S
+x86_64_PURGATORY_SRCS += purgatory/arch/x86_64/purgatory-x86_64.c
+
+dist += purgatory/arch/x86_64/Makefile $(x86_64_PURGATORY_SRCS) \
+ purgatory/arch/x86_64/include/arch/io.h \
+ purgatory/arch/x86_64/include/arch/debug.h \
+ purgatory/arch/x86_64/purgatory-x86_64.h
+
+# Done add sources in i386/ to dist, as i386/Makefile adds them
+x86_64_PURGATORY_SRCS = purgatory/arch/i386/entry32-16.S
+x86_64_PURGATORY_SRCS += purgatory/arch/i386/entry32-16-debug.S
+x86_64_PURGATORY_SRCS += purgatory/arch/i386/crashdump_backup.c
+x86_64_PURGATORY_SRCS += purgatory/arch/i386/console-x86.c
+x86_64_PURGATORY_SRCS += purgatory/arch/i386/vga.c
+x86_64_PURGATORY_SRCS += purgatory/arch/i386/pic.c