1# $OpenBSD: Makefile,v 1.7 2007/11/26 10:26:03 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 sparc \ 12 bootblk bootblk.text bootblk.text.tmp 13 14NOMAN= 15STRIPFLAG= 16 17# deal with Solaris vs. NetBSD build environments for now .. 18OS!=uname -s 19.if (${OS} == "OpenBSD") 20USE_GENASSYM?= no 21SVR4= 22.else 23USE_GENASSYM?= yes 24SVR4=-U__SVR4 -U__svr4__ -D__NetBSD__ 25.endif 26 27INCLUDES= -I. -I$S/arch -I$S -nostdinc 28CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_LKM ${SVR4} 29 30.if !make(libdep) && !make(sadep) && !make(salibdir) && !make(obj) 31.BEGIN: 32 @([ -h machine ] || ln -s ${.CURDIR}/../../include machine) 33.endif 34 35all: bootblk.text bootblk 36 37sparc: 38 ln -s ${.CURDIR}/../../../sparc/include sparc 39 40assym.fth.h: ${.CURDIR}/genassym.sh genfth.cf 41 sh ${.CURDIR}/genassym.sh ${CC} ${CFLAGS} \ 42 ${CPPFLAGS} ${PROF} <${.CURDIR}/genfth.cf >assym.fth.h.tmp && \ 43 mv -f assym.fth.h.tmp assym.fth.h 44 45bootblk.text: bootblk.fth assym.fth.h 46 awk '/fload/ { print "#include \"" $$2 "\"" }; !/fload/' \ 47 ${.CURDIR}/bootblk.fth | /usr/bin/cpp -traditional -P >bootblk.text.tmp && \ 48 mv -f bootblk.text.tmp bootblk.text 49 50bootblk: bootblk.fth assym.fth.h 51 fgen -o bootblk ${.CURDIR}/bootblk.fth 52 53beforedepend: 54 @touch .depend 55 56beforeinstall: 57 ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ 58 bootblk ${DESTDIR}/usr/mdec 59 60# 61# The following are if you grab the fakeboot program from the Sun website 62# 63 64fake: bootblk bootblk.text 65 ../fakeboot/fakeboot -elf32 <bootblk >/bootblk 66 ../fakeboot/fakeboot -elf32 <bootblk.text >/bootblk.text 67 68.include <bsd.prog.mk> 69