summaryrefslogtreecommitdiff
path: root/i386/Makefrag
diff options
context:
space:
mode:
Diffstat (limited to 'i386/Makefrag')
-rw-r--r--i386/Makefrag73
1 files changed, 60 insertions, 13 deletions
diff --git a/i386/Makefrag b/i386/Makefrag
index 23f5e85..fcab470 100644
--- a/i386/Makefrag
+++ b/i386/Makefrag
@@ -7,16 +7,18 @@
DEFINES += -DCONTINUATIONS -DLINUX_DEV -D__ELF__ -Di386
# Source files for any i386 kernel
-i386at-files = autoconf.c blit.c com.c conf.c cons_conf.c fd.c \
+i386at-files = autoconf.c blit.c conf.c cons_conf.c fd.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 lpr.c model_dep.c nfd.c nhd.c \
- phys_mem_grab_page.c pic_isa.c rtc.c
+ kd_mouse.c kd_queue.c model_dep.c phys_mem_grab_page.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
+# Drivers; not used in all kernel, but only if selected.
+driver-files= com.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
@@ -39,9 +41,6 @@ objfiles += mach_i386_server.o
### Linux device drivers (make this Better, Please)
-# instead of Mach's KERNEL, Linux uses __KERNEL__. Whee.
-DEFINES += -D__KERNEL__
-
linux-gen-files = $(addprefix linux_,$(linux-gen-names))
linux-gen-names = autoirq.c block.c dma.c init.c irq.c kmem.c misc.c net.c \
port.c printk.c sched.c soft.c timer.c version.c vsprintf.c
@@ -64,21 +63,53 @@ linux-scsi-files = 53c7,8xx.c AM53C974.c BusLogic.c NCR53c406a.c advansys.c \
sd_ioctl.c seagate.c sr.c sr_ioctl.c t128.c u14-34f.c \
ultrastor.c wd7000.c
-objfiles += $(subst .c,.o,$(linux-gen-files) $(linux-block-files) \
- $(linux-net-files) $(linux-pci-files) $(linux-scsi-files))
+all-linux-files = $(linux-gen-files) $(linux-block-files) \
+ $(linux-net-files) $(linux-pci-files) $(linux-scsi-files)
+
+# These are always used.
+objfiles += $(subst .c,.o,$(filter-out linux_net.c,$(linux-gen-files)))
+objfiles += $(subst .c,.o,$(linux-pci-files)) genhd.o
+
vpath %.c $(sysdep)/i386at/gpl/linux $(sysdep)/i386at/gpl/linux/block
vpath %.c $(sysdep)/i386at/gpl/linux/net $(sysdep)/i386at/gpl/linux/pci
vpath %.c $(sysdep)/i386at/gpl/linux/scsi
+# These files need special flags for compilation; each one will
+# have a variable like wd7000.c-linux-flags with those flags.
+CFLAGS += $($(<F)-linux-flags)
+
+# These flags are:
+# Instead of Mach's KERNEL, Linux uses __KERNEL__. Whee.
+# Arrange for special include directories too.
# Because of the use of `extern inline' in some Linux header files without
# corresponding text-segment definitions, we must always optimize.
-CFLAGS += -O2
+linux-spec-flags= -D__KERNEL__ -I$(sysdep)/i386at/gpl/linux \
+ -I$(sysdep)/i386at/gpl/linux/include -O2
+
+# Here is where those specs are found.
+include linux-flags
+
+# How to make this file:
+
+linux-flags: $(sysdep)/Makefrag
+ rm -f $@
+ for i in $(all-linux-files); do \
+ echo $$i-linux-flags '= $$(linux-spec-flags)' >> $@; \
+ done
+ echo 'linux-flags-done='$(all-linux-files) >> $@
+
+# If we haven't included `linux-flags' properly, then don't try and build
+# .d files.
+ifneq ($(linux-flags-done),$(all-linux-files))
+no_deps=t
+endif
### End Linux device drivers grot
-# XXX Temporary
-i386at_ds_routines.o: device_interface.h
+
+include i386/driverlist
+objfiles += $(device_drivers)
@@ -93,10 +124,8 @@ objfiles := boothdr.o $(filter-out boothdr.o,$(objfiles))
INCLUDES := -I$(sysdep)/i386at -I$(sysdep)/i386 \
-I$(sysdep)/include -I$(sysdep)/include/mach/sa \
-I$(sysdep)/bogus -I$(sysdep) \
- -I$(sysdep)/i386at/gpl/linux -I$(sysdep)/i386at/gpl/linux/include \
$(INCLUDES)
-
# arrange suitable load address
LDFLAGS += -Ttext 100000
@@ -105,7 +134,25 @@ ASFLAGS += -DASSEMBLER
boothdr.o: i386asm.h
+
+# Header files we install
+
+# We have our own version of this file
+installed-headers := $(filter-out mach/proc_ops.h,$(installed-headers))
+
+i386-installed-headers= mach/proc_ops.h \
+ $(addprefix mach/i386/,asm.h bios.h boolean.h code16.h \
+ debug_reg.h disk.h dpmi.h eflags.h exception.h far_ptr.h \
+ fp_reg.h ioccom.h kern_return.h mach_i386.defs \
+ mach_i386_types.h machine_types.defs multiboot.h paging.h \
+ pio.h pmode.h proc_reg.h rpc.h seg.h syscall_sw.h \
+ thread_status.h time_stamp.h trap.h tss.h vcpi.h vm_param.h \
+ vm_types.h)
+
+
# Cheat, cheat, cheat.
fpe.o: fpe.b_elf
uudecode $<
vpath fpe.b_elf $(sysdep)/i386
+
+fpe.d:; touch $@ \ No newline at end of file