| @@ -1,64 +1,48 @@ | | | @@ -1,64 +1,48 @@ |
1 | # $NetBSD: Makefile.inc,v 1.14 2009/01/12 07:00:59 tsutsui Exp $ | | 1 | # $NetBSD: Makefile.inc,v 1.15 2009/03/15 14:08:17 tsutsui Exp $ |
2 | | | 2 | |
3 | # Must have S=/usr/src/sys (or equivalent) | | 3 | # Must have S=/usr/src/sys (or equivalent) |
4 | # But note: this is w.r.t. a subdirectory | | 4 | # But note: this is w.r.t. a subdirectory |
5 | S= ${.CURDIR}/../../../.. | | 5 | S= ${.CURDIR}/../../../.. |
6 | | | 6 | |
7 | .if defined(SA_PROG) | | 7 | .if defined(SA_PROG) |
8 | | | 8 | |
9 | .include <bsd.own.mk> | | 9 | .include <bsd.own.mk> |
10 | | | 10 | |
11 | LIBSA!=cd ${.CURDIR}/../libsa && ${PRINTOBJDIR} | | 11 | LIBSA!=cd ${.CURDIR}/../libsa && ${PRINTOBJDIR} |
12 | | | 12 | |
13 | MDEC_DIR?=/usr/mdec | | 13 | MDEC_DIR?=/usr/mdec |
14 | | | 14 | |
15 | RELOC?= 240000 | | 15 | RELOC?= 240000 |
16 | DEFS?= -Dsun3 -D_STANDALONE -D__daddr_t=int32_t | | 16 | DEFS?= -Dsun3 -D_STANDALONE -D__daddr_t=int32_t |
17 | INCL?= -I. -I${.CURDIR} -I${.CURDIR}/../libsa -I${S}/lib/libsa -I${S} | | 17 | INCL?= -I. -I${.CURDIR} -I${.CURDIR}/../libsa -I${S}/lib/libsa -I${S} |
18 | | | 18 | |
19 | CPUFLAGS= -mc68000 -Wa,-mc68010 | | 19 | CPUFLAGS= -mc68000 -Wa,-mc68010 |
20 | COPTS= -Os -fno-defer-pop -ffreestanding | | 20 | COPTS= -Os -fno-defer-pop -ffreestanding |
21 | CFLAGS= -msoft-float | | 21 | CFLAGS= -msoft-float |
22 | CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith | | 22 | CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith |
23 | CPPFLAGS= ${DEFS} ${DEBUG} ${INCL} | | 23 | CPPFLAGS= ${DEFS} ${DEBUG} ${INCL} |
24 | | | 24 | |
25 | SRTOBJ= ${LIBSA}/SRT0.o ${LIBSA}/SRT1.o | | 25 | SRTOBJ= ${LIBSA}/SRT0.o ${LIBSA}/SRT1.o |
26 | SRTLIB= ${LIBSA}/libsa.a | | 26 | SRTLIB= ${LIBSA}/libsa.a |
27 | | | 27 | |
28 | CLEANFILES+= ${SA_PROG} ${SA_PROG}.bin | | 28 | CLEANFILES+= ${SA_PROG} ${SA_PROG}.bin |
29 | | | 29 | |
30 | # Make a copy of the executable with its ELF headers removed. | | 30 | # Make a copy of the executable with its ELF headers removed. |
31 | ${SA_PROG}.bin : ${SA_PROG} | | 31 | ${SA_PROG}.bin : ${SA_PROG} |
32 | ${OBJCOPY} --output-target=binary ${SA_PROG} $@ | | 32 | ${OBJCOPY} --output-target=binary ${SA_PROG} $@ |
33 | | | 33 | |
34 | ${SA_PROG} : ${OBJS} ${DPADD} ${SRTLIB} | | 34 | ${SA_PROG} : ${OBJS} ${DPADD} ${SRTLIB} |
35 | ${LD} -N -Ttext ${RELOC} -e start ${SA_LDFLAGS} -o $@ \ | | 35 | ${LD} -N -Ttext ${RELOC} -e start ${SA_LDFLAGS} -o $@ \ |
36 | ${SRTOBJ} ${OBJS} ${LDADD} ${SRTLIB} | | 36 | ${SRTOBJ} ${OBJS} ${LDADD} ${SRTLIB} |
37 | @${SIZE} $@ | | 37 | @${SIZE} $@ |
38 | | | 38 | |
39 | .if !target(proginstall) | | 39 | .if !target(proginstall) |
40 | realall: ${SA_PROG} ${SA_PROG}.bin | | 40 | realall: ${SA_PROG} ${SA_PROG}.bin |
41 | proginstall: ${SA_PROG}.bin | | 41 | proginstall: ${SA_PROG}.bin |
42 | ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ | | 42 | ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ |
43 | ${SA_PROG}.bin ${DESTDIR}${MDEC_DIR}/${SA_PROG} | | 43 | ${SA_PROG}.bin ${DESTDIR}${MDEC_DIR}/${SA_PROG} |
44 | .endif | | 44 | .endif |
45 | | | 45 | |
46 | .endif # defined(SA_PROG) | | 46 | .endif # defined(SA_PROG) |
47 | | | 47 | |
48 | CLEANFILES+= machine m68k sun68k | | 48 | .include <bsd.klinks.mk> |
49 | .if !make(obj) && !make(clean) && !make(cleandir) | | | |
50 | .BEGIN: machine m68k sun68k | | | |
51 | .NOPATH: machine m68k sun68k | | | |
52 | .endif | | | |
53 | | | | |
54 | machine : | | | |
55 | -rm -f $@ | | | |
56 | ln -s ${S}/arch/${MACHINE}/include $@ | | | |
57 | | | | |
58 | m68k : | | | |
59 | -rm -f $@ | | | |
60 | ln -s ${S}/arch/m68k/include $@ | | | |
61 | | | | |
62 | sun68k : | | | |
63 | -rm -f $@ | | | |
64 | ln -s ${S}/arch/sun68k/include $@ | | | |