summaryrefslogtreecommitdiff
path: root/viengoos
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@gnu.org>2009-01-19 23:26:45 +0100
committerNeal H. Walfield <neal@gnu.org>2009-01-19 23:27:50 +0100
commit9285419fa94844df0845fe56976ec2bdfbaa9d7a (patch)
tree5081bc93c10932c72fdad0c1baeffdcae5e0a438 /viengoos
parent6259d81615ce8ce366e60077651f7cd6ecbc30b3 (diff)
Use sysdeps-style building.
Diffstat (limited to 'viengoos')
-rw-r--r--viengoos/Makefile.am50
-rw-r--r--viengoos/sysdeps/generic/Makefile.am6
-rw-r--r--viengoos/sysdeps/ia32/Makefile.am6
-rw-r--r--viengoos/sysdeps/ia32/arch-shutdown.c (renamed from viengoos/sysdeps/ia32/ia32-shutdown.c)0
-rw-r--r--viengoos/sysdeps/x86_64/Makefile.am16
-rw-r--r--viengoos/sysdeps/x86_64/arch-shutdown.c (renamed from viengoos/sysdeps/x86_64/shutdown.c)0
6 files changed, 39 insertions, 39 deletions
diff --git a/viengoos/Makefile.am b/viengoos/Makefile.am
index a9237aa..4908408 100644
--- a/viengoos/Makefile.am
+++ b/viengoos/Makefile.am
@@ -1,5 +1,5 @@
# Makefile.am - Makefile template for viengoos.
-# Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
# Written by Marcus Brinkmann.
#
# This file is part of the GNU Hurd.
@@ -19,28 +19,39 @@
if ARCH_IA32
arch=ia32
+ arch_src := ia32-output.c ia32-crt0.S ia32-cmain.c
endif
if ARCH_X86_64
arch=x86_64
+ arch_src := x86_64-output.c boot.S boot32.c boot64.c \
+ gdt.c tss.c idt.c pic.c timer.c
endif
+
+# The source files are scattered over several directories. Add
+# all these directories to the vpath.
+SYSDEP_PATH = $(srcdir)/sysdeps/${arch} \
+ $(srcdir)/sysdeps/generic \
+ $(srcdir)
+VPATH = $(patsubst :foo,,$(foreach dir,$(SYSDEP_PATH) foo,$(dir):))
+
bootdir = $(prefix)/boot
if ! ENABLE_TESTS
boot_PROGRAMS = viengoos
-SUBDIRS = sysdeps
all-local: viengoos.stripped
viengoos.stripped: viengoos
strip -o $@ $<
-endif
-# We need the libc headers for errno.h -I$(LIBC)/include
-viengoos_CPPFLAGS = $(KERNEL_CPPFLAGS)
-viengoos_CFLAGS = $(KERNEL_CFLAGS)
+# If we use viengoos_CPPFLAGS, then automake generates special rules
+# that hardcode the source essentially ignoring the VPATH. That's
+# annoying. This doesn't happen if we use AM_CPPFLAGS.
+AM_CPPFLAGS = $(addprefix -I, $(SYSDEP_PATH)) $(KERNEL_CPPFLAGS)
+AM_CFLAGS = $(KERNEL_CFLAGS)
viengoos_SOURCES = \
output.h output.c output-none.c \
debug.h debug.c \
- shutdown.h shutdown.c \
+ shutdown.h shutdown.c arch-shutdown.c \
panic.c \
sigma0.h sigma0.c \
zalloc.h zalloc.c \
@@ -56,11 +67,14 @@ viengoos_SOURCES = \
bits.h \
server.h server.c \
pager.h pager.c \
- list.h
+ list.h \
+ \
+ output-vga.c output-serial.c \
+ multiboot.h \
+ \
+ ${arch_src}
viengoos_LDADD = \
- sysdeps/${arch}/libkernel-arch.a \
- sysdeps/generic/libkernel-generic.a \
../libhurd-btree/libhurd-btree.a \
../libhurd-ihash/libhurd-ihash-kernel.a \
../libhurd-mm/libas-kernel.a \
@@ -69,7 +83,21 @@ viengoos_LDADD = \
../newlib/libc-routines.a \
-lgcc
viengoos_LDFLAGS = -N -nostdlib -T $(srcdir)/sysdeps/${arch}/kernel.lds
+endif
+if ARCH_X86_64
+# This is highly discouraged, but the usual hack-around does not work as we
+# have not only an additional flag but also must convert the object.
+# This conversion basically means that we pretend the object contains 64 bit
+# code to link it with the rest of the kernel and that we rename all
+# sections to begin with .low. so that they are linked at a low address.
+boot32.o: boot32.c
+ $(filter-out -mcmodel=kernel,$(COMPILE)) -fno-stack-protector -std=gnu99 -m32 -c -o $@ $<
+ $(OBJCOPY) -O elf64-x86-64 --prefix-sections .low $@ $@
+endif
+
+
+if ENABLE_TESTS
TESTS = t-as t-activity t-link t-guard
check_PROGRAMS = $(TESTS)
@@ -119,4 +147,4 @@ t_guard_CPPFLAGS = $(CHECK_CPPFLAGS)
t_guard_CFLAGS = $(CHECK_CFLAGS)
t_guard_SOURCES = t-guard.c \
output.h output.c output-stdio.c panic.c shutdown.h shutdown.c
-
+endif \ No newline at end of file
diff --git a/viengoos/sysdeps/generic/Makefile.am b/viengoos/sysdeps/generic/Makefile.am
deleted file mode 100644
index 124e1f7..0000000
--- a/viengoos/sysdeps/generic/Makefile.am
+++ /dev/null
@@ -1,6 +0,0 @@
-noinst_LIBRARIES = libkernel-generic.a
-
-libkernel_generic_a_CPPFLAGS = $(KERNEL_CPPFLAGS) \
- -I$(srcdir) -I$(top_srcdir)/viengoos
-libkernel_generic_a_CFLAGS = $(KERNEL_CFLAGS)
-libkernel_generic_a_SOURCES = output-vga.c output-serial.c multiboot.h
diff --git a/viengoos/sysdeps/ia32/Makefile.am b/viengoos/sysdeps/ia32/Makefile.am
deleted file mode 100644
index 3940b30..0000000
--- a/viengoos/sysdeps/ia32/Makefile.am
+++ /dev/null
@@ -1,6 +0,0 @@
-noinst_LIBRARIES = libkernel-arch.a
-
-libkernel_arch_a_CPPFLAGS = $(KERNEL_CPPFLAGS) \
- -I$(srcdir) -I$(top_srcdir)/viengoos
-libkernel_arch_a_CFLAGS = $(KERNEL_CFLAGS)
-libkernel_arch_a_SOURCES = ia32-output.c ia32-crt0.S ia32-cmain.c
diff --git a/viengoos/sysdeps/ia32/ia32-shutdown.c b/viengoos/sysdeps/ia32/arch-shutdown.c
index b94ee51..b94ee51 100644
--- a/viengoos/sysdeps/ia32/ia32-shutdown.c
+++ b/viengoos/sysdeps/ia32/arch-shutdown.c
diff --git a/viengoos/sysdeps/x86_64/Makefile.am b/viengoos/sysdeps/x86_64/Makefile.am
deleted file mode 100644
index 14809f8..0000000
--- a/viengoos/sysdeps/x86_64/Makefile.am
+++ /dev/null
@@ -1,16 +0,0 @@
-noinst_LIBRARIES = libkernel-arch.a
-
-libkernel_arch_a_CPPFLAGS = $(KERNEL_CPPFLAGS) \
- -I$(srcdir) -I$(top_srcdir)/viengoos
-libkernel_arch_a_CFLAGS = $(KERNEL_CFLAGS)
-libkernel_arch_a_SOURCES = x86_64-output.c boot.S boot32.c boot64.c \
- shutdown.c gdt.c tss.c idt.c pic.c timer.c
-
-# This is highly discouraged, but the usual hack-around does not work as we
-# have not only an additional flag but also must convert the object.
-# This conversion basically means that we pretend the object contains 64 bit
-# code to link it with the rest of the kernel and that we rename all
-# sections to begin with .low. so that they are linked at a low address.
-libkernel_arch_a-boot32.o: boot32.c
- $(COMPILE) -std=gnu99 -m32 -c -o $@ $<
- $(OBJCOPY) -O elf64-x86-64 --prefix-sections .low $@ $@
diff --git a/viengoos/sysdeps/x86_64/shutdown.c b/viengoos/sysdeps/x86_64/arch-shutdown.c
index 3c096a9..3c096a9 100644
--- a/viengoos/sysdeps/x86_64/shutdown.c
+++ b/viengoos/sysdeps/x86_64/arch-shutdown.c