1# $OpenBSD: Makefile,v 1.12 2014/07/15 22:14:37 deraadt 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(libdep) && !make(sadep) && !make(salibdir) && !make(obj) 22.BEGIN: 23 @([ -h machine ] || ln -s ${.CURDIR}/../../include machine) 24.endif 25 26all: bootblk.text bootblk 27 28assym.fth.h: ${.CURDIR}/genassym.sh genfth.cf 29 sh ${.CURDIR}/genassym.sh ${CC} ${CFLAGS} \ 30 ${CPPFLAGS} ${PROF} <${.CURDIR}/genfth.cf >assym.fth.h.tmp && \ 31 mv -f assym.fth.h.tmp assym.fth.h 32 33bootblk.text: bootblk.fth assym.fth.h 34 awk '/fload/ { file=$$2; while ((ret = getline <file) == 1) print; close(file); if (ret == -1) print "unable to read " file >"/dev/stderr"; next }; !/fload/' \ 35 ${.CURDIR}/bootblk.fth >bootblk.text.tmp && \ 36 mv -f bootblk.text.tmp bootblk.text 37 38bootblk: bootblk.fth assym.fth.h 39 fgen -o bootblk ${.CURDIR}/bootblk.fth 40 41beforedepend: 42 @touch .depend 43 44beforeinstall: 45 ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ 46 bootblk ${DESTDIR}/usr/mdec 47 48# 49# The following are if you grab the fakeboot program from the Sun website 50# 51 52fake: bootblk bootblk.text 53 ../fakeboot/fakeboot -elf32 <bootblk >/bootblk 54 ../fakeboot/fakeboot -elf32 <bootblk.text >/bootblk.text 55 56.include <bsd.prog.mk> 57