1# $OpenBSD: Makefile,v 1.14 2017/10/17 19:31:56 naddy Exp $ 2# $NetBSD: Makefile,v 1.1 2000/08/20 14:58:45 mrg Exp $ 3 4CURDIR= ${.CURDIR} 5S= ${CURDIR}/../../../.. 6 7# 8# Override normal settings 9# 10 11CLEANFILES= assym.fth.h assym.fth.h.tmp machine \ 12 bootblk bootblk.text bootblk.text.tmp 13 14NOMAN= 15STRIPFLAG= 16BINMODE=644 17 18INCLUDES= -I. -I$S/arch -I$S -nostdinc 19CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} 20 21.if !make(clean) && !make(cleandir) && !make(includes) && !make(libdep) && \ 22 !make(sadep) && !make(salibdir) && !make(obj) 23.BEGIN: 24 @([ -h machine ] || ln -s ${.CURDIR}/../../include machine) 25.endif 26 27all: bootblk.text bootblk 28 29assym.fth.h: ${.CURDIR}/genassym.sh genfth.cf 30 sh ${.CURDIR}/genassym.sh ${CC} ${CFLAGS} \ 31 ${CPPFLAGS} ${PROF} <${.CURDIR}/genfth.cf >assym.fth.h.tmp && \ 32 mv -f assym.fth.h.tmp assym.fth.h 33 34bootblk.text: bootblk.fth assym.fth.h 35 awk '/fload/ { file=$$2; while ((ret = getline <file) == 1) print; close(file); if (ret == -1) print "unable to read " file >"/dev/stderr"; next }; !/fload/' \ 36 ${.CURDIR}/bootblk.fth >bootblk.text.tmp && \ 37 mv -f bootblk.text.tmp bootblk.text 38 39bootblk: bootblk.fth assym.fth.h 40 fgen -o bootblk ${.CURDIR}/bootblk.fth 41 42beforeinstall: 43 ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ 44 bootblk ${DESTDIR}/usr/mdec 45 46# 47# The following are if you grab the fakeboot program from the Sun website 48# 49 50fake: bootblk bootblk.text 51 ../fakeboot/fakeboot -elf32 <bootblk >/bootblk 52 ../fakeboot/fakeboot -elf32 <bootblk.text >/bootblk.text 53 54.include <bsd.prog.mk> 55