1# $NetBSD: sys.mk,v 1.19.2.1 1994/07/26 19:58:31 cgd Exp $ 2# @(#)sys.mk 5.11 (Berkeley) 3/13/91 3 4OS= AIX 5unix= We run ${OS}. 6ROOT_GROUP= system 7 8# This needs a lot of work yet... 9 10NOPIC=no # no shared libs? 11 12.SUFFIXES: .out .a .ln .o .c ${CXX_SUFFIXES} .F .f .r .y .l .s .S .cl .p .h .sh .m4 13 14.LIBS: .a 15 16AR= ar 17ARFLAGS= rl 18RANLIB= ranlib 19 20AS= as 21AFLAGS= 22COMPILE.s= ${AS} ${AFLAGS} 23LINK.s= ${CC} ${AFLAGS} ${LDFLAGS} 24COMPILE.S= ${CC} ${AFLAGS} ${CPPFLAGS} -c 25LINK.S= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS} 26.if exists(/usr/local/bin/gcc) 27CC= gcc 28DBG= -O -g 29STATIC?= -static 30.else 31CC= cc 32DBG= -g 33STATIC= 34.endif 35CFLAGS= ${DBG} 36COMPILE.c= ${CC} ${CFLAGS} ${CPPFLAGS} -c 37LINK.c= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} 38 39CXX= g++ 40CXXFLAGS= ${CFLAGS} 41COMPILE.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c 42LINK.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS} 43 44CPP= cpp 45.if defined(DESTDIR) 46CPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include 47.endif 48 49MK_DEP= mkdeps.sh -N 50FC= f77 51FFLAGS= -O 52RFLAGS= 53COMPILE.f= ${FC} ${FFLAGS} -c 54LINK.f= ${FC} ${FFLAGS} ${LDFLAGS} 55COMPILE.F= ${FC} ${FFLAGS} ${CPPFLAGS} -c 56LINK.F= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS} 57COMPILE.r= ${FC} ${FFLAGS} ${RFLAGS} -c 58LINK.r= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS} 59 60LEX= lex 61LFLAGS= 62LEX.l= ${LEX} ${LFLAGS} 63 64LD= ld 65LDFLAGS= 66 67LINT= lint 68LINTFLAGS= -chapbx 69 70MAKE= bmake 71 72PC= pc 73PFLAGS= 74COMPILE.p= ${PC} ${PFLAGS} ${CPPFLAGS} -c 75LINK.p= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS} 76 77SHELL= sh 78 79YACC= yacc 80YFLAGS= -d 81YACC.y= ${YACC} ${YFLAGS} 82 83# C 84.c: 85 ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 86.c.o: 87 ${COMPILE.c} ${.IMPSRC} 88.c.a: 89 ${COMPILE.c} ${.IMPSRC} 90 ${AR} ${ARFLAGS} $@ $*.o 91 rm -f $*.o 92 93# C++ 94${CXX_SUFFIXES}: 95 ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 96${CXX_SUFFIXES:%=%.o}: 97 ${COMPILE.cc} ${.IMPSRC} 98${CXX_SUFFIXES:%=%.a}: 99 ${COMPILE.cc} ${.IMPSRC} 100 ${AR} ${ARFLAGS} $@ $*.o 101 rm -f $*.o 102 103# Fortran/Ratfor 104.f: 105 ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 106.f.o: 107 ${COMPILE.f} ${.IMPSRC} 108.f.a: 109 ${COMPILE.f} ${.IMPSRC} 110 ${AR} ${ARFLAGS} $@ $*.o 111 rm -f $*.o 112 113.F: 114 ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 115.F.o: 116 ${COMPILE.F} ${.IMPSRC} 117.F.a: 118 ${COMPILE.F} ${.IMPSRC} 119 ${AR} ${ARFLAGS} $@ $*.o 120 rm -f $*.o 121 122.r: 123 ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 124.r.o: 125 ${COMPILE.r} ${.IMPSRC} 126.r.a: 127 ${COMPILE.r} ${.IMPSRC} 128 ${AR} ${ARFLAGS} $@ $*.o 129 rm -f $*.o 130 131# Pascal 132.p: 133 ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 134.p.o: 135 ${COMPILE.p} ${.IMPSRC} 136.p.a: 137 ${COMPILE.p} ${.IMPSRC} 138 ${AR} ${ARFLAGS} $@ $*.o 139 rm -f $*.o 140 141# Assembly 142.s: 143 ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 144.s.o: 145 ${COMPILE.s} -o ${.TARGET} ${.IMPSRC} 146.s.a: 147 ${COMPILE.s} ${.IMPSRC} 148 ${AR} ${ARFLAGS} $@ $*.o 149 rm -f $*.o 150.S: 151 ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 152.S.o: 153 ${COMPILE.S} ${.IMPSRC} 154.S.a: 155 ${COMPILE.S} ${.IMPSRC} 156 ${AR} ${ARFLAGS} $@ $*.o 157 rm -f $*.o 158 159# Lex 160.l: 161 ${LEX.l} ${.IMPSRC} 162 ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll 163 rm -f lex.yy.c 164.l.c: 165 ${LEX.l} ${.IMPSRC} 166 mv lex.yy.c ${.TARGET} 167.l.o: 168 ${LEX.l} ${.IMPSRC} 169 ${COMPILE.c} -o ${.TARGET} lex.yy.c 170 rm -f lex.yy.c 171 172# Yacc 173.y: 174 ${YACC.y} ${.IMPSRC} 175 ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS} 176 rm -f y.tab.c 177.y.c: 178 ${YACC.y} ${.IMPSRC} 179 mv y.tab.c ${.TARGET} 180.y.o: 181 ${YACC.y} ${.IMPSRC} 182 ${COMPILE.c} -o ${.TARGET} y.tab.c 183 rm -f y.tab.c 184 185# Shell 186.sh: 187 rm -f ${.TARGET} 188 cp ${.IMPSRC} ${.TARGET} 189