Home | History | Annotate | Line # | Download | only in stand
Makefile.inc revision 1.1
      1 #	$NetBSD: Makefile.inc,v 1.1 2001/06/14 12:57:12 fredette Exp $
      2 
      3 # Must have S=/usr/src/sys (or equivalent)
      4 # But note: this is w.r.t. a subdirectory
      5 S=	${.CURDIR}/../../../..
      6 
      7 .if defined(SA_PROG)
      8 
      9 .include <bsd.own.mk>
     10 
     11 LIBSA!=cd ${.CURDIR}/../libsa && ${PRINTOBJDIR}
     12 
     13 MDEC_DIR?=/usr/mdec
     14 
     15 RELOC?= 240000
     16 DEFS?= -Dsun3 -D_STANDALONE
     17 INCL?= -I. -I${.CURDIR} -I${.CURDIR}/../libsa -I${S}/lib/libsa -I${S}
     18 
     19 CFLAGS= -Os -msoft-float -fno-defer-pop
     20 CPPFLAGS= ${DEFS} ${DBG} ${INCL}
     21 
     22 SRTOBJ= ${LIBSA}/SRT0.o ${LIBSA}/SRT1.o
     23 SRTLIB= ${LIBSA}/libsa.a
     24 
     25 CLEANFILES+= ${SA_PROG} ${SA_PROG}.bin
     26 
     27 # Make a copy of the executable with its ELF headers removed.
     28 ${SA_PROG}.bin : ${SA_PROG}
     29 	${OBJCOPY} --output-target=binary ${SA_PROG} $@
     30 
     31 ${SA_PROG} : ${OBJS} ${DPADD} ${SRTLIB}
     32 	${LD} -N -Ttext ${RELOC} -e start -o $@ \
     33 	  ${SRTOBJ} ${OBJS} ${LDADD} ${SRTLIB}
     34 	@${SIZE} $@
     35 
     36 .if !target(proginstall)
     37 realall: ${SA_PROG} ${SA_PROG}.bin
     38 proginstall: ${SA_PROG}.bin
     39 	${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
     40 	  ${SA_PROG}.bin ${DESTDIR}${MDEC_DIR}/${SA_PROG}
     41 .endif
     42 
     43 .endif	# defined(SA_PROG)
     44 
     45 CLEANFILES+= machine m68k sun68k
     46 .BEGIN: machine m68k sun68k
     47 .NOPATH: machine m68k sun68k
     48 realall realdepend: machine m68k sun68k
     49 
     50 machine :
     51 	-rm -f $@
     52 	ln -s ${S}/arch/sun68k/include $@
     53 
     54 m68k :
     55 	-rm -f $@
     56 	ln -s ${S}/arch/m68k/include $@
     57 
     58 sun68k :
     59 	-rm -f $@
     60 	ln -s ${S}/arch/sun68k $@
     61