# Makefile.am - Makefile template for viengoos. # Copyright (C) 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc. # Written by Marcus Brinkmann. # # This file is part of the GNU Hurd. # # The GNU Hurd is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This GNU Hurd is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . 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 crt0.S \ gdt.c tss.c idt.c pic.c timer-arch.c syscall.c thread-arch.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 = $(SYSDEP_PATH) bootdir = $(prefix)/boot if ! ENABLE_TESTS boot_PROGRAMS = viengoos all-local: viengoos.stripped viengoos.stripped: viengoos strip -o $@ $< # 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 arch-shutdown.c \ panic.c \ sigma0.h sigma0.c \ zalloc.h zalloc.c \ viengoos.h viengoos.c \ boot-modules.h boot-modules.c \ memory.h memory.c \ object.h object.c \ cap.h cap.c \ activity.h activity.c \ thread.h thread.c \ messenger.h messenger.c \ ager.h ager.c \ bits.h \ server.h server.c \ pager.h pager.c \ list.h \ scheduler.c \ bottom-half.h bottom-half.c \ timer.c \ \ output-vga.c output-serial.c \ multiboot.h \ vm.h vm.c \ \ ${arch_src} viengoos_LDADD = \ ../libhurd-btree/libhurd-btree-kernel.a \ ../libhurd-ihash/libhurd-ihash-kernel.a \ ../libhurd-slab/libhurd-slab-kernel.a \ ../libhurd-mm/libas-kernel.a \ ../libc-parts/libc-kernel.a \ ../libhurd-mm/libas-kernel.a \ ../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) CHECK_CPPFLAGS += \ -DRM_INTERN \ -include $(srcdir)/t-environment.h CHECK_LDADD = \ ../libhurd-btree/libhurd-btree.a \ ../libhurd-ihash/libhurd-ihash-nomalloc.a t_as_CPPFLAGS = $(CHECK_CPPFLAGS) t_as_CFLAGS = $(CHECK_CFLAGS) t_as_SOURCES = t-as.c \ zalloc.h zalloc.c \ memory.h memory.c \ cap.h cap.c \ object.h object.c \ activity.h activity.c \ thread.h thread.c \ output.h output.c output-stdio.c \ shutdown.h shutdown.c \ panic.c \ debug.h debug.c t_as_LDADD = ../libhurd-mm/libas-check.a $(CHECK_LDADD) t_activity_CPPFLAGS = $(CHECK_CPPFLAGS) t_activity_CFLAGS = $(CHECK_CFLAGS) t_activity_SOURCES = t-activity.c \ zalloc.h zalloc.c \ memory.h memory.c \ cap.h cap.c \ object.h object.c \ activity.h activity.c \ thread.h thread.c \ output.h output.c output-stdio.c \ shutdown.h shutdown.c \ panic.c \ debug.h debug.c t_activity_LDADD = ../libhurd-mm/libas-check.a $(CHECK_LDADD) t_link_CPPFLAGS = $(CHECK_CPPFLAGS) t_link_CFLAGS = $(CHECK_CFLAGS) t_link_SOURCES = t-link.c list.h \ output.h output.c output-stdio.c panic.c shutdown.h shutdown.c 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