1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
#
# Copyright (c) 1994-1998 The University of Utah and the Flux Group.
#
# This file is part of the OSKit Linux Boot Loader, which is free software,
# also known as "open source;" you can redistribute it and/or modify it under
# the terms of the GNU General Public License (GPL), version 2, as published
# by the Free Software Foundation (FSF).
#
# The OSKit 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 GPL for more details. You should have
# received a copy of the GPL along with the OSKit; see the file COPYING. If
# not, write to the FSF, 59 Temple Place #330, Boston, MA 02111-1307, USA.
#
ifndef _boot_bsd_makerules_
_boot_bsd_makerules_ = yes
TARGETS = mklinuximage linuxboot.bin
INSTALL_TARGETS = $(INSTALL_BINDIR)/mklinuximage \
$(INSTALL_LIBDIR)/oskit/linuxboot.bin
CLEAN_FILES += linuxboot.bin linuxboot
# Having DEBUG defined does bad things for some of this code.
DEFINES := $(filter-out -DDEBUG,$(DEFINES))
# Defines to control the gunzip code
DEFINES += -DHAVE_STRING_H -DDYN_ALLOC -Dnear=""
# Where to look for src files.
SRCDIRS += $(OSKIT_SRCDIR)/boot/linux $(OSKIT_SRCDIR)/boot
# Libraries we need to link with
LIBS = -loskit_exec -loskit_kern -loskit_c -loskit_lmm
DEPENDLIBS := $(patsubst -l%,$(OBJDIR)/lib/lib%.a,$(LIBS))
# Some of the Linux files want to include <linux/...> headers.
INCDIRS += $(OSKIT_SRCDIR)/oskit/c $(OSKIT_SRCDIR)/boot
all: $(TARGETS)
install: $(INSTALL_TARGETS)
# Include the makefile containing the generic rules.
# This must come here since it depends on SRCDIRS and sets OBJFILES.
include $(OSKIT_SRCDIR)/GNUmakerules
# Make sure the boot sector and setup header come first.
OBJFILES := i16_bootsect.o i16_setup.o \
$(filter-out i16_bootsect.o i16_setup.o,$(OBJFILES))
## How to build the binary Linux boot image prefix
linuxboot.bin.real: $(OBJFILES) $(DEPENDLIBS)
$(LD) $(LDFLAGS) $(OSKIT_LDFLAGS) \
-Ttext 0 -oformat binary -o linuxboot.bin $(OBJFILES) $(LIBS)
# For now, just use the already built one that we know works!
# We avoid potential CVS clobberation by uuencoding this.
linuxboot.bin: linuxboot.bin.uue
uudecode $<
# For debugging - something you can 'nm' and 'gdb'.
linuxboot: $(OBJFILES) $(DEPENDLIBS)
$(LD) $(LDFLAGS) $(OSKIT_LDFLAGS) \
-Ttext 0 -o $@ $(OBJFILES) $(LIBS)
.PHONY: mklinuximage
mklinuximage:
chmod +x $@
endif
|