NetBSD/sys/arch/i386/boot/Makefile

135 lines
3.4 KiB
Makefile
Raw Normal View History

1993-03-21 21:04:42 +03:00
#
# Ported to boot 386BSD by Julian Elischer (julian@tfs.com)
# September 1992
#
# 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.
#
# CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
# CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
# ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
#
# Carnegie Mellon requests users of this software to return to
#
# Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
# School of Computer Science
# Carnegie Mellon University
# Pittsburgh PA 15213-3890
#
# any improvements or extensions that they make and grant Carnegie Mellon
# the rights to redistribute these changes.
#
#
# HISTORY
# $Log: Makefile,v $
# Revision 1.5 1993/07/04 14:03:03 cgd
# do the right thing, so things aren't built in /usr/src/sys
#
# Revision 1.4 1993/06/18 08:03:14 cgd
1993-06-18 12:03:14 +04:00
# install floppy boot block, too.
#
# Revision 1.3 1993/06/08 03:36:39 deraadt
# makes more sense if src is mounted readonly
#
# Revision 1.2 1993/04/28 08:45:51 deraadt
# Ensure the rmaouthdr shell script is executable before running it!
#
# Revision 1.1 1993/03/21 18:08:11 cgd
1993-03-21 21:04:42 +03:00
# after 0.2.2 "stable" patches applied
#
# Revision 2.2 92/04/04 11:33:46 rpd
# Fabricated for MACH 3.0
# [92/03/30 mg32]
#
# Thu Sep 10 22:40:23 PDT 1992
# Ported to 386BSD by Julian Elischer
# julian@tfs.com
#
NOPROG= noprog
NOMAN= noman
CFLAGS = -O -DDO_BAD144 -I${.CURDIR}
1993-03-21 21:04:42 +03:00
LIBS= -lc
INC= -I${.CURDIR}/../..
1993-03-21 21:04:42 +03:00
# start.o should be first, table.o should be second
OBJS = start.o table.o boot2.o boot.o asm.o bios.o io.o disk.o sys.o
.SUFFIXES: .s .c .o
# These are wierd because we don't want separate code and data segments.. ok?
.c.o:
@echo $(CC) -c $(CFLAGS) $(INC) $*.c
-@trap "/bin/rm -f $*.i $*.s; exit 0" 0 1 2 3 10 15; \
$(CC) $(CFLAGS) $(INC) -S $<; \
if [ $$? != 0 ]; then :; else \
sed -f ${.CURDIR}/boot.sed $*.s > $*.i; \
1993-03-21 21:04:42 +03:00
$(AS) $*.i -o $@; \
fi
.s.o:
@echo $(AS) -o $*.o $<
-@trap "/bin/rm -f $*.i X$*.c; exit 0" 0 1 2 3 10 15; \
/bin/rm -f X$*.c; \
ln -s $< X$*.c; \
1993-03-21 21:04:42 +03:00
$(CC) -E $(CFLAGS) X$*.c > $*.i; \
if [ $$? != 0 ]; then :; \
else \
$(AS) $*.i -o $@; \
fi
boot: boot.sed $(OBJS)
$(LD) -N -T 0 -o boot $(OBJS) $(LIBS)
cp boot boot.sym
@strip boot
@sh ${.CURDIR}/rmaouthdr boot boot.tmp
1993-03-21 21:04:42 +03:00
@mv -f boot.tmp boot
@ls -l boot
biosboot: boot
dd if=boot of=biosboot count=1
bootbios: boot
dd if=boot of=bootbios skip=1
/usr/mdec/bootsd: bootbios
cp bootbios /usr/mdec/bootsd
/usr/mdec/sdboot: biosboot
cp biosboot /usr/mdec/sdboot
/usr/mdec/bootwd: /usr/mdec/bootsd
rm -f /usr/mdec/bootwd
ln /usr/mdec/bootsd /usr/mdec/bootwd
/usr/mdec/wdboot: /usr/mdec/sdboot
rm -f /usr/mdec/wdboot
ln /usr/mdec/sdboot /usr/mdec/wdboot
/usr/mdec/bootfd: /usr/mdec/bootsd
rm -f /usr/mdec/bootfd
ln /usr/mdec/bootsd /usr/mdec/bootfd
/usr/mdec/fdboot: /usr/mdec/sdboot
rm -f /usr/mdec/fdboot
ln /usr/mdec/sdboot /usr/mdec/fdboot
sd: /usr/mdec/bootsd /usr/mdec/sdboot
wd: /usr/mdec/bootwd /usr/mdec/wdboot
fd: /usr/mdec/bootfd /usr/mdec/fdboot
all: biosboot bootbios
1993-03-21 21:04:42 +03:00
1993-06-18 12:03:14 +04:00
# Beware: the floppy boot block is *slow*...
install: wd sd fd
1993-03-21 21:04:42 +03:00
clean cleandir:
1993-03-21 21:04:42 +03:00
/bin/rm -f *.o *.d boot bootbios biosboot boot.sym
.include <bsd.prog.mk>