15f1e34d9SAlexandre Perrin# $NetBSD: sys.mk,v 1.19.2.1 1994/07/26 19:58:31 cgd Exp $ 25f1e34d9SAlexandre Perrin# @(#)sys.mk 5.11 (Berkeley) 3/13/91 35f1e34d9SAlexandre Perrin 4ca58f742SDaniel FojtOS ?= AIX 5ca58f742SDaniel Fojtunix ?= We run ${OS}. 6ca58f742SDaniel FojtROOT_GROUP ?= system 75f1e34d9SAlexandre Perrin 85f1e34d9SAlexandre Perrin# This needs a lot of work yet... 95f1e34d9SAlexandre Perrin 10ca58f742SDaniel FojtNOPIC ?=no # no shared libs? 115f1e34d9SAlexandre Perrin 12f445c897SJohn Marino.SUFFIXES: .out .a .ln .o .c ${CXX_SUFFIXES} .F .f .r .y .l .s .S .cl .p .h .sh .m4 135f1e34d9SAlexandre Perrin 145f1e34d9SAlexandre Perrin.LIBS: .a 155f1e34d9SAlexandre Perrin 16ca58f742SDaniel FojtAR ?= ar 17*6eef5f0cSAntonio Huete JimenezARFLAGS ?= r 18ca58f742SDaniel FojtRANLIB ?= ranlib 195f1e34d9SAlexandre Perrin 20ca58f742SDaniel FojtAS ?= as 215f1e34d9SAlexandre PerrinAFLAGS= 22ca58f742SDaniel FojtCOMPILE.s ?= ${AS} ${AFLAGS} 23ca58f742SDaniel FojtLINK.s ?= ${CC} ${AFLAGS} ${LDFLAGS} 24ca58f742SDaniel FojtCOMPILE.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} -c 25ca58f742SDaniel FojtLINK.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS} 265f1e34d9SAlexandre Perrin.if exists(/usr/local/bin/gcc) 27ca58f742SDaniel FojtCC ?= gcc 28ca58f742SDaniel FojtDBG ?= -O -g 295f1e34d9SAlexandre PerrinSTATIC ?= -static 305f1e34d9SAlexandre Perrin.else 31ca58f742SDaniel FojtCC ?= cc 32ca58f742SDaniel FojtDBG ?= -g 33ca58f742SDaniel FojtSTATIC ?= 345f1e34d9SAlexandre Perrin.endif 35ca58f742SDaniel FojtCFLAGS ?= ${DBG} 36ca58f742SDaniel FojtCOMPILE.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} -c 37ca58f742SDaniel FojtLINK.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} 385f1e34d9SAlexandre Perrin 39ca58f742SDaniel FojtCXX ?= g++ 40ca58f742SDaniel FojtCXXFLAGS ?= ${CFLAGS} 41ca58f742SDaniel FojtCOMPILE.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c 42ca58f742SDaniel FojtLINK.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS} 435f1e34d9SAlexandre Perrin 44ca58f742SDaniel FojtCPP ?= cpp 455f1e34d9SAlexandre Perrin.if defined(DESTDIR) 465f1e34d9SAlexandre PerrinCPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include 475f1e34d9SAlexandre Perrin.endif 485f1e34d9SAlexandre Perrin 49ca58f742SDaniel FojtMK_DEP ?= mkdeps.sh -N 50ca58f742SDaniel FojtFC ?= f77 51ca58f742SDaniel FojtFFLAGS ?= -O 525f1e34d9SAlexandre PerrinRFLAGS= 53ca58f742SDaniel FojtCOMPILE.f ?= ${FC} ${FFLAGS} -c 54ca58f742SDaniel FojtLINK.f ?= ${FC} ${FFLAGS} ${LDFLAGS} 55ca58f742SDaniel FojtCOMPILE.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} -c 56ca58f742SDaniel FojtLINK.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS} 57ca58f742SDaniel FojtCOMPILE.r ?= ${FC} ${FFLAGS} ${RFLAGS} -c 58ca58f742SDaniel FojtLINK.r ?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS} 595f1e34d9SAlexandre Perrin 60ca58f742SDaniel FojtLEX ?= lex 615f1e34d9SAlexandre PerrinLFLAGS= 62ca58f742SDaniel FojtLEX.l ?= ${LEX} ${LFLAGS} 635f1e34d9SAlexandre Perrin 64ca58f742SDaniel FojtLD ?= ld 655f1e34d9SAlexandre PerrinLDFLAGS= 665f1e34d9SAlexandre Perrin 67ca58f742SDaniel FojtLINT ?= lint 68ca58f742SDaniel FojtLINTFLAGS ?= -chapbx 695f1e34d9SAlexandre Perrin 70ca58f742SDaniel FojtPC ?= pc 715f1e34d9SAlexandre PerrinPFLAGS= 72ca58f742SDaniel FojtCOMPILE.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} -c 73ca58f742SDaniel FojtLINK.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS} 745f1e34d9SAlexandre Perrin 75ca58f742SDaniel FojtYACC ?= yacc 76ca58f742SDaniel FojtYFLAGS ?= -d 77ca58f742SDaniel FojtYACC.y ?= ${YACC} ${YFLAGS} 785f1e34d9SAlexandre Perrin 795f1e34d9SAlexandre Perrin# C 805f1e34d9SAlexandre Perrin.c: 815f1e34d9SAlexandre Perrin ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 825f1e34d9SAlexandre Perrin.c.o: 835f1e34d9SAlexandre Perrin ${COMPILE.c} ${.IMPSRC} 845f1e34d9SAlexandre Perrin.c.a: 855f1e34d9SAlexandre Perrin ${COMPILE.c} ${.IMPSRC} 865f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 875f1e34d9SAlexandre Perrin rm -f $*.o 885f1e34d9SAlexandre Perrin 895f1e34d9SAlexandre Perrin# C++ 90f445c897SJohn Marino${CXX_SUFFIXES}: 915f1e34d9SAlexandre Perrin ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 92f445c897SJohn Marino${CXX_SUFFIXES:%=%.o}: 935f1e34d9SAlexandre Perrin ${COMPILE.cc} ${.IMPSRC} 94f445c897SJohn Marino${CXX_SUFFIXES:%=%.a}: 955f1e34d9SAlexandre Perrin ${COMPILE.cc} ${.IMPSRC} 965f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 975f1e34d9SAlexandre Perrin rm -f $*.o 985f1e34d9SAlexandre Perrin 995f1e34d9SAlexandre Perrin# Fortran/Ratfor 1005f1e34d9SAlexandre Perrin.f: 1015f1e34d9SAlexandre Perrin ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 1025f1e34d9SAlexandre Perrin.f.o: 1035f1e34d9SAlexandre Perrin ${COMPILE.f} ${.IMPSRC} 1045f1e34d9SAlexandre Perrin.f.a: 1055f1e34d9SAlexandre Perrin ${COMPILE.f} ${.IMPSRC} 1065f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1075f1e34d9SAlexandre Perrin rm -f $*.o 1085f1e34d9SAlexandre Perrin 1095f1e34d9SAlexandre Perrin.F: 1105f1e34d9SAlexandre Perrin ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 1115f1e34d9SAlexandre Perrin.F.o: 1125f1e34d9SAlexandre Perrin ${COMPILE.F} ${.IMPSRC} 1135f1e34d9SAlexandre Perrin.F.a: 1145f1e34d9SAlexandre Perrin ${COMPILE.F} ${.IMPSRC} 1155f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1165f1e34d9SAlexandre Perrin rm -f $*.o 1175f1e34d9SAlexandre Perrin 1185f1e34d9SAlexandre Perrin.r: 1195f1e34d9SAlexandre Perrin ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 1205f1e34d9SAlexandre Perrin.r.o: 1215f1e34d9SAlexandre Perrin ${COMPILE.r} ${.IMPSRC} 1225f1e34d9SAlexandre Perrin.r.a: 1235f1e34d9SAlexandre Perrin ${COMPILE.r} ${.IMPSRC} 1245f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1255f1e34d9SAlexandre Perrin rm -f $*.o 1265f1e34d9SAlexandre Perrin 1275f1e34d9SAlexandre Perrin# Pascal 1285f1e34d9SAlexandre Perrin.p: 1295f1e34d9SAlexandre Perrin ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 1305f1e34d9SAlexandre Perrin.p.o: 1315f1e34d9SAlexandre Perrin ${COMPILE.p} ${.IMPSRC} 1325f1e34d9SAlexandre Perrin.p.a: 1335f1e34d9SAlexandre Perrin ${COMPILE.p} ${.IMPSRC} 1345f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1355f1e34d9SAlexandre Perrin rm -f $*.o 1365f1e34d9SAlexandre Perrin 1375f1e34d9SAlexandre Perrin# Assembly 1385f1e34d9SAlexandre Perrin.s: 1395f1e34d9SAlexandre Perrin ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 1405f1e34d9SAlexandre Perrin.s.o: 1415f1e34d9SAlexandre Perrin ${COMPILE.s} -o ${.TARGET} ${.IMPSRC} 1425f1e34d9SAlexandre Perrin.s.a: 1435f1e34d9SAlexandre Perrin ${COMPILE.s} ${.IMPSRC} 1445f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1455f1e34d9SAlexandre Perrin rm -f $*.o 1465f1e34d9SAlexandre Perrin.S: 1475f1e34d9SAlexandre Perrin ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 1485f1e34d9SAlexandre Perrin.S.o: 1495f1e34d9SAlexandre Perrin ${COMPILE.S} ${.IMPSRC} 1505f1e34d9SAlexandre Perrin.S.a: 1515f1e34d9SAlexandre Perrin ${COMPILE.S} ${.IMPSRC} 1525f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1535f1e34d9SAlexandre Perrin rm -f $*.o 1545f1e34d9SAlexandre Perrin 1555f1e34d9SAlexandre Perrin# Lex 1565f1e34d9SAlexandre Perrin.l: 1575f1e34d9SAlexandre Perrin ${LEX.l} ${.IMPSRC} 1585f1e34d9SAlexandre Perrin ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll 1595f1e34d9SAlexandre Perrin rm -f lex.yy.c 1605f1e34d9SAlexandre Perrin.l.c: 1615f1e34d9SAlexandre Perrin ${LEX.l} ${.IMPSRC} 1625f1e34d9SAlexandre Perrin mv lex.yy.c ${.TARGET} 1635f1e34d9SAlexandre Perrin.l.o: 1645f1e34d9SAlexandre Perrin ${LEX.l} ${.IMPSRC} 1655f1e34d9SAlexandre Perrin ${COMPILE.c} -o ${.TARGET} lex.yy.c 1665f1e34d9SAlexandre Perrin rm -f lex.yy.c 1675f1e34d9SAlexandre Perrin 1685f1e34d9SAlexandre Perrin# Yacc 1695f1e34d9SAlexandre Perrin.y: 1705f1e34d9SAlexandre Perrin ${YACC.y} ${.IMPSRC} 1715f1e34d9SAlexandre Perrin ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS} 1725f1e34d9SAlexandre Perrin rm -f y.tab.c 1735f1e34d9SAlexandre Perrin.y.c: 1745f1e34d9SAlexandre Perrin ${YACC.y} ${.IMPSRC} 1755f1e34d9SAlexandre Perrin mv y.tab.c ${.TARGET} 1765f1e34d9SAlexandre Perrin.y.o: 1775f1e34d9SAlexandre Perrin ${YACC.y} ${.IMPSRC} 1785f1e34d9SAlexandre Perrin ${COMPILE.c} -o ${.TARGET} y.tab.c 1795f1e34d9SAlexandre Perrin rm -f y.tab.c 1805f1e34d9SAlexandre Perrin 1815f1e34d9SAlexandre Perrin# Shell 1825f1e34d9SAlexandre Perrin.sh: 1835f1e34d9SAlexandre Perrin rm -f ${.TARGET} 1845f1e34d9SAlexandre Perrin cp ${.IMPSRC} ${.TARGET} 185*6eef5f0cSAntonio Huete Jimenez chmod a+x ${.TARGET} 186