15f1e34d9SAlexandre Perrin# $NetBSD: Darwin.sys.mk,v 1.3 2003/02/16 09:44:41 grant Exp $ 25f1e34d9SAlexandre Perrin# @(#)sys.mk 8.2 (Berkeley) 3/21/94 35f1e34d9SAlexandre Perrin 4ca58f742SDaniel FojtOS ?= Darwin 55f1e34d9SAlexandre Perrinunix ?= We run ${OS}. 65f1e34d9SAlexandre Perrin 7ca58f742SDaniel Fojt.SUFFIXES: .out .a .ln .o .s .S .c .m ${CXX_SUFFIXES} .F .f .r .y .l .cl .p .h 85f1e34d9SAlexandre Perrin.SUFFIXES: .sh .m4 .dylib 95f1e34d9SAlexandre Perrin 105f1e34d9SAlexandre Perrin.LIBS: .a .dylib 115f1e34d9SAlexandre Perrin 12ca58f742SDaniel FojtSHLIBEXT ?= .dylib 13ca58f742SDaniel FojtHOST_LIBEXT ?= .dylib 14ca58f742SDaniel FojtDSHLIBEXT ?= .dylib 155f1e34d9SAlexandre Perrin 165f1e34d9SAlexandre PerrinAR ?= ar 17*6eef5f0cSAntonio Huete JimenezARFLAGS ?= r 185f1e34d9SAlexandre PerrinRANLIB = 195f1e34d9SAlexandre Perrin 205f1e34d9SAlexandre PerrinAS ?= as 215f1e34d9SAlexandre PerrinAFLAGS ?= 225f1e34d9SAlexandre PerrinCOMPILE.s ?= ${AS} ${AFLAGS} 235f1e34d9SAlexandre PerrinLINK.s ?= ${CC} ${AFLAGS} ${LDFLAGS} 245f1e34d9SAlexandre PerrinCOMPILE.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} -c 255f1e34d9SAlexandre PerrinLINK.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS} 265f1e34d9SAlexandre Perrin 27ca58f742SDaniel FojtPIPE ?= -pipe 28ca58f742SDaniel Fojt 29ca58f742SDaniel Fojt.if exists(/usr/bin/clang) 30ca58f742SDaniel FojtCC ?= cc ${PIPE} 31ca58f742SDaniel FojtCXX ?= c++ 32ca58f742SDaniel Fojt.elif exists(/usr/bin/gcc) 33ca58f742SDaniel FojtCC ?= gcc ${PIPE} 345f1e34d9SAlexandre Perrin.else 35ca58f742SDaniel FojtCC ?= cc ${PIPE} 365f1e34d9SAlexandre Perrin.endif 375f1e34d9SAlexandre PerrinDBG ?= -O2 385f1e34d9SAlexandre PerrinCFLAGS ?= ${DBG} 395f1e34d9SAlexandre PerrinCOMPILE.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} -c 405f1e34d9SAlexandre PerrinLINK.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} 415f1e34d9SAlexandre Perrin 425f1e34d9SAlexandre Perrin.if exists(/usr/bin/g++) 435f1e34d9SAlexandre PerrinCXX ?= g++ 445f1e34d9SAlexandre Perrin.else 455f1e34d9SAlexandre PerrinCXX ?= c++ 465f1e34d9SAlexandre Perrin.endif 475f1e34d9SAlexandre PerrinCXXFLAGS ?= ${CFLAGS} 485f1e34d9SAlexandre PerrinCOMPILE.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c 495f1e34d9SAlexandre PerrinLINK.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS} 505f1e34d9SAlexandre Perrin 515f1e34d9SAlexandre PerrinOBJC ?= ${CC} 525f1e34d9SAlexandre PerrinOBJCFLAGS ?= ${CFLAGS} 535f1e34d9SAlexandre PerrinCOMPILE.m ?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c 545f1e34d9SAlexandre PerrinLINK.m ?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS} 555f1e34d9SAlexandre Perrin 565f1e34d9SAlexandre PerrinCPP ?= cpp 57ca58f742SDaniel FojtNOLINT ?= 1 585f1e34d9SAlexandre PerrinCPPFLAGS ?= 595f1e34d9SAlexandre Perrin 60ca58f742SDaniel FojtMK_DEP ?= mkdep 615f1e34d9SAlexandre Perrin 625f1e34d9SAlexandre PerrinFC ?= f77 635f1e34d9SAlexandre PerrinFFLAGS ?= -O 645f1e34d9SAlexandre PerrinRFLAGS ?= 655f1e34d9SAlexandre PerrinCOMPILE.f ?= ${FC} ${FFLAGS} -c 665f1e34d9SAlexandre PerrinLINK.f ?= ${FC} ${FFLAGS} ${LDFLAGS} 675f1e34d9SAlexandre PerrinCOMPILE.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} -c 685f1e34d9SAlexandre PerrinLINK.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS} 695f1e34d9SAlexandre PerrinCOMPILE.r ?= ${FC} ${FFLAGS} ${RFLAGS} -c 705f1e34d9SAlexandre PerrinLINK.r ?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS} 715f1e34d9SAlexandre Perrin 725f1e34d9SAlexandre PerrinINSTALL ?= install 735f1e34d9SAlexandre Perrin 745f1e34d9SAlexandre PerrinLEX ?= lex 755f1e34d9SAlexandre PerrinLFLAGS ?= 765f1e34d9SAlexandre PerrinLEX.l ?= ${LEX} ${LFLAGS} 775f1e34d9SAlexandre Perrin 785f1e34d9SAlexandre PerrinLD ?= ld 795f1e34d9SAlexandre PerrinLDFLAGS ?= 805f1e34d9SAlexandre Perrin 81ca58f742SDaniel FojtSHLIB_TEENY ?= 0 82ca58f742SDaniel FojtSHLIB_MINOR ?= 0 835f1e34d9SAlexandre Perrin 84ca58f742SDaniel FojtMKPICLIB ?= no 85ca58f742SDaniel FojtLIBEXT ?= .dylib 865f1e34d9SAlexandre Perrin 875f1e34d9SAlexandre PerrinLINT ?= lint 885f1e34d9SAlexandre PerrinLINTFLAGS ?= -chapbx 895f1e34d9SAlexandre Perrin 905f1e34d9SAlexandre PerrinLORDER ?= lorder 915f1e34d9SAlexandre Perrin 925f1e34d9SAlexandre PerrinNM ?= nm 935f1e34d9SAlexandre Perrin 945f1e34d9SAlexandre PerrinPC ?= pc 955f1e34d9SAlexandre PerrinPFLAGS ?= 965f1e34d9SAlexandre PerrinCOMPILE.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} -c 975f1e34d9SAlexandre PerrinLINK.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS} 985f1e34d9SAlexandre Perrin 995f1e34d9SAlexandre PerrinSIZE ?= size 1005f1e34d9SAlexandre Perrin 1015f1e34d9SAlexandre PerrinTSORT ?= tsort -q 1025f1e34d9SAlexandre Perrin 1035f1e34d9SAlexandre PerrinYACC ?= bison -y 1045f1e34d9SAlexandre PerrinYFLAGS ?= -d 1055f1e34d9SAlexandre PerrinYACC.y ?= ${YACC} ${YFLAGS} 1065f1e34d9SAlexandre Perrin 1075f1e34d9SAlexandre Perrin# C 1085f1e34d9SAlexandre Perrin.c: 1095f1e34d9SAlexandre Perrin ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 1105f1e34d9SAlexandre Perrin.c.o: 1115f1e34d9SAlexandre Perrin ${COMPILE.c} ${.IMPSRC} 1125f1e34d9SAlexandre Perrin.c.a: 1135f1e34d9SAlexandre Perrin ${COMPILE.c} ${.IMPSRC} 1145f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1155f1e34d9SAlexandre Perrin rm -f $*.o 1165f1e34d9SAlexandre Perrin 1175f1e34d9SAlexandre Perrin# C++ 118f445c897SJohn Marino${CXX_SUFFIXES}: 1195f1e34d9SAlexandre Perrin ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 120f445c897SJohn Marino${CXX_SUFFIXES:%=%.o}: 1215f1e34d9SAlexandre Perrin ${COMPILE.cc} ${.IMPSRC} 122f445c897SJohn Marino${CXX_SUFFIXES:%=%.a}: 1235f1e34d9SAlexandre Perrin ${COMPILE.cc} ${.IMPSRC} 1245f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1255f1e34d9SAlexandre Perrin rm -f $*.o 1265f1e34d9SAlexandre Perrin 127ca58f742SDaniel Fojt# Objective-C 128ca58f742SDaniel Fojt.m: 129ca58f742SDaniel Fojt ${LINK.m} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 130ca58f742SDaniel Fojt.m.o: 131ca58f742SDaniel Fojt ${COMPILE.m} ${.IMPSRC} 132ca58f742SDaniel Fojt.m.a: 133ca58f742SDaniel Fojt ${COMPILE.m} ${.IMPSRC} 134ca58f742SDaniel Fojt ${AR} ${ARFLAGS} $@ $*.o 135ca58f742SDaniel Fojt rm -f $*.o 136ca58f742SDaniel Fojt 1375f1e34d9SAlexandre Perrin# Fortran/Ratfor 1385f1e34d9SAlexandre Perrin.f: 1395f1e34d9SAlexandre Perrin ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 1405f1e34d9SAlexandre Perrin.f.o: 1415f1e34d9SAlexandre Perrin ${COMPILE.f} ${.IMPSRC} 1425f1e34d9SAlexandre Perrin.f.a: 1435f1e34d9SAlexandre Perrin ${COMPILE.f} ${.IMPSRC} 1445f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1455f1e34d9SAlexandre Perrin rm -f $*.o 1465f1e34d9SAlexandre Perrin 1475f1e34d9SAlexandre Perrin.F: 1485f1e34d9SAlexandre Perrin ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 1495f1e34d9SAlexandre Perrin.F.o: 1505f1e34d9SAlexandre Perrin ${COMPILE.F} ${.IMPSRC} 1515f1e34d9SAlexandre Perrin.F.a: 1525f1e34d9SAlexandre Perrin ${COMPILE.F} ${.IMPSRC} 1535f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1545f1e34d9SAlexandre Perrin rm -f $*.o 1555f1e34d9SAlexandre Perrin 1565f1e34d9SAlexandre Perrin.r: 1575f1e34d9SAlexandre Perrin ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 1585f1e34d9SAlexandre Perrin.r.o: 1595f1e34d9SAlexandre Perrin ${COMPILE.r} ${.IMPSRC} 1605f1e34d9SAlexandre Perrin.r.a: 1615f1e34d9SAlexandre Perrin ${COMPILE.r} ${.IMPSRC} 1625f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1635f1e34d9SAlexandre Perrin rm -f $*.o 1645f1e34d9SAlexandre Perrin 1655f1e34d9SAlexandre Perrin# Pascal 1665f1e34d9SAlexandre Perrin.p: 1675f1e34d9SAlexandre Perrin ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 1685f1e34d9SAlexandre Perrin.p.o: 1695f1e34d9SAlexandre Perrin ${COMPILE.p} ${.IMPSRC} 1705f1e34d9SAlexandre Perrin.p.a: 1715f1e34d9SAlexandre Perrin ${COMPILE.p} ${.IMPSRC} 1725f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1735f1e34d9SAlexandre Perrin rm -f $*.o 1745f1e34d9SAlexandre Perrin 1755f1e34d9SAlexandre Perrin# Assembly 1765f1e34d9SAlexandre Perrin.s: 1775f1e34d9SAlexandre Perrin ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 1785f1e34d9SAlexandre Perrin.s.o: 1795f1e34d9SAlexandre Perrin ${COMPILE.s} -o ${.TARGET} ${.IMPSRC} 1805f1e34d9SAlexandre Perrin.s.a: 1815f1e34d9SAlexandre Perrin ${COMPILE.s} ${.IMPSRC} 1825f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1835f1e34d9SAlexandre Perrin rm -f $*.o 1845f1e34d9SAlexandre Perrin.S: 1855f1e34d9SAlexandre Perrin ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 1865f1e34d9SAlexandre Perrin.S.o: 1875f1e34d9SAlexandre Perrin ${COMPILE.S} ${.IMPSRC} 1885f1e34d9SAlexandre Perrin.S.a: 1895f1e34d9SAlexandre Perrin ${COMPILE.S} ${.IMPSRC} 1905f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1915f1e34d9SAlexandre Perrin rm -f $*.o 1925f1e34d9SAlexandre Perrin 1935f1e34d9SAlexandre Perrin# Lex 1945f1e34d9SAlexandre Perrin.l: 1955f1e34d9SAlexandre Perrin ${LEX.l} ${.IMPSRC} 1965f1e34d9SAlexandre Perrin ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll 1975f1e34d9SAlexandre Perrin rm -f lex.yy.c 1985f1e34d9SAlexandre Perrin.l.c: 1995f1e34d9SAlexandre Perrin ${LEX.l} ${.IMPSRC} 2005f1e34d9SAlexandre Perrin mv lex.yy.c ${.TARGET} 2015f1e34d9SAlexandre Perrin.l.o: 2025f1e34d9SAlexandre Perrin ${LEX.l} ${.IMPSRC} 2035f1e34d9SAlexandre Perrin ${COMPILE.c} -o ${.TARGET} lex.yy.c 2045f1e34d9SAlexandre Perrin rm -f lex.yy.c 2055f1e34d9SAlexandre Perrin 2065f1e34d9SAlexandre Perrin# Yacc 2075f1e34d9SAlexandre Perrin.y: 2085f1e34d9SAlexandre Perrin ${YACC.y} ${.IMPSRC} 2095f1e34d9SAlexandre Perrin ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS} 2105f1e34d9SAlexandre Perrin rm -f y.tab.c 2115f1e34d9SAlexandre Perrin.y.c: 2125f1e34d9SAlexandre Perrin ${YACC.y} ${.IMPSRC} 2135f1e34d9SAlexandre Perrin mv y.tab.c ${.TARGET} 2145f1e34d9SAlexandre Perrin.y.o: 2155f1e34d9SAlexandre Perrin ${YACC.y} ${.IMPSRC} 2165f1e34d9SAlexandre Perrin ${COMPILE.c} -o ${.TARGET} y.tab.c 2175f1e34d9SAlexandre Perrin rm -f y.tab.c 2185f1e34d9SAlexandre Perrin 2195f1e34d9SAlexandre Perrin# Shell 2205f1e34d9SAlexandre Perrin.sh: 2215f1e34d9SAlexandre Perrin rm -f ${.TARGET} 2225f1e34d9SAlexandre Perrin cp ${.IMPSRC} ${.TARGET} 223*6eef5f0cSAntonio Huete Jimenez chmod a+x ${.TARGET} 224