2011-01-21 18:59:04 +03:00
|
|
|
# $NetBSD: sys.mk,v 1.104 2011/01/21 15:59:04 joerg Exp $
|
1997-03-29 11:02:45 +03:00
|
|
|
# @(#)sys.mk 8.2 (Berkeley) 3/21/94
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1997-03-29 11:02:45 +03:00
|
|
|
unix?= We run NetBSD.
|
1993-03-21 12:45:37 +03:00
|
|
|
|
2003-11-09 02:14:45 +03:00
|
|
|
.SUFFIXES: .a .o .ln .s .S .c .cc .cpp .cxx .C .f .F .r .p .l .y .sh
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
.LIBS: .a
|
|
|
|
|
1995-09-25 02:49:06 +03:00
|
|
|
AR?= ar
|
|
|
|
ARFLAGS?= rl
|
|
|
|
RANLIB?= ranlib
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1995-09-25 02:49:06 +03:00
|
|
|
AS?= as
|
|
|
|
AFLAGS?=
|
1996-04-10 09:44:49 +04:00
|
|
|
COMPILE.s?= ${CC} ${AFLAGS} -c
|
1995-09-25 02:49:06 +03:00
|
|
|
LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
|
2011-01-13 02:12:10 +03:00
|
|
|
_ASM_TRADITIONAL_CPP= -x assembler-with-cpp
|
|
|
|
COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${_ASM_TRADITIONAL_CPP} -c
|
1995-09-25 02:49:06 +03:00
|
|
|
LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
|
1994-07-06 08:12:24 +04:00
|
|
|
|
1995-09-25 02:49:06 +03:00
|
|
|
CC?= cc
|
1999-03-10 17:06:14 +03:00
|
|
|
.if ${MACHINE_ARCH} == "alpha" || \
|
2002-04-08 16:25:22 +04:00
|
|
|
${MACHINE_ARCH} == "arm" || \
|
2003-05-04 16:05:50 +04:00
|
|
|
${MACHINE_ARCH} == "x86_64" || \
|
2002-06-05 01:13:21 +04:00
|
|
|
${MACHINE_ARCH} == "armeb" || \
|
2004-08-08 01:43:18 +04:00
|
|
|
${MACHINE_ARCH} == "hppa" || \
|
1999-02-12 04:10:06 +03:00
|
|
|
${MACHINE_ARCH} == "i386" || \
|
|
|
|
${MACHINE_ARCH} == "m68k" || \
|
1999-02-24 17:42:36 +03:00
|
|
|
${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
|
2006-08-26 23:57:03 +04:00
|
|
|
${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb" || \
|
2001-09-17 16:28:14 +04:00
|
|
|
${MACHINE_ARCH} == "powerpc" || \
|
1999-11-15 09:14:23 +03:00
|
|
|
${MACHINE_ARCH} == "sparc" || \
|
2007-04-16 02:53:08 +04:00
|
|
|
${MACHINE_ARCH} == "sparc64"
|
2000-05-02 07:44:36 +04:00
|
|
|
DBG?= -O2
|
2008-05-07 02:19:11 +04:00
|
|
|
.elif ${MACHINE_ARCH} == "sh3el" || ${MACHINE_ARCH} == "sh3eb"
|
|
|
|
# -O2 is too -falign-* zealous for low-memory sh3 machines
|
|
|
|
DBG?= -Os -freorder-blocks
|
2007-04-16 02:53:08 +04:00
|
|
|
.elif ${MACHINE_ARCH} == "vax"
|
|
|
|
DBG?= -O1 -fgcse -fstrength-reduce -fgcse-after-reload
|
2008-02-09 05:37:21 +03:00
|
|
|
.elif ${MACHINE_ARCH} == "m68000"
|
2008-05-04 19:37:19 +04:00
|
|
|
# see src/doc/HACKS for details
|
|
|
|
DBG?= -O1
|
1998-11-22 16:48:34 +03:00
|
|
|
.else
|
2000-05-02 07:44:36 +04:00
|
|
|
DBG?= -O
|
1998-11-22 16:48:34 +03:00
|
|
|
.endif
|
2000-05-02 07:44:36 +04:00
|
|
|
CFLAGS?= ${DBG}
|
2006-06-25 19:04:31 +04:00
|
|
|
LDFLAGS?=
|
1995-09-25 02:49:06 +03:00
|
|
|
COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
|
|
|
|
LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
|
1993-03-21 12:45:37 +03:00
|
|
|
|
2010-03-02 23:49:18 +03:00
|
|
|
# C Type Format data is required for DTrace
|
|
|
|
# XXX TBD VERSION is not defined
|
|
|
|
CTFFLAGS ?= -L VERSION
|
|
|
|
CTFMFLAGS ?= -t -L VERSION
|
|
|
|
|
|
|
|
.if defined(MKDTRACE) && ${MKDTRACE} != "no"
|
|
|
|
CTFCONVERT ?= ${TOOL_CTFCONVERT}
|
|
|
|
CTFMERGE ?= ${TOOL_CTFMERGE}
|
|
|
|
.if defined(CFLAGS) && (${CFLAGS:M-g} != "")
|
|
|
|
CTFFLAGS += -g
|
|
|
|
CTFMFLAGS += -g
|
|
|
|
.else
|
|
|
|
CFLAGS += -g
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
1998-04-09 04:45:10 +04:00
|
|
|
CXX?= c++
|
2008-09-07 19:54:52 +04:00
|
|
|
CXXFLAGS?= ${CFLAGS:N-Wno-traditional:N-Wstrict-prototypes:N-Wmissing-prototypes:N-Wno-pointer-sign:N-ffreestanding:N-std=gnu99}
|
2007-01-23 00:49:07 +03:00
|
|
|
|
2008-08-04 20:02:25 +04:00
|
|
|
__ALLSRC1= ${empty(DESTDIR):?${.ALLSRC}:${.ALLSRC:S|^${DESTDIR}|^destdir|}}
|
|
|
|
__ALLSRC2= ${empty(MAKEOBJDIR):?${__ALLSRC1}:${__ALLSRC1:S|^${MAKEOBJDIR}|^obj|}}
|
|
|
|
__ALLSRC3= ${empty(NETBSDSRCDIR):?${__ALLSRC2}:${__ALLSRC2:S|^${NETBSDSRCDIR}|^src|}}
|
|
|
|
|
|
|
|
_CXXSEED?= ${BUILDSEED:D-frandom-seed=${BUILDSEED:Q}/${__ALLSRC3:O:Q}/${.TARGET:Q}}
|
|
|
|
|
|
|
|
COMPILE.cc?= ${CXX} ${_CXXSEED} ${CXXFLAGS} ${CPPFLAGS} -c
|
1995-09-25 02:49:06 +03:00
|
|
|
LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
|
1993-06-17 07:48:59 +04:00
|
|
|
|
1997-10-28 15:40:16 +03:00
|
|
|
OBJC?= ${CC}
|
|
|
|
OBJCFLAGS?= ${CFLAGS}
|
|
|
|
COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
|
|
|
|
LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
|
|
|
|
|
1995-09-25 02:49:06 +03:00
|
|
|
CPP?= cpp
|
2003-07-18 08:04:03 +04:00
|
|
|
CPPFLAGS?=
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1995-09-25 02:49:06 +03:00
|
|
|
FC?= f77
|
1997-03-29 11:02:45 +03:00
|
|
|
FFLAGS?= -O
|
1995-09-25 02:49:06 +03:00
|
|
|
RFLAGS?=
|
|
|
|
COMPILE.f?= ${FC} ${FFLAGS} -c
|
|
|
|
LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
|
|
|
|
COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
|
|
|
|
LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
|
|
|
|
COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
|
|
|
|
LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1996-10-18 06:33:38 +04:00
|
|
|
INSTALL?= install
|
|
|
|
|
2003-11-08 08:33:37 +03:00
|
|
|
LD?= ld
|
|
|
|
|
1995-09-25 02:49:06 +03:00
|
|
|
LEX?= lex
|
|
|
|
LFLAGS?=
|
|
|
|
LEX.l?= ${LEX} ${LFLAGS}
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1995-09-25 02:49:06 +03:00
|
|
|
LINT?= lint
|
2005-12-25 21:34:23 +03:00
|
|
|
LINTFLAGS?= -chapbxzFS
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1997-11-05 00:12:41 +03:00
|
|
|
LORDER?= lorder
|
|
|
|
|
1995-09-25 02:49:06 +03:00
|
|
|
MAKE?= make
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1997-11-05 00:12:41 +03:00
|
|
|
NM?= nm
|
|
|
|
|
1995-09-25 02:49:06 +03:00
|
|
|
PC?= pc
|
|
|
|
PFLAGS?=
|
|
|
|
COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
|
|
|
|
LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1995-09-25 02:49:06 +03:00
|
|
|
SHELL?= sh
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1997-11-05 00:12:41 +03:00
|
|
|
SIZE?= size
|
|
|
|
|
|
|
|
TSORT?= tsort -q
|
|
|
|
|
1995-09-25 02:49:06 +03:00
|
|
|
YACC?= yacc
|
1998-04-09 04:32:31 +04:00
|
|
|
YFLAGS?=
|
1995-09-25 02:49:06 +03:00
|
|
|
YACC.y?= ${YACC} ${YFLAGS}
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1994-03-24 19:01:24 +03:00
|
|
|
# C
|
1994-03-24 04:39:28 +03:00
|
|
|
.c:
|
1994-03-24 19:01:24 +03:00
|
|
|
${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
|
2010-03-02 23:49:18 +03:00
|
|
|
.if defined(CTFCONVERT)
|
|
|
|
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
|
|
|
|
.endif
|
1994-03-24 19:01:24 +03:00
|
|
|
.c.o:
|
|
|
|
${COMPILE.c} ${.IMPSRC}
|
2010-03-02 23:49:18 +03:00
|
|
|
.if defined(CTFCONVERT)
|
|
|
|
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
|
|
|
|
.endif
|
1994-03-24 19:01:24 +03:00
|
|
|
.c.a:
|
|
|
|
${COMPILE.c} ${.IMPSRC}
|
2003-07-27 13:35:47 +04:00
|
|
|
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
|
|
|
|
rm -f ${.PREFIX}.o
|
1995-06-24 12:27:37 +04:00
|
|
|
.c.ln:
|
2004-01-27 06:31:48 +03:00
|
|
|
${LINT} ${LINTFLAGS} \
|
|
|
|
${CPPFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
|
|
|
-i ${.IMPSRC}
|
1994-03-24 04:39:28 +03:00
|
|
|
|
1994-03-24 19:01:24 +03:00
|
|
|
# C++
|
1999-11-13 17:53:09 +03:00
|
|
|
.cc .cpp .cxx .C:
|
1994-03-24 19:01:24 +03:00
|
|
|
${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
|
1999-11-13 17:53:09 +03:00
|
|
|
.cc.o .cpp.o .cxx.o .C.o:
|
1994-03-24 19:01:24 +03:00
|
|
|
${COMPILE.cc} ${.IMPSRC}
|
1999-11-13 17:53:09 +03:00
|
|
|
.cc.a .cpp.a .cxx.a .C.a:
|
1994-03-24 19:01:24 +03:00
|
|
|
${COMPILE.cc} ${.IMPSRC}
|
2003-07-27 13:35:47 +04:00
|
|
|
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
|
|
|
|
rm -f ${.PREFIX}.o
|
1993-12-29 21:44:36 +03:00
|
|
|
|
1994-03-24 19:01:24 +03:00
|
|
|
# Fortran/Ratfor
|
|
|
|
.f:
|
|
|
|
${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
|
|
|
|
.f.o:
|
|
|
|
${COMPILE.f} ${.IMPSRC}
|
|
|
|
.f.a:
|
|
|
|
${COMPILE.f} ${.IMPSRC}
|
2003-07-27 13:35:47 +04:00
|
|
|
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
|
|
|
|
rm -f ${.PREFIX}.o
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1994-03-24 19:01:24 +03:00
|
|
|
.F:
|
|
|
|
${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
|
2010-03-02 23:49:18 +03:00
|
|
|
.if defined(CTFCONVERT)
|
|
|
|
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
|
|
|
|
.endif
|
1994-03-24 19:01:24 +03:00
|
|
|
.F.o:
|
|
|
|
${COMPILE.F} ${.IMPSRC}
|
2010-03-02 23:49:18 +03:00
|
|
|
.if defined(CTFCONVERT)
|
|
|
|
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
|
|
|
|
.endif
|
1994-03-24 19:01:24 +03:00
|
|
|
.F.a:
|
|
|
|
${COMPILE.F} ${.IMPSRC}
|
2003-07-27 13:35:47 +04:00
|
|
|
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
|
|
|
|
rm -f ${.PREFIX}.o
|
1993-07-17 16:09:51 +04:00
|
|
|
|
1994-03-24 19:01:24 +03:00
|
|
|
.r:
|
|
|
|
${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
|
|
|
|
.r.o:
|
|
|
|
${COMPILE.r} ${.IMPSRC}
|
|
|
|
.r.a:
|
|
|
|
${COMPILE.r} ${.IMPSRC}
|
2003-07-27 13:35:47 +04:00
|
|
|
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
|
|
|
|
rm -f ${.PREFIX}.o
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1994-03-24 19:01:24 +03:00
|
|
|
# Pascal
|
|
|
|
.p:
|
|
|
|
${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
|
2010-03-02 23:49:18 +03:00
|
|
|
.if defined(CTFCONVERT)
|
|
|
|
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
|
|
|
|
.endif
|
1993-12-29 21:44:36 +03:00
|
|
|
.p.o:
|
1994-03-24 19:01:24 +03:00
|
|
|
${COMPILE.p} ${.IMPSRC}
|
2010-03-02 23:49:18 +03:00
|
|
|
.if defined(CTFCONVERT)
|
|
|
|
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
|
|
|
|
.endif
|
1994-03-24 19:01:24 +03:00
|
|
|
.p.a:
|
|
|
|
${COMPILE.p} ${.IMPSRC}
|
2003-07-27 13:35:47 +04:00
|
|
|
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
|
|
|
|
rm -f ${.PREFIX}.o
|
1993-12-29 21:44:36 +03:00
|
|
|
|
1994-03-24 19:01:24 +03:00
|
|
|
# Assembly
|
|
|
|
.s:
|
|
|
|
${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
|
2010-03-02 23:49:18 +03:00
|
|
|
.if defined(CTFCONVERT)
|
|
|
|
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
|
|
|
|
.endif
|
1993-03-21 12:45:37 +03:00
|
|
|
.s.o:
|
1996-04-10 09:47:19 +04:00
|
|
|
${COMPILE.s} ${.IMPSRC}
|
2010-03-02 23:49:18 +03:00
|
|
|
.if defined(CTFCONVERT)
|
|
|
|
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
|
|
|
|
.endif
|
1994-03-24 19:01:24 +03:00
|
|
|
.s.a:
|
|
|
|
${COMPILE.s} ${.IMPSRC}
|
2003-07-27 13:35:47 +04:00
|
|
|
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
|
|
|
|
rm -f ${.PREFIX}.o
|
1994-03-24 19:01:24 +03:00
|
|
|
.S:
|
|
|
|
${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
|
2010-03-02 23:49:18 +03:00
|
|
|
.if defined(CTFCONVERT)
|
|
|
|
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
|
|
|
|
.endif
|
1993-09-08 17:13:46 +04:00
|
|
|
.S.o:
|
1996-04-10 09:47:19 +04:00
|
|
|
${COMPILE.S} ${.IMPSRC}
|
2010-03-02 23:49:18 +03:00
|
|
|
.if defined(CTFCONVERT)
|
|
|
|
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
|
|
|
|
.endif
|
1994-03-24 19:01:24 +03:00
|
|
|
.S.a:
|
|
|
|
${COMPILE.S} ${.IMPSRC}
|
2003-07-27 13:35:47 +04:00
|
|
|
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
|
|
|
|
rm -f ${.PREFIX}.o
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1994-03-24 19:01:24 +03:00
|
|
|
# Lex
|
|
|
|
.l:
|
|
|
|
${LEX.l} ${.IMPSRC}
|
|
|
|
${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
|
|
|
|
rm -f lex.yy.c
|
|
|
|
.l.c:
|
|
|
|
${LEX.l} ${.IMPSRC}
|
|
|
|
mv lex.yy.c ${.TARGET}
|
1993-03-21 12:45:37 +03:00
|
|
|
.l.o:
|
1994-03-24 19:01:24 +03:00
|
|
|
${LEX.l} ${.IMPSRC}
|
2003-07-18 08:04:03 +04:00
|
|
|
${COMPILE.c} -o ${.TARGET} lex.yy.c
|
1993-03-21 12:45:37 +03:00
|
|
|
rm -f lex.yy.c
|
|
|
|
|
1994-03-24 19:01:24 +03:00
|
|
|
# Yacc
|
|
|
|
.y:
|
|
|
|
${YACC.y} ${.IMPSRC}
|
|
|
|
${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
|
|
|
|
rm -f y.tab.c
|
1993-03-21 12:45:37 +03:00
|
|
|
.y.c:
|
1994-03-24 19:01:24 +03:00
|
|
|
${YACC.y} ${.IMPSRC}
|
1993-03-21 12:45:37 +03:00
|
|
|
mv y.tab.c ${.TARGET}
|
1994-03-24 19:01:24 +03:00
|
|
|
.y.o:
|
|
|
|
${YACC.y} ${.IMPSRC}
|
|
|
|
${COMPILE.c} -o ${.TARGET} y.tab.c
|
1993-03-21 12:45:37 +03:00
|
|
|
rm -f y.tab.c
|
|
|
|
|
1994-03-24 19:01:24 +03:00
|
|
|
# Shell
|
|
|
|
.sh:
|
|
|
|
rm -f ${.TARGET}
|
|
|
|
cp ${.IMPSRC} ${.TARGET}
|
2003-11-08 08:33:37 +03:00
|
|
|
chmod a+x ${.TARGET}
|