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 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
|
# Configuration variables
# They can also be stored in a file /etc/lilo.defines, e.g.
# -DIGNORECASE -DONE_SHOT
# The variables configured in this Makefile are ignored if
# /etc/lilo.defines exists
# BEEP Beep after displaying "LILO".
# IGNORECASE Image selection is case-insensitive. Passwords are still
# case-sensitive.
# LARGE_EBDA Load at 8xxxx instead of 9xxxx to leave more room for the
# EBDA (Extended BIOS Data Area)
# NO1STDIAG Don't show diagnostic on read errors in the first stage boot
# NODRAIN Don't drain keyboard buffer after booting.
# NOINSTDEF Don't install a new boot sector if INSTALL is not specified.
# ONE_SHOT Disable the command-line and password timeout if any key is
# hit at the boot prompt.
# READONLY Don't write to disk while booting, e.g. don't overwrite the
# default command line in the map file after reading it.
# REWRITE_TABLE Enable rewriting the partition table at boot time.
# loader.
# USE_TMPDIR Create temporary devices in $TMPDIR if set
# VARSETUP Enables use of variable-size setup segments.
# XL_SECS=n Support for extra large (non-standard) floppies.
CONFIG=-DIGNORECASE -DVARSETUP -DREWRITE_TABLE -DUSE_TMPDIR
# End of configuration variables
SBIN_DIR=/sbin
CFG_DIR=/etc
BOOT_DIR=/boot
USRSBIN_DIR=/usr/sbin
PCONFIG=`( if [ -r $$ROOT/etc/lilo.defines ]; then \
cat $$ROOT/etc/lilo.defines; else echo $(CONFIG); fi ) | \
sed 's/-D/-DLCF_/g'` `[ -r /usr/include/asm/boot.h ] && echo -DHAS_BOOT_H`
GO=-DGO=0x`sed '/go/s/^.*go 0 \(....\) A.*$$/\1/p;d' first.lis`
SHELL=/bin/sh
CC=cc
CPP=$(CC) -E
AS86=as86 -0 -a
LD86=ld86 -0
CFLAGS=-O2 -Wall -g $(PCONFIG)
LDFLAGS=#-Xlinker -qmagic
OBJS=lilo.o map.o geometry.o boot.o device.o common.o bsect.o cfg.o temp.o \
partition.o identify.o
.SUFFIXES: .img .b
all: check-config lilo boot.b dump.b os2_d.b chain.b dparam.com \
activate
check-config:
$(CPP) check-config.cpp $(PCONFIG) >/dev/null
.c.o:
$(CC) -c $(CFLAGS) $*.c
.s.o:
$(AS86) -w -o $*.o $*.s
.o.img:
$(LD86) -s -o $*.img $*.o
.img.b:
dd if=$*.img of=$*.b bs=32 skip=1
activate: activate.c
$(CC) -Wall -s -O -o activate activate.c $(LDFLAGS)
dparam.com: dparam.img
dd if=dparam.img of=dparam.com bs=288 skip=1
lilo: $(OBJS)
$(CC) -o lilo $(LDFLAGS) $(OBJS)
boot.b: first.b second.b
(dd if=first.b bs=512 conv=sync; dd if=second.b) >boot.b
first.s: first.S lilo.h lilo
$(CPP) $(PCONFIG) `./lilo -X` first.S -o first.s
second.s: second.S lilo.h lilo
$(CPP) $(PCONFIG) $(GO) `./lilo -X` second.S -o second.s
chain.s: chain.S lilo.h
$(CPP) $(PCONFIG) $(GO) chain.S -o chain.s
os2_d.s: chain.S lilo.h
$(CPP) $(PCONFIG) $(GO) chain.S -DDOS_D -o os2_d.s
#dos_d.s: chain.S lilo.h first.lis
# $(CPP) $(PCONFIG) $(GO) chain.S -DDOS_D -o dos_d.s
dump.s: dump.S lilo.h first.lis
$(CPP) $(PCONFIG) `./lilo -X` dump.S -DDOS_D -o dump.s \
-DGO=0x`sed '/go/s/^.*go 0 \(....\) A.*$$/\1/p;d' first.lis`
xxx.s: chain.S lilo.h
$(CPP) chain.S -DXXX -o xxx.s
first.o first.lis: first.s
$(AS86) -w -o first.o -l first.lis first.s
second.lis: second.s
$(AS86) -w -l second.lis second.s
install: all
if [ ! -d $$ROOT$(SBIN_DIR) ]; then mkdir $$ROOT$(SBIN_DIR); fi
if [ ! -d $$ROOT$(CFG_DIR) ]; then mkdir $$ROOT$(CFG_DIR); fi
if [ ! -d $$ROOT$(BOOT_DIR) ]; then mkdir $$ROOT$(BOOT_DIR); fi
if [ ! -d $$ROOT$(USRSBIN_DIR) ]; then \
mkdir $$ROOT$(USRSBIN_DIR); fi
if [ -f $$ROOT$(BOOT_DIR)/boot.b ]; then \
mv $$ROOT$(BOOT_DIR)/boot.b $$ROOT$(BOOT_DIR)/boot.old; fi
if [ -f $$ROOT$(BOOT_DIR)/chain.b ]; then \
mv $$ROOT$(BOOT_DIR)/chain.b $$ROOT$(BOOT_DIR)/chain.old; fi
if [ -f $$ROOT$(BOOT_DIR)/os2_d.b ]; then \
mv $$ROOT$(BOOT_DIR)/os2_d.b $$ROOT$(BOOT_DIR)/os2_d.old; fi
cp boot.b chain.b os2_d.b $$ROOT$(BOOT_DIR)
cp lilo $$ROOT$(SBIN_DIR)
strip $$ROOT$(SBIN_DIR)/lilo
cp keytab-lilo.pl $$ROOT$(USRSBIN_DIR)
@if [ -e $$ROOT/etc/lilo/install ]; then echo; \
echo -n "$$ROOT/etc/lilo/install is obsolete. LILO is now ";\
echo "re-installed "; \
echo "by just invoking $(SBIN_DIR)/lilo"; echo; fi
@echo "/sbin/lilo must now be run to complete the update."
dep:
sed '/\#\#\# Dependencies/q' <Makefile >tmp_make
$(CPP) $(CFLAGS) -MM *.c >>tmp_make
mv tmp_make Makefile
version:
[ -r VERSION ] && [ -d ../lilo -a ! -d ../lilo-`cat VERSION` ]\
&& mv ../lilo ../lilo-`cat VERSION`
clean:
rm -f *.o *.img *.lis first.s second.s chain.s \
os2_d.s dump.s tmp_make first.b second.b
spotless: clean
rm -f lilo activate boot.b chain.b os2_d.b dump.b dparam.com
### Dependencies
activate.o : activate.c
boot.o : boot.c config.h common.h lilo.h geometry.h cfg.h map.h partition.h \
boot.h
bsect.o : bsect.c config.h common.h lilo.h cfg.h device.h geometry.h map.h temp.h \
partition.h boot.h bsect.h
cfg.o : cfg.c common.h lilo.h temp.h cfg.h
common.o : common.c common.h lilo.h
device.o : device.c config.h common.h lilo.h temp.h device.h
geometry.o : geometry.c config.h lilo.h common.h device.h geometry.h cfg.h
identify.o : identify.c cfg.h
lilo.o : lilo.c config.h common.h lilo.h temp.h geometry.h map.h bsect.h cfg.h \
identify.h
map.o : map.c lilo.h common.h geometry.h map.h
partition.o : partition.c config.h lilo.h common.h cfg.h device.h geometry.h
temp.o : temp.c common.h lilo.h temp.h
|