summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@gnu.org>2006-10-15 14:49:03 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-18 00:26:46 +0200
commit0adf9500edf4772052501d9c061d6a0abde5fd8e (patch)
tree9b3563c454875336e6be54886784e58db394b7c1
parent323e17604a4df5eb3548c99aa9603e0a0e0b1e1d (diff)
2006-10-15 Thomas Schwinge <tschwinge@gnu.org>
[task #5956 --- ``Automake'ify GNU Mach's code base''] * Makefile.am: New file. * Makerules.am <configure's findings, System dependent Makerules> <Compilation flags, Dependency generation, Autoconf support>: Remove sections. <Building from foo.cli, Building from foo.srv>: Rewrite: (%.server.defs.c, %.user.defs.c, %.server.h %.server.c) (%.user.h %.user.c, %.server.defs, %.user.defs): New targets. (%.h %_user.c %.cli.d, %_interface.h %_server.c %.srv.d): Remove targets. (echo-%): New target. * Makefrag.am <configure's findings, Rules, Kernel Image, Installation> <Building the distribution, Autoconf support, Makerules>: Remove sections. (enable_kdb, enable_kmsg): Adopt. <All the source in each directory> <Header files installed for user use>: Rewrite to adopt to how things are to be done now. <Automatically generated source files>: New section. (i386/Makefrag.am): Include file if appropriate. * i386/Makefrag.am <configure's findings, Rules, Installation> <Autoconf support, Makerules>: Remove sections. (enable_lpr): Adopt. <Source files for any i386 kernel>: Rewrite to adopt to how things are to be done now. * i386/linux/Makefrag.am: New file. * linux/Makefrag.am: Likewise.
-rw-r--r--ChangeLog27
-rw-r--r--Makefile.am166
-rw-r--r--Makefrag.am663
-rw-r--r--Makerules.am187
-rw-r--r--i386/Makefrag.am303
-rw-r--r--i386/linux/Makefrag.am24
-rw-r--r--linux/Makefrag.am622
7 files changed, 1312 insertions, 680 deletions
diff --git a/ChangeLog b/ChangeLog
index 3d0569f..1a5189c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,33 @@
[task #5956 --- ``Automake'ify GNU Mach's code base'']
+ * Makefile.am: New file.
+ * Makerules.am <configure's findings, System dependent Makerules>
+ <Compilation flags, Dependency generation, Autoconf support>: Remove
+ sections.
+ <Building from foo.cli, Building from foo.srv>: Rewrite:
+ (%.server.defs.c, %.user.defs.c, %.server.h %.server.c)
+ (%.user.h %.user.c, %.server.defs, %.user.defs): New targets.
+ (%.h %_user.c %.cli.d, %_interface.h %_server.c %.srv.d): Remove
+ targets.
+ (echo-%): New target.
+ * Makefrag.am <configure's findings, Rules, Kernel Image, Installation>
+ <Building the distribution, Autoconf support, Makerules>: Remove
+ sections.
+ (enable_kdb, enable_kmsg): Adopt.
+ <All the source in each directory>
+ <Header files installed for user use>: Rewrite to adopt to how things
+ are to be done now.
+ <Automatically generated source files>: New section.
+ (i386/Makefrag.am): Include file if appropriate.
+ * i386/Makefrag.am <configure's findings, Rules, Installation>
+ <Autoconf support, Makerules>: Remove sections.
+ (enable_lpr): Adopt.
+ <Source files for any i386 kernel>: Rewrite to adopt to how things are
+ to be done now.
+ * i386/linux/Makefrag.am: New file.
+ * linux/Makefrag.am: Likewise.
+
* Makefile.in: Move file...
* Makefrag.am: ... here.
* i386/Makefile.in: Move file...
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..a80b161
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,166 @@
+# Makefile for GNU Mach.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# This program 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 2, or (at
+# your option) any later version.
+#
+# This program 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, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+#
+# Various definitions of the Automake environment.
+#
+# These will be augmented below.
+#
+
+SUBDIRS =
+DIST_SUBDIRS =
+EXTRA_DIST =
+noinst_LIBRARIES =
+noinst_PROGRAMS =
+TESTS=
+info_TEXINFOS =
+MOSTLYCLEANFILES =
+AM_CPPFLAGS =
+AM_CCASFLAGS =
+AM_CFLAGS =
+AM_LDFLAGS =
+
+#
+# Compilation flags
+#
+
+AM_CPPFLAGS += \
+ -nostdinc -imacros config.h
+
+AM_CPPFLAGS += \
+ -I$(systype) \
+ -I. \
+ -I$(top_srcdir)/$(systype) \
+ -I$(top_srcdir)/$(systype)/include/mach/sa \
+ -I$(top_srcdir)/include
+
+# Yes, this makes the eyes hurt. But perhaps someone will finally take care of
+# all that scruffy Mach code... Also see <http://savannah.gnu.org/task/?5726>.
+AM_CFLAGS += \
+ -Wall
+
+# See <http://lists.gnu.org/archive/html/bug-hurd/2006-01/msg00148.html>.
+AM_CFLAGS += \
+ -fno-strict-aliasing
+
+# For pre Automake 1.10.
+AM_CCASFLAGS += \
+ $(AM_CPPFLAGS)
+
+#
+# MIG Setup.
+#
+
+# MIGCOM.
+MIGCOM = $(MIG) -cc cat - /dev/null
+
+MIGFLAGS =
+
+# We need this because we use $(CPP) to preprocess MIG .defs files.
+CPP = @CPP@ -x c
+
+#
+# The main kernel functionality.
+#
+
+noinst_LIBRARIES += \
+ libkernel.a
+libkernel_a_SOURCES =
+nodist_libkernel_a_SOURCES =
+MOSTLYCLEANFILES += \
+ $(nodist_libkernel_a_SOURCES)
+
+gnumach_o_LDADD =
+gnumach_o_LDADD += \
+ libkernel.a
+
+# Makerules: how to do some things.
+include Makerules.am
+
+# Main Makefile fragment.
+include Makefrag.am
+
+# Test suite.
+include tests/Makefrag.am
+
+# Documentation.
+include doc/Makefrag.am
+
+# Linux device drivers and the glue code.
+include linux/Makefrag.am
+
+#
+# Kernel Image
+#
+
+# TODO. Is the following kosher from a Automake point of view? (I.e. a
+# program `gnumach.o' that is then later used again as an object file.)
+gnumach_o_SOURCES =
+# TODO. ``--start-group''. Want to keep it that way?
+# TODO. ``-u _start''. System dependent?
+gnumach_o_LINK = $(LD) -u _start -r -o $@ --start-group
+noinst_PROGRAMS += \
+ gnumach.o
+
+# This is the list of routines we decide is OK to steal from the C library.
+clib_routines := memcpy memmove memset bcopy bzero \
+ strchr strstr strsep strpbrk strtok \
+ htonl htons ntohl ntohs \
+ etext edata end # actually ld magic, not libc.
+gnumach-undef: gnumach.$(OBJEXT)
+ $(NM) -u $< | sed 's/ *U *//;s/^_*//' | sort -u > $@
+MOSTLYCLEANFILES += gnumach-undef
+gnumach-undef-bad: gnumach-undef
+ sed '$(foreach r,$(clib_routines),/^$r$$/d;)' $< > $@
+MOSTLYCLEANFILES += gnumach-undef-bad
+clib-routines.o: gnumach-undef gnumach-undef-bad
+ if test -s gnumach-undef-bad; \
+ then cat gnumach-undef-bad; exit 2; else true; fi
+ $(CCLD) -nostdlib -nostartfiles -r -static \
+ -o $@ `sed 's/^/-Wl,-u,/' < $<` -x c /dev/null -lc
+
+gnumach_SOURCES =
+gnumach_LINK = $(LD) $(LINKFLAGS) $(LINKFLAGS_$@) -o $@
+gnumach_LDADD = gnumach.o clib-routines.o
+
+#
+# Installation.
+#
+
+exec_bootdir = \
+ $(exec_prefix)/boot
+exec_boot_PROGRAMS = \
+ gnumach
+
+#
+# Legacy support.
+#
+
+install-headers: install-data
+ @echo '*****************************************************'
+ @echo '* As you can see above, I was so kind to rewrite your'
+ @echo '* `make $@'\'
+ @echo '* into'
+ @echo '* `make $^'\'
+ @echo '* which is how it is to be spelled these days.'
+ @echo '*'
+ @echo '* Please get your instructions fixed.'
+ @echo '*****************************************************'
+ @echo
+ @echo 'Penalty:'
+ sleep 20
diff --git a/Makefrag.am b/Makefrag.am
index 1849f77..017d59c 100644
--- a/Makefrag.am
+++ b/Makefrag.am
@@ -1,6 +1,7 @@
-# Makefile for Mach 4 kernel directory
+# Main Makefile fragment for GNU Mach.
+
# Copyright 1997, 1999, 2004, 2006 Free Software Foundation, Inc.
-#
+
# Permission to use, copy, modify and distribute this software and its
# documentation is hereby granted, provided that both the copyright
# notice and this permission notice appear in all copies of the
@@ -11,385 +12,317 @@
# "AS IS" CONDITION. THE FREE SOFTWARE FOUNDATION DISCLAIMS ANY
# LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
# USE OF THIS SOFTWARE.
-
-#
-# configure's findings.
-#
-
-srcdir = @srcdir@
-version = @PACKAGE_VERSION@
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-bootdir = $(exec_prefix)/boot
-datadir = @datadir@
-includedir = @includedir@
-infodir = @infodir@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-oldincludedir = @oldincludedir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-
-systype = @systype@
-
-top_builddir = ./
-
-DEFS = @DEFS@
-
-#
-# Default target
-#
-
-all:
-
-# Detect if the user wants KDB
-ifeq ($(findstring -DMACH_KDB,$(DEFS)),-DMACH_KDB)
-enable_kdb=yes
-else
-enable_kdb=no
+# Do we want the icky kernel debugger?
+if enable_kdb
+# DDB support --- eventually to die. Please.
+libkernel_a_SOURCES += \
+ ddb/db_access.c \
+ ddb/db_aout.c \
+ ddb/db_break.c \
+ ddb/db_command.c \
+ ddb/db_cond.c \
+ ddb/db_examine.c \
+ ddb/db_expr.c \
+ ddb/db_ext_symtab.c \
+ ddb/db_input.c \
+ ddb/db_lex.c \
+ ddb/db_macro.c \
+ ddb/db_mp.c \
+ ddb/db_output.c \
+ ddb/db_print.c \
+ ddb/db_run.c \
+ ddb/db_sym.c \
+ ddb/db_task_thread.c \
+ ddb/db_trap.c \
+ ddb/db_variables.c \
+ ddb/db_watch.c \
+ ddb/db_write_cmd.c
endif
-# Detect if the user wants KMSG
-ifeq ($(findstring -DMACH_KMSG,$(DEFS)),-DMACH_KMSG)
-enable_kmsg=yes
-else
-enable_kmsg=no
-endif
-
-# All the possible architectures
-all-archs = i386 linux
-
-all-archs-subdirs = $(patsubst %,$(srcdir)/%/Subdirs,$(all-archs))
-all-archs-files = $(patsubst %,$(srcdir)/%/Files,$(all-archs))
-all-archs-configures = $(patsubst %,$(srcdir)/%/configure,$(all-archs))
-
-# Files distributed from the top level directory:
-topfiles = ChangeLog ChangeLog.0 ChangeLog.00 Drivers.macros Makefile.in \
- README INSTALL config.guess config.sub configure configure.in \
- gensym.awk install-sh version.c.in NEWS aclocal.m4 COPYING
-
-# All the source in each directory.
-
-# Old crud from a previous configure scheme
-bogus-files = bootstrap_symbols.h cpus.h fast_tas.h hw_footprint.h \
- power_save.h simple_clock.h stat_time.h xpr_debug.h \
- $(patsubst %,mach_%.h,assert counters debug fixpri host ipc_compat \
- ipc_debug ipc_test kdb ldebug lock_mon machine_routines mp_debug \
- pagemap pcsample ttd vm_debug)
-
-# Generic code for various hardware drivers
-chips-files = busses.c busses.h
-
-# Icky kernel debugger
-ddb-cfiles = $(addprefix db_,$(ddb-names))
-ddb-names = access.c aout.c break.c command.c cond.c examine.c expr.c \
- ext_symtab.c input.c lex.c macro.c mp.c output.c print.c run.c \
- sym.c task_thread.c trap.c variables.c watch.c write_cmd.c
-ddb-files = $(ddb-cfiles) $(patsubst %,db_%.h, \
- access break command expr lex output print run sym task_thread \
- variables watch) nlist.h stab.h tr.h
-
-# Device support interfaces
-device-files = blkio.c chario.c cirbuf.c cons.c dev_lookup.c dev_name.c \
- dev_pager.c device_init.c dk_label.c ds_routines.c net_io.c subrs.c \
- buf.h cirbuf.h conf.h cons.h dev_hdr.h dev_master.h device_port.h \
- device_types_kernel.h ds_routines.h errno.h if_ether.h if_hdr.h \
- io_req.h kmsg.c kmsg.h net_io.h param.h tty.h memory_object_reply.cli \
- dev_forward.defs device_pager.srv device_reply.cli device.srv
-
-# IPC implementation
-ipc-cfiles = $(addprefix ipc_,$(ipc-names)) \
- mach_msg.c mach_port.c mach_rpc.c mach_debug.c
-ipc-names = entry.c hash.c init.c kmsg.c marequest.c mqueue.c \
- notify.c object.c port.c pset.c right.c space.c splay.c \
- table.c target.c thread.c
-ipc-files = $(ipc-cfiles) mach_port.srv port.h mach_msg.h \
- $(patsubst %,ipc_%.h, \
- entry hash init kmsg kmsg_queue machdep marequest mqueue notify \
- object port pset right space splay table target thread types)
-
-# "kernel" implementation (tasks, threads, trivia, etc.)
-kern-cfiles = act.c ast.c bootstrap.c counters.c debug.c eventcount.c \
- exception.c host.c ipc_host.c ipc_kobject.c ipc_mig.c ipc_sched.c \
- ipc_tt.c kalloc.c lock.c lock_mon.c mach_clock.c mach_factor.c \
- machine.c pc_sample.c printf.c priority.c processor.c profile.c \
- queue.c sched_prim.c startup.c strings.c syscall_emulation.c \
- syscall_subr.c syscall_sw.c task.c thread.c thread_swap.c \
- time_stamp.c timer.c xpr.c zalloc.c elf-load.c boot_script.c
-kern-files = $(kern-cfiles) \
- act.h assert.h ast.h compat_xxx_defs.h counters.h cpu_number.h \
- debug.h eventcount.h host.h ipc_host.h ipc_kobject.h ipc_sched.h \
- ipc_tt.h kalloc.h kern_types.h lock.h mach_param.h macro_help.h \
- pc_sample.h processor.h queue.h refcount.h sched.h sched_prim.h \
- shuttle.h strings.h syscall_emulation.h syscall_subr.h syscall_sw.h \
- task.h thread.h thread_swap.h time_out.h time_stamp.h timer.h xpr.h \
- zalloc.h boot_script.h \
- mach.srv mach4.srv mach_debug.srv mach_host.srv
-
-# Still more trivia
-util-cfiles = putchar.c puts.c
-util-files = $(util-cfiles)
-
-# Virtual memory implementation
-vm-cfiles = $(addprefix vm_,$(vm-names)) memory_object.c
-vm-names = debug.c external.c fault.c init.c kern.c map.c \
- object.c pageout.c resident.c user.c
-vm-files = $(vm-cfiles) memory_object_default.cli memory_object_user.cli \
- memory_object.h pmap.h $(patsubst %,vm_%.h, \
- external fault kern map object page pageout user)
-
-# Documentation
-doc-files = Makefile.in fdl.texi gpl.texi mach.texi
-
-# Debian packaging
-debian-files = changelog control copyright README.Debian rules postinst prerm
-
-
-# Object files that go into the kernel image.
-
-# Basic kernel source for Mach
-objfiles := $(subst .c,.o,$(ipc-cfiles) $(kern-cfiles) \
- $(util-cfiles) $(vm-cfiles))
-vpath %.c $(srcdir)/ipc $(srcdir)/kern $(srcdir)/util $(srcdir)/vm
-
-# These device support files are always needed; the others are needed only
-# if particular drivers want the routines.
-# XXX functions in device/subrs.c should each be moved elsewhere
-objfiles += cons.o dev_lookup.o dev_name.o dev_pager.o device_init.o \
- ds_routines.o subrs.o net_io.o blkio.o chario.o
-ifeq ($(enable_kmsg),yes)
-objfiles += kmsg.o
+# IPC implementation.
+libkernel_a_SOURCES += \
+ ipc/ipc_entry.c \
+ ipc/ipc_hash.c \
+ ipc/ipc_init.c \
+ ipc/ipc_kmsg.c \
+ ipc/ipc_marequest.c \
+ ipc/ipc_mqueue.c \
+ ipc/ipc_notify.c \
+ ipc/ipc_object.c \
+ ipc/ipc_port.c \
+ ipc/ipc_pset.c \
+ ipc/ipc_right.c \
+ ipc/ipc_space.c \
+ ipc/ipc_splay.c \
+ ipc/ipc_table.c \
+ ipc/ipc_target.c \
+ ipc/ipc_thread.c \
+ ipc/mach_msg.c \
+ ipc/mach_port.c \
+ ipc/mach_rpc.c \
+ ipc/mach_debug.c
+
+# "kernel" implementation (tasks, threads, trivia, etc.).
+libkernel_a_SOURCES += \
+ kern/act.c \
+ kern/ast.c \
+ kern/bootstrap.c \
+ kern/counters.c \
+ kern/debug.c \
+ kern/eventcount.c \
+ kern/exception.c \
+ kern/host.c \
+ kern/ipc_host.c \
+ kern/ipc_kobject.c \
+ kern/ipc_mig.c \
+ kern/ipc_sched.c \
+ kern/ipc_tt.c \
+ kern/kalloc.c \
+ kern/lock.c \
+ kern/lock_mon.c \
+ kern/mach_clock.c \
+ kern/mach_factor.c \
+ kern/machine.c \
+ kern/pc_sample.c \
+ kern/printf.c \
+ kern/priority.c \
+ kern/processor.c \
+ kern/profile.c \
+ kern/queue.c \
+ kern/sched_prim.c \
+ kern/startup.c \
+ kern/strings.c \
+ kern/syscall_emulation.c \
+ kern/syscall_subr.c \
+ kern/syscall_sw.c \
+ kern/task.c \
+ kern/thread.c \
+ kern/thread_swap.c \
+ kern/time_stamp.c \
+ kern/timer.c \
+ kern/xpr.c \
+ kern/zalloc.c \
+ kern/elf-load.c \
+ kern/boot_script.c
+
+# Still more trivia.
+libkernel_a_SOURCES += \
+ util/putchar.c \
+ util/puts.c
+
+# Virtual memory implementation.
+libkernel_a_SOURCES += \
+ vm/vm_debug.c \
+ vm/vm_external.c \
+ vm/vm_fault.c \
+ vm/vm_init.c \
+ vm/vm_kern.c \
+ vm/vm_map.c \
+ vm/vm_object.c \
+ vm/vm_pageout.c \
+ vm/vm_resident.c \
+ vm/vm_user.c \
+ vm/memory_object.c
+
+# These device support files are always needed; the others are needed only if
+# particular drivers want the routines.
+# TODO. Functions in device/subrs.c should each be moved elsewhere.
+libkernel_a_SOURCES += \
+ device/cons.c \
+ device/dev_lookup.c \
+ device/dev_name.c \
+ device/dev_pager.c \
+ device/device_init.c \
+ device/ds_routines.c \
+ device/subrs.c \
+ device/net_io.c \
+ device/blkio.c \
+ device/chario.c
+
+# kmsg device.
+if enable_kmsg
+libkernel_a_SOURCES += \
+ device/kmsg.c
endif
-vpath %.c $(srcdir)/device
-
-# DDB support -- eventually to die. Please.
-objfiles += $(subst .c,.o,$(ddb-cfiles))
-vpath %.c $(srcdir)/ddb
-
-# Version number
-objfiles += version.o
-
-
-# Header files installed for user use
-device-headers= $(addprefix device/,audio_status.h bpf.h device.defs \
- device_reply.defs device_request.defs device_types.defs \
- device_types.h disk_status.h net_status.h tape_status.h \
- tty_status.h)
-mach-headers= $(addprefix mach/, bootstrap.defs default_pager.defs \
- default_pager_helper.defs default_pager_types.defs \
- exc.defs mach.defs mach4.defs mach_host.defs \
- mach_port.defs mach_types.defs memory_object.defs \
- memory_object_default.defs notify.defs \
- std_types.defs \
- alert.h boolean.h boot.h default_pager_types.h exception.h \
- host_info.h kern_return.h mach_param.h mach_types.h \
- machine.h macro_help.h memory_object.h message.h mig_errors.h \
- msg_type.h multiboot.h notify.h \
- pc_sample.h policy.h port.h processor_info.h \
- profil.h profilparam.h rpc.h std_types.h syscall_sw.h \
- task_info.h task_special_ports.h thread_info.h \
- thread_special_ports.h thread_status.h thread_switch.h \
- time_value.h version.h vm_attributes.h vm_inherit.h \
- vm_param.h vm_prot.h vm_statistics.h inline.h)
-mach-exec-headers= $(addprefix mach/exec/, a.out.h elf.h exec.h)
-mach-debug-headers:= $(addprefix mach_debug/, hash_info.h ipc_info.h \
- mach_debug.defs mach_debug_types.defs mach_debug_types.h \
- pc_info.h vm_info.h zone_info.h)
-
-installed-headers:= $(device-headers) $(mach-headers) $(mach-exec-headers)
-
-# Other headers for the distribution. We don't install these, because the
-# GNU C library has correct versions for users to use.
-other-sys-headers := types.h time.h reboot.h ioctl.h
-other-mach-headers := mig_support.h mach_traps.h error.h
-other-headers := alloca.h
-
-
-# Automatically generated source
-
-# User stubs
-objfiles += memory_object_user_user.o memory_object_default_user.o \
- device_reply_user.o memory_object_reply_user.o
-
-# vm_user.o fits the pattern, but is not actually a MiG-related file.
-users = $(filter-out vm_user.o,$(filter %_user.o,$(objfiles)))
-
-# Server stubs
-objfiles += device_server.o device_pager_server.o mach_port_server.o \
- mach_server.o mach4_server.o mach_debug_server.o mach_host_server.o
-
-servers = $(filter %_server.o,$(objfiles))
-
-# Where to find the relevant Mig source files
-vpath %.cli $(srcdir)/vm $(srcdir)/device
-vpath %.srv $(srcdir)/device $(srcdir)/ipc $(srcdir)/kern
+# Version number.
+libkernel_a_SOURCES += \
+ version.c
#
-# Rules.
+# Installation.
#
-all: kernel
- $(MAKE) -C $(systype) $@
-
-# Better than nothing...
-check: kernel
- $(MBCHK) $<
- $(MAKE) -C $(systype) $@
-
-clean:
- $(MAKE) -C $(systype) $@
- rm -f clib-routines.o kernel.o kernel-undef kernel-undef-bad
- rm -f kernel kernel.gz kernel.stripped kernel.stripped.gz
- rm -f $(objfiles) $(subst .o,.d,$(objfiles))
- rm -f *.symc *.symc.o *_user.c *_server.c *.h *.cli.d *.srv.d
-
-distclean: clean
- $(MAKE) -C $(systype) $@
- rm -f Makefile Makerules version.c doc/Makefile machine mach/machine
- rm -f config.status config.log
-
-mostlyclean: distclean
- $(MAKE) -C $(systype) $@
-
-maintainer-clean: mostlyclean
- $(MAKE) -C $(systype) $@
- rm -f $(srcdir)/configure $(all-archs-configures)
-
-$(systype)/%: FORCE
- $(MAKE) -C $(systype) $(@F)
-FORCE:
-
-
-#
-# Kernel Image
-#
-
-# This is the list of routines we decide is OK to steal from the C library.
-clib-routines := memcpy memmove memset bcopy bzero \
- strchr strstr strsep strpbrk strtok \
- htonl htons ntohl ntohs \
- etext edata end # actually ld magic, not libc
-
-#kernel.a: $(objfiles)
-# @rm -f $@
-# $(AR) cq $@ $^
-
-kernel.o: $(objfiles) $(systype)/sysdep.a # kernel.a
- $(LD) -r -o $@ $^
-kernel-undef: kernel.o
- $(NM) -u $< | sed 's/ *U *//;s/^_*//' | sort -u > $@
-kernel-undef-bad: kernel-undef Makefile
- sed '$(foreach r,$(clib-routines),/^$r$$/d;)' $< > $@
-clib-routines.o: kernel-undef kernel-undef-bad
- if test -s kernel-undef-bad; \
- then cat kernel-undef-bad; exit 2; else true; fi
- $(CC) -nostdlib -nostartfiles -r -static \
- -o $@ \
- `sed 's/^/-Wl,-u,/' $<` -x c /dev/null -lc
-kernel: kernel.o clib-routines.o
- $(LD) $(LDFLAGS) $(LDFLAGS-$@) -o $@ $^
+include_devicedir = $(includedir)/device
+include_device_HEADERS = \
+ include/device/audio_status.h \
+ include/device/bpf.h \
+ include/device/device.defs \
+ include/device/device_reply.defs \
+ include/device/device_request.defs \
+ include/device/device_types.defs \
+ include/device/device_types.h \
+ include/device/disk_status.h \
+ include/device/net_status.h \
+ include/device/tape_status.h \
+ include/device/tty_status.h
+
+include_machdir = $(includedir)/mach
+include_mach_HEADERS = \
+ include/mach/bootstrap.defs \
+ include/mach/default_pager.defs \
+ include/mach/default_pager_helper.defs \
+ include/mach/default_pager_types.defs \
+ include/mach/exc.defs \
+ include/mach/mach.defs \
+ include/mach/mach4.defs \
+ include/mach/mach_host.defs \
+ include/mach/mach_port.defs \
+ include/mach/mach_types.defs \
+ include/mach/memory_object.defs \
+ include/mach/memory_object_default.defs \
+ include/mach/notify.defs \
+ include/mach/std_types.defs \
+ include/mach/alert.h \
+ include/mach/boolean.h \
+ include/mach/boot.h \
+ include/mach/default_pager_types.h \
+ include/mach/exception.h \
+ include/mach/host_info.h \
+ include/mach/kern_return.h \
+ include/mach/mach_param.h \
+ include/mach/mach_types.h \
+ include/mach/machine.h \
+ include/mach/macro_help.h \
+ include/mach/memory_object.h \
+ include/mach/message.h \
+ include/mach/mig_errors.h \
+ include/mach/msg_type.h \
+ include/mach/multiboot.h \
+ include/mach/notify.h \
+ include/mach/pc_sample.h \
+ include/mach/policy.h \
+ include/mach/port.h \
+ include/mach/processor_info.h \
+ include/mach/profil.h \
+ include/mach/profilparam.h \
+ include/mach/rpc.h \
+ include/mach/std_types.h \
+ include/mach/syscall_sw.h \
+ include/mach/task_info.h \
+ include/mach/task_special_ports.h \
+ include/mach/thread_info.h \
+ include/mach/thread_special_ports.h \
+ include/mach/thread_status.h \
+ include/mach/thread_switch.h \
+ include/mach/time_value.h \
+ include/mach/version.h \
+ include/mach/vm_attributes.h \
+ include/mach/vm_inherit.h \
+ include/mach/vm_param.h \
+ include/mach/vm_prot.h \
+ include/mach/vm_statistics.h \
+ include/mach/inline.h
+
+include_mach_execdir = $(includedir)/mach/exec
+include_mach_exec_HEADERS = \
+ include/mach/exec/a.out.h \
+ include/mach/exec/elf.h \
+ include/mach/exec/exec.h
+
+# mach-debug-headers:= $(addprefix mach_debug/, hash_info.h ipc_info.h \
+# mach_debug.defs mach_debug_types.defs mach_debug_types.h \
+# pc_info.h vm_info.h zone_info.h)
-
-#
-# Installation
-#
-
-installed-headers-names = $(addprefix $(includedir)/,$(installed-headers))
-install: install-headers install-kernel
- $(MAKE) -C $(systype) $@
-
-$(installed-headers-names): $(includedir)/%: $(srcdir)/include/%
- $(INSTALL_DATA) $< $@
-
-install-headers: mkheaderdirs $(installed-headers-names)
- ln -sfn $(systype) $(includedir)/mach/machine
- $(MAKE) -C $(systype) $@
-
-install-kernel: kernel mkkerneldirs
- $(INSTALL_PROGRAM) kernel $(bootdir)/gnumach
- $(MAKE) -C $(systype) $@
-
-mkheaderdirs:
- mkdir -p $(includedir) $(includedir)/device $(includedir)/mach/exec
-
-mkkerneldirs:
- mkdir -p $(bootdir)
-
-
-#
-# Building the distribution
-#
-
-dist:
- rm -rf gnumach-$(version)
- mkdir gnumach-$(version)
- # Directories
- mkdir gnumach-$(version)/{bogus,chips,ddb,device,ipc,kern,scsi,util,vm,include}
- mkdir gnumach-$(version)/{doc,debian}
- mkdir gnumach-$(version)/include/{mach,device,mach_debug,sys}
- mkdir gnumach-$(version)/include/mach/exec
- for dir in `cat $(all-archs-subdirs)`; do \
- mkdir -p gnumach-$(version)/$$dir; \
- done
- # Files
- cp $(addprefix $(srcdir)/,$(topfiles)) gnumach-$(version)
- cp $(addprefix $(srcdir)/bogus/,$(bogus-files)) gnumach-$(version)/bogus
- cp $(addprefix $(srcdir)/chips/,$(chips-files)) gnumach-$(version)/chips
- cp $(addprefix $(srcdir)/ddb/,$(ddb-files)) gnumach-$(version)/ddb
- cp $(addprefix $(srcdir)/device/,$(device-files)) gnumach-$(version)/device
- cp $(addprefix $(srcdir)/ipc/,$(ipc-files)) gnumach-$(version)/ipc
- cp $(addprefix $(srcdir)/kern/,$(kern-files)) gnumach-$(version)/kern
- cp $(addprefix $(srcdir)/util/,$(util-files)) gnumach-$(version)/util
- cp $(addprefix $(srcdir)/vm/,$(vm-files)) gnumach-$(version)/vm
- cp $(addprefix $(srcdir)/include/,$(mach-headers)) gnumach-$(version)/include/mach
- cp $(addprefix $(srcdir)/include/,$(device-headers)) gnumach-$(version)/include/device
- cp $(addprefix $(srcdir)/include/,$(mach-debug-headers)) gnumach-$(version)/include/mach_debug
- cp $(addprefix $(srcdir)/include/,$(mach-exec-headers)) gnumach-$(version)/include/mach/exec
- cp $(addprefix $(srcdir)/include/,$(other-headers)) gnumach-$(version)/include
- cp $(addprefix $(srcdir)/include/sys/,$(other-sys-headers)) gnumach-$(version)/include/sys
- cp $(addprefix $(srcdir)/include/mach/,$(other-mach-headers)) gnumach-$(version)/include/mach
- cp $(addprefix $(srcdir)/doc/,$(doc-files)) gnumach-$(version)/doc
- cp $(addprefix $(srcdir)/debian/,$(debian-files)) gnumach-$(version)/debian
- # Files in arch dirs
- for file in `cat $(all-archs-files)`; do \
- cp $(srcdir)/$$file gnumach-$(version)/`dirname $$file`; \
- done
- chmod -R u=rwX,og=rX gnumach-$(version)
- tar cf - gnumach-$(version) | gzip -9vc > gnumach-$(version).tar.gz
- rm -rf gnumach-$(version)
+# Other headers for the distribution. We don't install these, because the
+# GNU C library has correct versions for users to use.
+# other-sys-headers := types.h time.h reboot.h ioctl.h
+# other-mach-headers := mig_support.h mach_traps.h error.h
+# other-headers := alloca.h
+install-data-hook:
+ rm -f '$(DESTDIR)$(include_machdir)'/machine
+ ln -s '$(systype)' '$(DESTDIR)$(include_machdir)'/machine
#
-# Autoconf support
+# Automatically generated source files.
#
-$(srcdir)/configure: $(srcdir)/configure.in
- cd $(srcdir) && autoconf
-$(srcdir)/config.h.in: $(srcdir)/acconfig.h
- cd $(srcdir) && autoheader
-
-Makefile: $(srcdir)/Makefile.in config.status
- ./config.status $@
-config.h: stamp-configh ;
-stamp-configh: $(srcdir)/config.h.in config.status
- ./config.status
- touch $@
-
-config.status: $(srcdir)/configure
- ./config.status --recheck
-
-vpath %.in $(srcdir)
-vpath configure $(srcdir)
+# TODO. Get rid of that stuff and lib_dep_tr_for_defs.a. See the thread at
+# <http://lists.gnu.org/archive/html/automake/2006-10/msg00039.html> about what
+# we really want to do.
+noinst_LIBRARIES += \
+ lib_dep_tr_for_defs.a
+nodist_lib_dep_tr_for_defs_a_SOURCES =
+MOSTLYCLEANFILES += \
+ $(nodist_lib_dep_tr_for_defs_a_SOURCES)
+# Preprocess only.
+lib_dep_tr_for_defs_a_CPPFLAGS = $(AM_CPPFLAGS) \
+ -E
+
+# User stubs.
+nodist_lib_dep_tr_for_defs_a_SOURCES += \
+ vm/memory_object_user.user.defs.c \
+ vm/memory_object_default.user.defs.c
+nodist_libkernel_a_SOURCES += \
+ vm/memory_object_user.user.h \
+ vm/memory_object_user.user.c \
+ vm/memory_object_default.user.h \
+ vm/memory_object_default.user.c
+# vm/memory_object_user.user.defs
+# vm/memory_object_default.user.defs
+nodist_lib_dep_tr_for_defs_a_SOURCES += \
+ device/device_reply.user.defs.c \
+ device/memory_object_reply.user.defs.c
+nodist_libkernel_a_SOURCES += \
+ device/device_reply.user.h \
+ device/device_reply.user.c \
+ device/memory_object_reply.user.h \
+ device/memory_object_reply.user.c
+# device/device_reply.user.defs
+# device/memory_object_reply.user.defs
+
+# Server stubs.
+nodist_lib_dep_tr_for_defs_a_SOURCES += \
+ device/device.server.defs.c \
+ device/device_pager.server.defs.c
+nodist_libkernel_a_SOURCES += \
+ device/device.server.h \
+ device/device.server.c \
+ device/device_pager.server.h \
+ device/device_pager.server.c
+# device/device.server.defs
+# device/device_pager.server.defs
+nodist_lib_dep_tr_for_defs_a_SOURCES += \
+ ipc/mach_port.server.defs.c
+nodist_libkernel_a_SOURCES += \
+ ipc/mach_port.server.h \
+ ipc/mach_port.server.c
+# ipc/mach_port.server.defs
+nodist_lib_dep_tr_for_defs_a_SOURCES += \
+ kern/mach.server.defs.c \
+ kern/mach4.server.defs.c \
+ kern/mach_debug.server.defs.c \
+ kern/mach_host.server.defs.c
+nodist_libkernel_a_SOURCES += \
+ kern/mach.server.h \
+ kern/mach.server.c \
+ kern/mach4.server.h \
+ kern/mach4.server.c \
+ kern/mach_debug.server.h \
+ kern/mach_debug.server.c \
+ kern/mach_host.server.h \
+ kern/mach_host.server.c
+# kern/mach.server.defs
+# kern/mach4.server.defs
+# kern/mach_debug.server.defs
+# kern/mach_host.server.defs
#
-# Makerules
+# Architecture specific parts.
#
-include $(top_builddir)/Makerules
+if HOST_i386
+include i386/Makefrag.am
+endif
diff --git a/Makerules.am b/Makerules.am
index 10f6c75..742df19 100644
--- a/Makerules.am
+++ b/Makerules.am
@@ -1,6 +1,7 @@
-# Makerules
+# Makerules: how to do some things.
+
# Copyright 2006 Free Software Foundation, Inc.
-#
+
# Permission to use, copy, modify and distribute this software and its
# documentation is hereby granted, provided that both the copyright
# notice and this permission notice appear in all copies of the
@@ -11,147 +12,85 @@
# "AS IS" CONDITION. THE FREE SOFTWARE FOUNDATION DISCLAIMS ANY
# LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
# USE OF THIS SOFTWARE.
-
#
-# configure's findings.
+# Building foo.h from foo.sym.
#
-systype = @systype@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-
-AR = @AR@
-AWK = @AWK@
-CC = @CC@
-CPP = @CPP@
-GZIP = @GZIP@
-LD = @LD@
-MBCHK = @MBCHK@
-MIG = @MIG@
-NM = @NM@
-RANLIB = @RANLIB@
-STRIP = @STRIP@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-
-CFLAGS-common = @CFLAGS@
-CPPFLAGS-common = @CPPFLAGS@
-DEFS-common = @DEFS@
-LDFLAGS-common = @LDFLAGS@
-
+%.symc: %.sym $(top_srcdir)/gensym.awk
+ $(AWK) -f $(word 2,$^) $< > $@
+%.symc.o: %.symc
+ $(COMPILE) -S -x c -o $@ $<
+%.h: %.symc.o
+ sed < $< > $@ \
+ -e 's/^[^*].*$$//' \
+ -e 's/^[*]/#define/' \
+ -e 's/mAgIc[^-0-9]*//'
#
-# System dependent Makerules
+# Building RPC stubs.
#
-include $(abs_top_builddir)/$(systype)/Makerules
-
+# These chained rules could be (and used to be) single rules using pipes or
+# could even --- if you dare to --- use the `mig' shell script, but it's
+# convenient to be able to explicitly make the intermediate files when you want
+# to deal with a problem in the MIG stub generator.
+
+# TODO. Get rid of the following four rules and the lib_dep_tr_for_defs.a
+# machinery (see Makefrag.am and i386/Makefrag.am).
+%.server.defs.c: %.srv
+ rm -f $@
+ cp -p $< $@
+%.user.defs.c: %.cli
+ rm -f $@
+ cp -p $< $@
+%.server.h %.server.c: lib_dep_tr_for_defs_a-%.server.defs.$(OBJEXT)
+ $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMSFLAGS) \
+ -sheader $*.server.h -server $*.server.c \
+ -user /dev/null -header /dev/null \
+ < $<
+%.user.h %.user.c: lib_dep_tr_for_defs_a-%.user.defs.$(OBJEXT)
+ $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMUFLAGS) \
+ -user $*.user.c -server /dev/null -header $*.user.h \
+ < $<
+
+# TODO. Get rid of the .srv files and rather use .defs files and MIG*SFLAGS?
+%.server.defs: %.srv
+ $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -o $@ $<
+%.server.defs: %.defs
+ $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) $(MIGSFLAGS) -o $@ $<
+%.server.h %.server.c: %.server.defs
+ $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMSFLAGS) \
+ -sheader $*.server.h -server $*.server.c \
+ -user /dev/null -header /dev/null \
+ < $<
+# TODO. Get rid of the .cli files and rather use .defs files and MIG*UFLAGS?
+%.user.defs: %.cli
+ $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -o $@ $<
+%.user.defs: %.defs
+ $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) $(MIGUFLAGS) -o $@ $<
+%.user.h %.user.c: %.user.defs
+ $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMUFLAGS) \
+ -user $*.user.c -server /dev/null -header $*.user.h \
+ < $<
#
-# Compilation flags
+# gzip files.
#
-DEFS += $(DEFS-common)
-
-INCLUDES += -I$(abs_top_builddir) -I$(abs_top_srcdir) \
- -I$(abs_top_srcdir)/include -I$(abs_top_srcdir)/$(systype) \
- -I$(abs_top_srcdir)/$(systype)/include/mach/sa \
- -I$(abs_top_srcdir)/bogus -I$(abs_top_srcdir)/util \
- -I$(abs_top_srcdir)/kern -I$(abs_top_srcdir)/device
-
-CPPFLAGS += -nostdinc $(DEFINES) $(INCLUDES) $(CPPFLAGS-common)
-
-MIGFLAGS += $(CPPFLAGS)
-
-CFLAGS += $(CFLAGS-common)
-
-# See <URL:http://lists.gnu.org/archive/html/bug-hurd/2006-01/msg00148.html>.
-CFLAGS += -fno-strict-aliasing
-
-LDFLAGS += $(LDFLAGS-common)
+%.gz: %
+ $(GZIP) -9 < $< > $@
#
-# How to do some things
+# strip files.
#
-# Building foo.h from foo.sym:
-%.symc: %.sym $(abs_top_srcdir)/gensym.awk
- $(AWK) -f $(word 2,$^) $< > $@
-%.symc.o: %.symc
- $(CC) -S $(CPPFLAGS) $(CFLAGS) $(CPPFLAGS-$@) -x c -o $@ $<
-%.h: %.symc.o
- sed <$< -e 's/^[^*].*$$//' | \
- sed -e 's/^[*]/#define/' -e 's/mAgIc[^-0-9]*//' >$@
-
-# Building from foo.cli
-.PRECIOUS: %_user.c
-%.h %_user.c %.cli.d: %.cli
- $(MIG) $(MIGFLAGS) -MD \
- -header $*.h -user $*_user.c -server /dev/null $<
- mv $*-mig.d $*.cli.d
-
-# Building from foo.srv
-.PRECIOUS: %_server.c
-%_interface.h %_server.c %.srv.d: %.srv
- $(MIG) $(MIGFLAGS) -MD \
- -sheader $*_interface.h -server $*_server.c \
- -header /dev/null -user /dev/null $<
- mv $*-mig.d $*.srv.d
-
-# gzip files
-%.gz: %
- $(GZIP) -9 < $< > $@
-
-# strip files
%.stripped: %
$(STRIP) -o $@ $<
-
-#
-# Dependency generation
-#
-
-# Don't build and include dependency files if they're not needed.
-ifneq ($(strip $(filter %clean, $(MAKECMDGOALS))),)
-no_deps = t
-endif
-
-# Include dependency files
-ifneq ($(no_deps),t)
-
-# The MIG stubs depend on their definition files.
--include $(subst _server.o,.srv.d,$(servers)) /dev/null
--include $(subst _user.o,.cli.d,$(users)) /dev/null
-
-# For each .o file we need a .d file.
--include $(subst .o,.d,$(filter %.o,$(objfiles))) /dev/null
-
-endif
-
-# Generic rule for $(CC) based compilation for making dependencies
-define make-deps
-set -e; $(CC) $(CFLAGS) $(CPPFLAGS) -M -MG $< | \
- sed > $@.new -e 's/$*\.o:/$*.o $@:/'
-mv -f $@.new $@
-endef
-
-%.d: %.c; $(make-deps)
-%.d: %.S; $(make-deps)
-
-# .s files don't go through the preprocessor, so we do this
-# This rule must come *after* the genuine ones above, so that
-# make doesn't build a .s file and then make an empty dependency
-# list.
-%.d: %.s
- echo '$*.o: $<' > $@
-
#
-# Autoconf support
+# Echo target.
#
-$(top_builddir)/Makerules $(abs_top_builddir)/Makerules: \
- $(abs_top_srcdir)/Makerules.in $(abs_top_builddir)/config.status
- cd $(abs_top_builddir) && ./config.status $(@F)
+echo-%:
+ @echo '$* = `$($*)'\'
diff --git a/i386/Makefrag.am b/i386/Makefrag.am
index dc5c661..1ba5eb8 100644
--- a/i386/Makefrag.am
+++ b/i386/Makefrag.am
@@ -1,62 +1,7 @@
-# Makefile for i386
-# Copyright 1999, 2006 Free Software Foundation, Inc.
-#
-# Permission to use, copy, modify and distribute this software and its
-# documentation is hereby granted, provided that both the copyright
-# notice and this permission notice appear in all copies of the
-# software, derivative works or modified versions, and any portions
-# thereof, and that both notices appear in supporting documentation.
-#
-# THE FREE SOFTWARE FOUNDATION ALLOWS FREE USE OF THIS SOFTWARE IN ITS
-# "AS IS" CONDITION. THE FREE SOFTWARE FOUNDATION DISCLAIMS ANY
-# LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
-# USE OF THIS SOFTWARE.
-
-
-#
-# configure's findings.
-#
-
-srcdir = @srcdir@
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-bootdir = $(exec_prefix)/boot
-datadir = @datadir@
-includedir = @includedir@
-infodir = @infodir@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-oldincludedir = @oldincludedir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
+# Makefile fragment for i386
-top_srcdir = @srcdir@/..
-top_builddir = ../
+# Copyright 1997, 1999, 2006 Free Software Foundation, Inc.
-
-#
-# Default target
-#
-
-all:
-
-
-# Detect if the user wants LPR
-ifeq ($(findstring -DMACH_LPR,@DEFS@),-DMACH_LPR)
-enable_lpr=yes
-else
-enable_lpr=no
-endif
-
-
-# i386 Mach makefile fragment
-# Copyright 1997, 1999 Free Software Foundation, Inc.
-#
# Permission to use, copy, modify and distribute this software and its
# documentation is hereby granted, provided that both the copyright
# notice and this permission notice appear in all copies of the
@@ -67,151 +12,127 @@ endif
# "AS IS" CONDITION. THE FREE SOFTWARE FOUNDATION DISCLAIMS ANY
# LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
# USE OF THIS SOFTWARE.
-
-
-# Source files for any i386 kernel
-i386at-files = autoconf.c conf.c cons_conf.c rtc.c \
- i386at_ds_routines.c immc.c int_init.c iopl.c kd.c kd_event.c \
- kd_mouse.c kd_queue.c model_dep.c pic_isa.c
-i386-files = ast_check.c db_disasm.c db_interface.c db_trace.c debug_i386.c \
- fpe_linkage.c fpu.c gdt.c hardclock.c idt.c io_emulate.c io_map.c \
- iopb.c ktss.c kttd_interface.c ldt.c loose_ends.c mp_desc.c pcb.c \
- phys.c pic.c pit.c seg.c trap.c user_ldt.c
-intel-files = pmap.c read_fault.c
-
-# Assembler source
-i386at-Sfiles = boothdr.S interrupt.S kdasm.S
-i386-Sfiles = cswitch.S debug_trace.S idt_inittab.S locore.S spl.S
-
-# Account for them in the image
-objfiles += $(subst .c,.o,$(i386at-files) $(i386-files) $(intel-files)) \
- $(subst .S,.o,$(i386at-Sfiles) $(i386-Sfiles))
-vpath %.c $(srcdir)/i386at $(srcdir)/i386 $(srcdir)/intel
-vpath %.S $(srcdir)/i386at $(srcdir)/i386
-
-# Files from the generic source that we want
-objfiles += busses.o cirbuf.o
-# Hm.
-vpath busses.c $(top_srcdir)/chips
-vpath cirbuf.c $(top_srcdir)/device
-
-# Mig-generated
-objfiles += mach_i386_server.o
-
-servers = $(filter %_server.o,$(objfiles))
-
-# This file is only needed for KDB support. It'll be discarded at linking time
-# if it's not needed.
-objfiles += _setjmp.o
-
-# XXX: In i386, com is always enabled.
-objfiles += com.o
-
-# This file is only needed for LPR support.
-ifeq ($(enable_lpr),yes)
-objfiles += lpr.o
-endif
-
+# Source files for any i386 kernel.
+libkernel_a_SOURCES += \
+ i386/i386at/autoconf.c \
+ i386/i386at/boothdr.S \
+ i386/i386at/com.c \
+ i386/i386at/conf.c \
+ i386/i386at/cons_conf.c \
+ i386/i386at/rtc.c \
+ i386/i386at/i386at_ds_routines.c \
+ i386/i386at/immc.c \
+ i386/i386at/int_init.c \
+ i386/i386at/interrupt.S \
+ i386/i386at/iopl.c \
+ i386/i386at/kd.c \
+ i386/i386at/kdasm.S \
+ i386/i386at/kd_event.c \
+ i386/i386at/kd_mouse.c \
+ i386/i386at/kd_queue.c \
+ i386/i386at/model_dep.c \
+ i386/i386at/pic_isa.c
+
+# lpr device support.
+if enable_lpr
+libkernel_a_SOURCES += \
+ i386/i386at/lpr.c
+endif
-# Where to find some things
-vpath i386asm.sym $(srcdir)/i386
-vpath mach_i386.srv $(srcdir)/i386
-
-# Our include files; they precede the generic ones.
-INCLUDES = -I. -I$(srcdir)/i386at -I$(srcdir)/i386 -I$(srcdir)/include \
- -I$(srcdir)/include/mach/sa -I$(srcdir)
-
-# Static dependencies.
-
-# For building with `no_deps=t'.
-boothdr.o: i386asm.h
-
-#
-# Rules.
-#
-
-all: sysdep.a
- $(MAKE) -C linux $@
-
-sysdep.a: $(objfiles) linux/linux.o
- rm -f $@
- $(AR) cr $@ $^
- $(RANLIB) $@
-
-check:
- $(MAKE) -C linux $@
-
-clean:
- $(MAKE) -C linux $@
- rm -f sysdep.a
- rm -f $(objfiles) $(subst .o,.d,$(objfiles))
- rm -f *.symc *.symc.o *_user.c *_server.c *.h *.cli.d *.srv.d
-
-distclean: clean
- $(MAKE) -C linux $@
- rm -f Makefile Makerules
- rm -f config.status config.log
-
-mostlyclean: distclean
- $(MAKE) -C linux $@
-
-maintainer-clean: mostlyclean
- $(MAKE) -C linux $@
- rm -f $(srcdir)/configure
-
-linux/%: FORCE
- $(MAKE) -C linux $(@F)
-FORCE:
+libkernel_a_SOURCES += \
+ i386/i386/ast_check.c \
+ i386/i386/cswitch.S \
+ i386/i386/db_disasm.c \
+ i386/i386/db_interface.c \
+ i386/i386/db_trace.c \
+ i386/i386/debug_i386.c \
+ i386/i386/debug_trace.S \
+ i386/i386/fpe_linkage.c \
+ i386/i386/fpu.c \
+ i386/i386/gdt.c \
+ i386/i386/hardclock.c \
+ i386/i386/idt.c \
+ i386/i386/idt_inittab.S \
+ i386/i386/io_emulate.c \
+ i386/i386/io_map.c \
+ i386/i386/iopb.c \
+ i386/i386/ktss.c \
+ i386/i386/kttd_interface.c \
+ i386/i386/ldt.c \
+ i386/i386/locore.S \
+ i386/i386/loose_ends.c \
+ i386/i386/mp_desc.c \
+ i386/i386/pcb.c \
+ i386/i386/phys.c \
+ i386/i386/pic.c \
+ i386/i386/pit.c \
+ i386/i386/seg.c \
+ i386/i386/spl.S \
+ i386/i386/trap.c \
+ i386/i386/user_ldt.c
+
+# This file is only needed for KDB support.
+if enable_kdb
+libkernel_a_SOURCES += \
+ i386/i386/_setjmp.S
+endif
+libkernel_a_SOURCES += \
+ i386/intel/pmap.c \
+ i386/intel/read_fault.c
+
+# Files from the generic sources that we want.
+libkernel_a_SOURCES += \
+ chips/busses.c \
+ device/cirbuf.c
+
+# See Makefrag.am about lib_dep_tr_for_defs.a.
+nodist_lib_dep_tr_for_defs_a_SOURCES += \
+ i386/i386/mach_i386.server.defs.c
+nodist_libkernel_a_SOURCES += \
+ i386/i386/mach_i386.server.h \
+ i386/i386/mach_i386.server.c
+# i386/i386/mach_i386.server.defs
#
-# Installation
+# Static dependencies.
#
-install:
- $(MAKE) -C linux $@
-
-installed-headers = $(addprefix mach/i386/, \
- asm.h boolean.h disk.h eflags.h exception.h fp_reg.h ioccom.h \
- kern_return.h mach_i386.defs mach_i386_types.h machine_types.defs \
- multiboot.h rpc.h syscall_sw.h thread_status.h trap.h vm_param.h \
- vm_types.h)
-
-installed-headers-names = $(addprefix $(includedir)/,$(installed-headers))
-$(installed-headers-names): $(includedir)/%: $(srcdir)/include/%
- $(INSTALL_DATA) $< $@
-
-install-headers: mkheaderdirs $(installed-headers-names)
- ln -sfn $(systype) $(includedir)/mach/machine
- $(MAKE) -C linux $@
-
-install-kernel:
- $(MAKE) -C linux $@
-
-mkheaderdirs:
- mkdir -p $(includedir)/mach/$(systype)
+# TODO. Hm.
+i386/i386at/boothdr.o: i386/i386/i386asm.h
+nodist_libkernel_a_SOURCES += \
+ i386/i386/i386asm.h
#
-# Autoconf support
+# Architecture specialities.
#
-$(srcdir)/configure: configure.in
- cd $(srcdir) && autoconf
-
-Makefile: Makefile.in config.status
- ./config.status $@
-
-config.status: configure
- ./config.status --recheck
-
-vpath %.in $(srcdir)
-vpath configure $(srcdir)
-
+LINKFLAGS_gnumach = \
+ -T '$(srcdir)/$(systype)'/ldscript
#
-# Makerules
-#
-
-include $(top_builddir)/Makerules
+# Installation.
+#
+
+include_mach_i386dir = $(includedir)/mach/i386
+include_mach_i386_HEADERS = \
+ i386/include/mach/i386/asm.h \
+ i386/include/mach/i386/boolean.h \
+ i386/include/mach/i386/disk.h \
+ i386/include/mach/i386/eflags.h \
+ i386/include/mach/i386/exception.h \
+ i386/include/mach/i386/fp_reg.h \
+ i386/include/mach/i386/ioccom.h \
+ i386/include/mach/i386/kern_return.h \
+ i386/include/mach/i386/mach_i386.defs \
+ i386/include/mach/i386/mach_i386_types.h \
+ i386/include/mach/i386/machine_types.defs \
+ i386/include/mach/i386/multiboot.h \
+ i386/include/mach/i386/rpc.h \
+ i386/include/mach/i386/syscall_sw.h \
+ i386/include/mach/i386/thread_status.h \
+ i386/include/mach/i386/trap.h \
+ i386/include/mach/i386/vm_param.h \
+ i386/include/mach/i386/vm_types.h
diff --git a/i386/linux/Makefrag.am b/i386/linux/Makefrag.am
new file mode 100644
index 0000000..533c6c3
--- /dev/null
+++ b/i386/linux/Makefrag.am
@@ -0,0 +1,24 @@
+# Makefile fragment for i386-specific Linux code.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# This program 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 2, or (at
+# your option) any later version.
+#
+# This program 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, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+#
+# Files for device driver support.
+#
+
+liblinux_a_SOURCES += \
+ linux/src/arch/i386/lib/semaphore.S
diff --git a/linux/Makefrag.am b/linux/Makefrag.am
new file mode 100644
index 0000000..c8cab2c
--- /dev/null
+++ b/linux/Makefrag.am
@@ -0,0 +1,622 @@
+# Makefile fragment for Linux device drivers and the glue code.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# This program 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 2, or (at
+# your option) any later version.
+#
+# This program 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, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+#
+# Files for device driver support.
+#
+
+noinst_LIBRARIES += \
+ liblinux.a
+gnumach_o_LDADD += \
+ liblinux.a
+
+liblinux_a_CPPFLAGS = $(AM_CPPFLAGS) \
+ -I$(srcdir)/$(systype)/linux/dev/include \
+ -I$(top_builddir)/linux/dev/include \
+ -I$(srcdir)/linux/dev/include \
+ -I$(top_builddir)/linux/src/include \
+ -I$(srcdir)/linux/src/include
+# Because of the use of `extern inline' in some Linux header files without
+# corresponding text segment definitions, we must always optimize.
+liblinux_a_CFLAGS = -O2 $(AM_CFLAGS)
+# TODO. Do we really need `-traditional'?
+liblinux_a_CCASFLAGS = $(AM_CCASFLAGS) \
+ -D__ASSEMBLY__ -traditional \
+ $(liblinux_a_CPPFLAGS)
+
+liblinux_a_SOURCES = \
+ linux/dev/init/version.c \
+ linux/dev/kernel/softirq.c \
+ linux/src/arch/i386/lib/delay.c \
+ linux/dev/kernel/dma.c \
+ linux/dev/kernel/resource.c \
+ linux/dev/kernel/printk.c \
+ linux/src/arch/i386/kernel/bios32.c \
+ linux/dev/arch/i386/kernel/irq.c \
+ linux/src/lib/ctype.c \
+ linux/dev/lib/vsprintf.c \
+ linux/dev/init/main.c \
+ linux/dev/glue/misc.c \
+ linux/dev/kernel/sched.c \
+ linux/dev/glue/kmem.c \
+ linux/dev/glue/block.c \
+ linux/dev/arch/i386/kernel/setup.c
+
+liblinux_a_SOURCES += \
+ linux/src/drivers/pci/pci.c \
+ linux/dev/drivers/block/genhd.c
+
+#
+# Linux device drivers.
+#
+if device_driver_floppy
+liblinux_a_SOURCES += \
+ linux/dev/drivers/block/floppy.c
+endif
+
+if device_driver_ide
+liblinux_a_SOURCES += \
+ linux/src/drivers/block/cmd640.c \
+ linux/src/drivers/block/ide-cd.c \
+ linux/src/drivers/block/ide.c \
+ linux/src/drivers/block/rz1000.c \
+ linux/src/drivers/block/triton.c
+endif
+
+if device_driver_group_scsi
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/constants.c \
+ linux/src/drivers/scsi/hosts.c \
+ linux/src/drivers/scsi/scsi.c \
+ linux/src/drivers/scsi/scsi_ioctl.c \
+ linux/src/drivers/scsi/scsi_proc.c \
+ linux/src/drivers/scsi/scsicam.c \
+ linux/src/drivers/scsi/sd.c \
+ linux/src/drivers/scsi/sd_ioctl.c \
+ linux/src/drivers/scsi/sr.c \
+ linux/src/drivers/scsi/sr_ioctl.c
+endif
+
+if device_driver_53c78xx
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/53c78xx.c
+endif
+
+if device_driver_AM53C974
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/AM53C974.c
+endif
+
+if device_driver_BusLogic
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/BusLogic.c
+endif
+
+if device_driver_NCR53c406a
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/NCR53c406a.c
+endif
+
+if device_driver_advansys
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/advansys.c
+endif
+
+if device_driver_aha152x
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/aha152x.c
+endif
+
+if device_driver_aha1542
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/aha1542.c
+endif
+
+if device_driver_aha1740
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/aha1740.c
+endif
+
+if device_driver_aic7xxx
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/aic7xxx.c
+endif
+
+if device_driver_dtc
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/dtc.c
+endif
+
+if device_driver_eata
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/eata.c
+endif
+
+if device_driver_eata_dma
+liblinux_a_SOURCES += \
+ linux/dev/drivers/scsi/eata_dma.c
+endif
+
+if device_driver_eata_pio
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/eata_pio.c
+endif
+
+if device_driver_fdomain
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/fdomain.c
+endif
+
+if device_driver_g_NCR5380
+liblinux_a_SOURCES += \
+ linux/dev/drivers/scsi/g_NCR5380.c
+endif
+
+if device_driver_gdth
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/gdth.c
+endif
+
+if device_driver_in2000
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/in2000.c
+endif
+
+if device_driver_ncr53c8xx
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/ncr53c8xx.c
+endif
+
+if device_driver_pas16
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/pas16.c
+endif
+
+if device_driver_ppa
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/ppa.c
+endif
+
+if device_driver_qlogicfas
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/qlogicfas.c
+endif
+
+if device_driver_qlogicisp
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/qlogicisp.c
+endif
+
+if device_driver_seagate
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/seagate.c
+endif
+
+if device_driver_t128
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/t128.c
+endif
+
+if device_driver_tmscsim
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/tmscsim.c
+endif
+
+if device_driver_u14_34f
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/u14-34f.c
+endif
+
+if device_driver_ultrastor
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/ultrastor.c
+endif
+
+if device_driver_wd7000
+liblinux_a_SOURCES += \
+ linux/src/drivers/scsi/wd7000.c
+endif
+
+if device_driver_group_net
+liblinux_a_SOURCES += \
+ linux/dev/drivers/net/auto_irq.c \
+ linux/dev/glue/net.c \
+ linux/dev/drivers/net/Space.c \
+ linux/dev/net/core/dev.c \
+ linux/dev/drivers/net/net_init.c \
+ linux/src/drivers/net/pci-scan.c
+endif
+
+if device_driver_3c501
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/3c501.c
+endif
+
+if device_driver_3c503
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/3c503.c \
+ linux/src/drivers/net/8390.c
+endif
+
+if device_driver_3c505
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/3c505.c
+endif
+
+if device_driver_3c507
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/3c507.c
+endif
+
+if device_driver_3c509
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/3c509.c
+endif
+
+if device_driver_3c59x
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/3c59x.c
+endif
+
+if device_driver_3c515
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/3c515.c
+endif
+
+if device_driver_ac3200
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/ac3200.c \
+ linux/src/drivers/net/8390.c
+endif
+
+if device_driver_apricot
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/apricot.c
+endif
+
+if device_driver_at1700
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/at1700.c
+endif
+
+if device_driver_atp
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/atp.c
+endif
+
+#if device_driver_cb_shim
+#liblinux_a_SOURCES += \
+# linux/src/drivers/net/cb_shim.c
+#endif
+
+if device_driver_de4x5
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/de4x5.c
+endif
+
+if device_driver_de600
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/de600.c
+endif
+
+if device_driver_de620
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/de620.c
+endif
+
+if device_driver_depca
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/depca.c
+endif
+
+if device_driver_e2100
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/e2100.c \
+ linux/src/drivers/net/8390.c
+endif
+
+if device_driver_eepro
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/eepro.c
+endif
+
+if device_driver_eepro100
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/eepro100.c
+endif
+
+if device_driver_eexpress
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/eexpress.c
+endif
+
+if device_driver_epic100
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/epic100.c
+endif
+
+if device_driver_eth16i
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/eth16i.c
+endif
+
+if device_driver_ewrk3
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/ewrk3.c
+endif
+
+if device_driver_fmv18x
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/fmv18x.c
+endif
+
+if device_driver_hamachi
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/hamachi.c
+endif
+
+if device_driver_hp_plus
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/hp-plus.c \
+ linux/src/drivers/net/8390.c
+endif
+
+if device_driver_hp
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/hp.c \
+ linux/src/drivers/net/8390.c
+endif
+
+if device_driver_hp100
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/hp100.c
+endif
+
+if device_driver_intel_gige
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/intel-gige.c
+endif
+
+if device_driver_lance
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/lance.c
+endif
+
+if device_driver_myson803
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/myson803.c
+endif
+
+if device_driver_natsemi
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/natsemi.c
+endif
+
+if device_driver_ne
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/ne.c \
+ linux/src/drivers/net/8390.c
+endif
+
+if device_driver_ne2k_pci
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/ne2k-pci.c \
+ linux/src/drivers/net/8390.c
+endif
+
+if device_driver_ni52
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/ni52.c
+endif
+
+if device_driver_ni65
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/ni65.c
+endif
+
+if device_driver_ns820
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/ns820.c
+endif
+
+if device_driver_pcnet32
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/pcnet32.c
+endif
+
+if device_driver_rtl8139
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/rtl8139.c
+endif
+
+if device_driver_seeq8005
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/seeq8005.c
+endif
+
+if device_driver_sk_g16
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/sk_g16.c
+endif
+
+if device_driver_smc_ultra
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/smc-ultra.c \
+ linux/src/drivers/net/8390.c
+endif
+
+if device_driver_smc_ultra32
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/smc-ultra32.c \
+ linux/src/drivers/net/8390.c
+endif
+
+if device_driver_starfire
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/starfire.c
+endif
+
+if device_driver_sundance
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/sundance.c
+endif
+
+if device_driver_tlan
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/tlan.c
+endif
+
+if device_driver_tulip
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/tulip.c
+endif
+
+if device_driver_via_rhine
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/via-rhine.c
+endif
+
+if device_driver_wavelan
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/wavelan.c
+endif
+
+if device_driver_wd
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/wd.c
+endif
+
+if device_driver_winbond_840
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/winbond-840.c \
+ linux/src/drivers/net/8390.c
+endif
+
+if device_driver_yellowfin
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/yellowfin.c
+endif
+
+if device_driver_znet
+liblinux_a_SOURCES += \
+ linux/src/drivers/net/znet.c
+endif
+
+# pcmcia-cs.
+
+liblinux_pcmcia_cs_modules_a_CPPFLAGS = $(liblinux_a_CPPFLAGS) \
+ -I$(srcdir)/linux/pcmcia-cs/include
+liblinux_pcmcia_cs_modules_a_CFLAGS = $(liblinux_a_CFLAGS) \
+ -include $(srcdir)/linux/pcmcia-cs/glue/pcmcia_glue.h
+liblinux_pcmcia_cs_modules_a_SOURCES =
+noinst_LIBRARIES += \
+ liblinux_pcmcia_cs_modules.a
+gnumach_o_LDADD += \
+ liblinux_pcmcia_cs_modules.a
+
+if device_driver_group_pcmcia
+liblinux_pcmcia_cs_modules_a_SOURCES += \
+ linux/pcmcia-cs/glue/pcmcia.c \
+ linux/pcmcia-cs/modules/cs.c \
+ linux/pcmcia-cs/modules/ds.c \
+ linux/pcmcia-cs/modules/rsrc_mgr.c \
+ linux/pcmcia-cs/modules/bulkmem.c \
+ linux/pcmcia-cs/modules/cistpl.c \
+ linux/pcmcia-cs/modules/pci_fixup.c
+endif
+
+if device_driver_i82365
+liblinux_pcmcia_cs_modules_a_SOURCES += \
+ linux/pcmcia-cs/modules/i82365.c
+endif
+
+liblinux_pcmcia_cs_clients_a_CPPFLAGS = $(liblinux_a_CPPFLAGS) \
+ -DPCMCIA_CLIENT -I$(srcdir)/linux/pcmcia-cs/include
+liblinux_pcmcia_cs_clients_a_CFLAGS = $(liblinux_a_CFLAGS) \
+ -include $(srcdir)/linux/pcmcia-cs/glue/pcmcia_glue.h
+liblinux_pcmcia_cs_clients_a_SOURCES =
+noinst_LIBRARIES += \
+ liblinux_pcmcia_cs_clients.a
+gnumach_o_LDADD += \
+ liblinux_pcmcia_cs_clients.a
+
+if device_driver_3c574_cs
+liblinux_pcmcia_cs_clients_a_SOURCES += \
+ linux/pcmcia-cs/clients/3c574_cs.c
+endif
+
+if device_driver_3c589_cs
+liblinux_pcmcia_cs_clients_a_SOURCES += \
+ linux/pcmcia-cs/clients/3c589_cs.c
+endif
+
+if device_driver_axnet_cs
+liblinux_pcmcia_cs_clients_a_SOURCES += \
+ linux/pcmcia-cs/clients/axnet_cs.c
+endif
+
+if device_driver_fmvj18x_cs
+liblinux_pcmcia_cs_clients_a_SOURCES += \
+ linux/pcmcia-cs/clients/fmvj18x_cs.c
+endif
+
+if device_driver_nmclan_cs
+liblinux_pcmcia_cs_clients_a_SOURCES += \
+ linux/pcmcia-cs/clients/nmclan_cs.c
+endif
+
+if device_driver_pcnet_cs
+liblinux_pcmcia_cs_clients_a_SOURCES += \
+ linux/pcmcia-cs/clients/pcnet_cs.c \
+ linux/src/drivers/net/8390.c
+endif
+
+if device_driver_smc91c92_cs
+liblinux_pcmcia_cs_clients_a_SOURCES += \
+ linux/pcmcia-cs/clients/smc91c92_cs.c
+endif
+
+if device_driver_xirc2ps_cs
+liblinux_pcmcia_cs_clients_a_SOURCES += \
+ linux/pcmcia-cs/clients/xirc2ps_cs.c
+endif
+
+liblinux_pcmcia_cs_wireless_a_CPPFLAGS = $(liblinux_a_CPPFLAGS) \
+ -I$(srcdir)/linux/pcmcia-cs/include
+liblinux_pcmcia_cs_wireless_a_CFLAGS = $(liblinux_a_CFLAGS) \
+ -include $(srcdir)/linux/pcmcia-cs/glue/wireless_glue.h
+liblinux_pcmcia_cs_wireless_a_SOURCES =
+noinst_LIBRARIES += \
+ liblinux_pcmcia_cs_wireless.a
+gnumach_o_LDADD += \
+ liblinux_pcmcia_cs_wireless.a
+
+if device_driver_orinoco_cs
+liblinux_pcmcia_cs_wireless_a_SOURCES += \
+ linux/pcmcia-cs/wireless/hermes.c \
+ linux/pcmcia-cs/wireless/orinoco.c \
+ linux/pcmcia-cs/wireless/orinoco_cs.c
+endif
+
+#
+# Architecture specific parts.
+#
+
+if HOST_i386
+include i386/linux/Makefrag.am
+endif