Home | History | Annotate | Line # | Download | only in stand
Makefile.booters revision 1.97
      1  1.97       rin #	$NetBSD: Makefile.booters,v 1.97 2024/06/29 07:38:07 rin Exp $
      2  1.32   thorpej 
      3  1.93     kamil NOLIBCSANITIZER=
      4  1.92  christos NOSANITIZER=
      5  1.32   thorpej .include <bsd.own.mk>
      6   1.1     perry 
      7   1.2   thorpej STRIPFLAG=
      8   1.1     perry BINMODE=444
      9  1.38   thorpej 
     10  1.38   thorpej LIBCRT0=	# nothing
     11  1.89   tsutsui LIBCRTI=	# nothing
     12  1.38   thorpej LIBCRTBEGIN=	# nothing
     13  1.38   thorpej LIBCRTEND=	# nothing
     14  1.38   thorpej LIBC=		# nothing
     15  1.29       tls 
     16  1.33   thorpej # Make sure we override any optimization options specified by the
     17  1.33   thorpej # user.
     18  1.37      fvdl .if ${MACHINE_ARCH} == "x86_64"
     19  1.90    martin CPUFLAGS= -m32 -march=i386 -mtune=i386
     20  1.37      fvdl .else
     21  1.81  jakllsch CPUFLAGS=  -march=i386 -mtune=i386
     22  1.63       mrg .endif
     23  1.84     joerg COPTS=	${OPT_SIZE.${ACTIVE_CC}}
     24   1.1     perry 
     25   1.8  drochner I386_STAND_DIR?= $S/arch/i386/stand
     26   1.8  drochner 
     27  1.52       dsl .PATH: ${I386_STAND_DIR}/lib
     28  1.32   thorpej 
     29   1.8  drochner .PATH: ${I386_STAND_DIR}/lib/crt/dos
     30  1.16  christos DOSSTART= start_dos.o doscommain.o
     31  1.32   thorpej 
     32  1.31   thorpej .PATH: ${I386_STAND_DIR}/lib/crt/pxe
     33  1.31   thorpej PXESTART= start_pxe.o
     34   1.1     perry 
     35  1.70      yamt CPPFLAGS+= -nostdinc -I${.OBJDIR} -I$S -I${I386_STAND_DIR}/lib -I$S/lib/libsa
     36   1.5  drochner CPPFLAGS+= -D_STANDALONE
     37  1.68     lukem LDFLAGS+=  -nostdlib
     38  1.37      fvdl 
     39  1.37      fvdl # XXX
     40  1.37      fvdl .if ${MACHINE_ARCH} == "x86_64"
     41  1.37      fvdl CPPFLAGS+=-m32
     42  1.68     lukem LDFLAGS+=-Wl,-m,elf_i386
     43  1.37      fvdl LIBKERN_ARCH=i386
     44  1.37      fvdl KERNMISCMAKEFLAGS="LIBKERN_ARCH=i386"
     45  1.37      fvdl .endif
     46   1.1     perry 
     47  1.91  christos CLEANFILES+= ${STARTFILE} ${BASE}.list
     48   1.7   thorpej 
     49   1.1     perry ### find out what to use for libkern
     50   1.1     perry KERN_AS=	library
     51   1.1     perry .include "${S}/lib/libkern/Makefile.inc"
     52   1.1     perry LIBKERN=	${KERNLIB}
     53   1.1     perry 
     54   1.1     perry ### find out what to use for libz
     55   1.1     perry Z_AS=		library
     56   1.1     perry .include "${S}/lib/libz/Makefile.inc"
     57   1.1     perry LIBZ=		${ZLIB}
     58   1.1     perry 
     59   1.1     perry ### find out what to use for libsa
     60   1.1     perry SA_AS=		library
     61  1.22  christos SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
     62   1.1     perry .include "${S}/lib/libsa/Makefile.inc"
     63   1.1     perry LIBSA=		${SALIB}
     64   1.1     perry 
     65   1.1     perry ### find out what to use for libi386
     66   1.8  drochner I386DIR= ${I386_STAND_DIR}/lib
     67   1.1     perry .include "${I386DIR}/Makefile.inc"
     68   1.1     perry LIBI386=		${I386LIB}
     69  1.17      tron 
     70  1.79  dholland cleandir distclean: .WAIT cleanlibdir
     71  1.17      tron 
     72  1.17      tron cleanlibdir:
     73  1.57       jmc 	-rm -rf lib
     74  1.16  christos 
     75  1.95  christos LDFLAGS+=-Wl,-z,noseparate-code -Wl,-M -Wl,-e,start 	# -N does not work properly.
     76  1.16  christos 
     77  1.22  christos LIBLIST=${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBI386} ${LIBSA}
     78  1.22  christos 
     79  1.91  christos VERSIONMACHINE=x86
     80  1.91  christos .include "${S}/conf/newvers_stand.mk"
     81   1.7   thorpej 
     82  1.32   thorpej CLEANFILES+= ${BASE}.sym
     83  1.32   thorpej ${BASE}.sym: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
     84  1.64     lukem 	${_MKTARGET_LINK}
     85  1.68     lukem 	${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \
     86  1.39       dsl 	    ${STARTFILE} ${OBJS} ${LIBLIST} >${BASE}.list
     87  1.32   thorpej 
     88  1.65     lukem CLEANFILES+= ${BASE}.rom ${BASE}.rom.tmp
     89  1.32   thorpej ${BASE}.rom: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
     90  1.64     lukem 	${_MKTARGET_LINK}
     91  1.68     lukem 	${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \
     92  1.68     lukem 	    ${STARTFILE} ${OBJS} ${LIBLIST} >${BASE}.list
     93  1.65     lukem 	${OBJCOPY} -O binary ${BASE}.sym ${BASE}.rom.tmp
     94  1.65     lukem 	${GENPROM} ${ROM_SIZE} < ${BASE}.rom.tmp > ${BASE}.rom || \
     95  1.83     joerg 	    ( rm -f ${BASE}.rom && false )
     96  1.65     lukem 	rm -f ${BASE}.rom.tmp
     97   1.9  drochner 
     98  1.32   thorpej CLEANFILES+= ${BASE}.com
     99  1.32   thorpej ${BASE}.com: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
    100  1.64     lukem 	${_MKTARGET_LINK}
    101  1.68     lukem 	${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \
    102  1.68     lukem 	    ${STARTFILE} ${OBJS} ${LIBLIST} >${BASE}.list
    103  1.32   thorpej 	${OBJCOPY} -O binary ${BASE}.sym ${BASE}.com
    104  1.32   thorpej 
    105  1.32   thorpej CLEANFILES+= ${BASE}.bin
    106  1.32   thorpej ${BASE}.bin: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
    107  1.64     lukem 	${_MKTARGET_LINK}
    108  1.68     lukem 	${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \
    109  1.68     lukem 	    ${STARTFILE} ${OBJS} ${LIBLIST} > ${BASE}.list
    110  1.32   thorpej 	${OBJCOPY} -O binary ${BASE}.sym ${BASE}.bin
    111   1.9  drochner 
    112  1.96     lukem CWARNFLAGS.gcc+=	${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
    113  1.94       mrg 
    114   1.9  drochner .include <bsd.prog.mk>
    115  1.88      matt KLINK_MACHINE=	i386
    116  1.87      matt .include <bsd.klinks.mk>
    117