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 70PC= pc 71PFLAGS= 72COMPILE.p= ${PC} ${PFLAGS} ${CPPFLAGS} -c 73LINK.p= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS} 74 75SHELL= sh 76 77YACC= yacc 78YFLAGS= -d 79YACC.y= ${YACC} ${YFLAGS} 80 81# C 82.c: 83 ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 84.c.o: 85 ${COMPILE.c} ${.IMPSRC} 86.c.a: 87 ${COMPILE.c} ${.IMPSRC} 88 ${AR} ${ARFLAGS} $@ $*.o 89 rm -f $*.o 90 91# C++ 92${CXX_SUFFIXES}: 93 ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 94${CXX_SUFFIXES:%=%.o}: 95 ${COMPILE.cc} ${.IMPSRC} 96${CXX_SUFFIXES:%=%.a}: 97 ${COMPILE.cc} ${.IMPSRC} 98 ${AR} ${ARFLAGS} $@ $*.o 99 rm -f $*.o 100 101# Fortran/Ratfor 102.f: 103 ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 104.f.o: 105 ${COMPILE.f} ${.IMPSRC} 106.f.a: 107 ${COMPILE.f} ${.IMPSRC} 108 ${AR} ${ARFLAGS} $@ $*.o 109 rm -f $*.o 110 111.F: 112 ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 113.F.o: 114 ${COMPILE.F} ${.IMPSRC} 115.F.a: 116 ${COMPILE.F} ${.IMPSRC} 117 ${AR} ${ARFLAGS} $@ $*.o 118 rm -f $*.o 119 120.r: 121 ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 122.r.o: 123 ${COMPILE.r} ${.IMPSRC} 124.r.a: 125 ${COMPILE.r} ${.IMPSRC} 126 ${AR} ${ARFLAGS} $@ $*.o 127 rm -f $*.o 128 129# Pascal 130.p: 131 ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 132.p.o: 133 ${COMPILE.p} ${.IMPSRC} 134.p.a: 135 ${COMPILE.p} ${.IMPSRC} 136 ${AR} ${ARFLAGS} $@ $*.o 137 rm -f $*.o 138 139# Assembly 140.s: 141 ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 142.s.o: 143 ${COMPILE.s} -o ${.TARGET} ${.IMPSRC} 144.s.a: 145 ${COMPILE.s} ${.IMPSRC} 146 ${AR} ${ARFLAGS} $@ $*.o 147 rm -f $*.o 148.S: 149 ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 150.S.o: 151 ${COMPILE.S} ${.IMPSRC} 152.S.a: 153 ${COMPILE.S} ${.IMPSRC} 154 ${AR} ${ARFLAGS} $@ $*.o 155 rm -f $*.o 156 157# Lex 158.l: 159 ${LEX.l} ${.IMPSRC} 160 ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll 161 rm -f lex.yy.c 162.l.c: 163 ${LEX.l} ${.IMPSRC} 164 mv lex.yy.c ${.TARGET} 165.l.o: 166 ${LEX.l} ${.IMPSRC} 167 ${COMPILE.c} -o ${.TARGET} lex.yy.c 168 rm -f lex.yy.c 169 170# Yacc 171.y: 172 ${YACC.y} ${.IMPSRC} 173 ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS} 174 rm -f y.tab.c 175.y.c: 176 ${YACC.y} ${.IMPSRC} 177 mv y.tab.c ${.TARGET} 178.y.o: 179 ${YACC.y} ${.IMPSRC} 180 ${COMPILE.c} -o ${.TARGET} y.tab.c 181 rm -f y.tab.c 182 183# Shell 184.sh: 185 rm -f ${.TARGET} 186 cp ${.IMPSRC} ${.TARGET} 187