1*6eef5f0cSAntonio Huete Jimenez# $Id: UnixWare.mk,v 1.10 2022/03/25 23:43:06 sjg Exp $ 25f1e34d9SAlexandre Perrin# based on "Id: SunOS.5.sys.mk,v 1.6 2003/09/30 16:42:23 sjg Exp " 35f1e34d9SAlexandre Perrin# $NetBSD: sys.mk,v 1.19.2.1 1994/07/26 19:58:31 cgd Exp $ 45f1e34d9SAlexandre Perrin# @(#)sys.mk 5.11 (Berkeley) 3/13/91 55f1e34d9SAlexandre Perrin 65f1e34d9SAlexandre PerrinOS ?= UnixWare 7*6eef5f0cSAntonio Huete JimenezOS_DEF_FLAG ?= -DUNIXWARE 85f1e34d9SAlexandre Perrinunix ?= We run ${OS}. 9ca58f742SDaniel FojtROOT_GROUP ?= root 10*6eef5f0cSAntonio Huete JimenezDEV_TOOLS_PREFIX ?= /usr/local 115f1e34d9SAlexandre Perrin 12*6eef5f0cSAntonio Huete Jimenez# can't find one anywhere, so just stop the dependency 13ca58f742SDaniel FojtLIBCRT0 ?= /dev/null 145f1e34d9SAlexandre Perrin 15*6eef5f0cSAntonio Huete JimenezPATH ?= /usr/sbin:/usr/bin:/usr/ccs/bin:/usr/ccs/lib:/usr/ucb:${DEV_TOOLS_PREFIX}/bin 165f1e34d9SAlexandre Perrin 17f445c897SJohn Marino.SUFFIXES: .out .a .ln .o .c ${CXX_SUFFIXES} .F .f .r .y .l .s .S .cl .p .h .sh .m4 185f1e34d9SAlexandre Perrin 195f1e34d9SAlexandre Perrin.LIBS: .a 205f1e34d9SAlexandre Perrin 215f1e34d9SAlexandre Perrin# no -X 225f1e34d9SAlexandre PerrinLD_X= 235f1e34d9SAlexandre PerrinLD_x= 245f1e34d9SAlexandre PerrinAR ?= ar 25*6eef5f0cSAntonio Huete JimenezARFLAGS ?= r 265f1e34d9SAlexandre PerrinRANLIB ?= : 275f1e34d9SAlexandre Perrin 285f1e34d9SAlexandre PerrinAS ?= as 295f1e34d9SAlexandre PerrinAS_STDIN ?= - 305f1e34d9SAlexandre PerrinAFLAGS ?= 315f1e34d9SAlexandre PerrinCOMPILE.s ?= ${AS} ${AFLAGS} 325f1e34d9SAlexandre PerrinLINK.s ?= ${CC} ${AFLAGS} ${LDFLAGS} 335f1e34d9SAlexandre PerrinCOMPILE.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} -c 345f1e34d9SAlexandre PerrinLINK.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS} 355f1e34d9SAlexandre Perrin 365f1e34d9SAlexandre Perrin# at least gcc 2.95 on UnixWare has no internal macro to identify the system 37*6eef5f0cSAntonio Huete Jimenez.if exists(${DEV_TOOLS_PREFIX}/bin/gcc) 38*6eef5f0cSAntonio Huete JimenezCC ?= gcc -pipe ${OS_DEF_FLAG} 395f1e34d9SAlexandre PerrinDBG ?= -O -g 405f1e34d9SAlexandre PerrinSTATIC ?= -static 415f1e34d9SAlexandre Perrin.else 425f1e34d9SAlexandre PerrinCC ?= cc 435f1e34d9SAlexandre PerrinDBG ?= -g 445f1e34d9SAlexandre PerrinSTATIC ?= -Bstatic # XXX: don't know about UDK compilers 455f1e34d9SAlexandre Perrin.endif 465f1e34d9SAlexandre PerrinCFLAGS ?= ${DBG} 475f1e34d9SAlexandre PerrinCOMPILE.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} -c 485f1e34d9SAlexandre PerrinLINK.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} 495f1e34d9SAlexandre Perrin 50*6eef5f0cSAntonio Huete Jimenez.if exists(${DEV_TOOLS_PREFIX}/bin/g++) 51*6eef5f0cSAntonio Huete JimenezCXX ?= g++ ${OS_DEF_FLAG} 525f1e34d9SAlexandre Perrin.else 535f1e34d9SAlexandre PerrinCXX ?= c++ # XXX: don't know about UDK compilers 545f1e34d9SAlexandre Perrin.endif 555f1e34d9SAlexandre PerrinCXXFLAGS ?= ${CFLAGS} 565f1e34d9SAlexandre PerrinCOMPILE.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c 575f1e34d9SAlexandre PerrinLINK.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS} 585f1e34d9SAlexandre Perrin 59*6eef5f0cSAntonio Huete Jimenez.if exists(${DEV_TOOLS_PREFIX}/bin/cpp) 60*6eef5f0cSAntonio Huete JimenezCPP ?= cpp 61*6eef5f0cSAntonio Huete Jimenez.else 625f1e34d9SAlexandre PerrinCPP ?= /usr/ccs/lib/cpp 63*6eef5f0cSAntonio Huete Jimenez.endif 645f1e34d9SAlexandre Perrin.if defined(DESTDIR) 655f1e34d9SAlexandre PerrinCPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include 665f1e34d9SAlexandre Perrin.endif 675f1e34d9SAlexandre Perrin 685f1e34d9SAlexandre PerrinMK_DEP ?= mkdeps.sh -N 69*6eef5f0cSAntonio Huete Jimenez.if exists(${DEV_TOOLS_PREFIX}/bin/g77) 705f1e34d9SAlexandre PerrinFC ?= g77 715f1e34d9SAlexandre Perrin.else 725f1e34d9SAlexandre PerrinFC ?= f77 # XXX: don't know about UDK compilers 735f1e34d9SAlexandre Perrin.endif 745f1e34d9SAlexandre PerrinFFLAGS ?= -O 755f1e34d9SAlexandre PerrinRFLAGS ?= 765f1e34d9SAlexandre PerrinCOMPILE.f ?= ${FC} ${FFLAGS} -c 775f1e34d9SAlexandre PerrinLINK.f ?= ${FC} ${FFLAGS} ${LDFLAGS} 785f1e34d9SAlexandre PerrinCOMPILE.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} -c 795f1e34d9SAlexandre PerrinLINK.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS} 805f1e34d9SAlexandre PerrinCOMPILE.r ?= ${FC} ${FFLAGS} ${RFLAGS} -c 815f1e34d9SAlexandre PerrinLINK.r ?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS} 825f1e34d9SAlexandre Perrin 835f1e34d9SAlexandre PerrinINSTALL ?= /usr/ucb/install # BSD install 845f1e34d9SAlexandre Perrin 855f1e34d9SAlexandre PerrinLEX ?= lex 865f1e34d9SAlexandre PerrinLFLAGS ?= 875f1e34d9SAlexandre PerrinLEX.l ?= ${LEX} ${LFLAGS} 885f1e34d9SAlexandre Perrin 895f1e34d9SAlexandre PerrinLD ?= ld 905f1e34d9SAlexandre PerrinLDFLAGS ?= 915f1e34d9SAlexandre Perrin 925f1e34d9SAlexandre PerrinLIBC ?= ${DESTDIR}/usr/ccs/lib/libc.a 935f1e34d9SAlexandre PerrinLIBCOMPAT ?= 945f1e34d9SAlexandre PerrinLIBCRYPT ?= ${DESTDIR}/usr/lib/libcrypt.a 955f1e34d9SAlexandre PerrinLIBCURSES ?= ${DESTDIR}/usr/ccs/lib/libcurses.a 965f1e34d9SAlexandre PerrinLIBDBM ?= 975f1e34d9SAlexandre PerrinLIBDES ?= 985f1e34d9SAlexandre PerrinLIBEDIT ?= 995f1e34d9SAlexandre PerrinLIBGCC ?= 1005f1e34d9SAlexandre PerrinLIBKDB ?= 1015f1e34d9SAlexandre PerrinLIBKRB ?= 1025f1e34d9SAlexandre PerrinLIBKVM ?= 1035f1e34d9SAlexandre PerrinLIBL ?= ${DESTDIR}/usr/ccs/lib/libl.a 1045f1e34d9SAlexandre PerrinLIBM ?= ${DESTDIR}/usr/ccs/lib/libm.a 1055f1e34d9SAlexandre PerrinLIBMP ?= 1065f1e34d9SAlexandre PerrinLIBPC ?= 1075f1e34d9SAlexandre PerrinLIBPCAP ?= 1085f1e34d9SAlexandre PerrinLIBPLOT ?= 1095f1e34d9SAlexandre PerrinLIBRESOLV ?= 1105f1e34d9SAlexandre PerrinLIBRPCSVC ?= ${DESTDIR}/usr/lib/librpcsvc.a 1115f1e34d9SAlexandre PerrinLIBSKEY ?= ${DESTDIR}/usr/lib/libskey.a 1125f1e34d9SAlexandre PerrinLIBTERMCAP ?= ${DESTDIR}/usr/ccs/lib/libtermcap.a 1135f1e34d9SAlexandre PerrinLIBUTIL ?= 1145f1e34d9SAlexandre PerrinLIBWRAP ?= 1155f1e34d9SAlexandre PerrinLIBY ?= ${DESTDIR}/usr/ccs/lib/liby.a 1165f1e34d9SAlexandre PerrinLIBZ ?= 1175f1e34d9SAlexandre Perrin 1185f1e34d9SAlexandre PerrinLINT ?= lint 1195f1e34d9SAlexandre PerrinLINTFLAGS ?= -pF 1205f1e34d9SAlexandre Perrin 1215f1e34d9SAlexandre PerrinLORDER ?= lorder 1225f1e34d9SAlexandre Perrin 1235f1e34d9SAlexandre PerrinNM ?= nm 1245f1e34d9SAlexandre Perrin 1255f1e34d9SAlexandre PerrinPC ?= pc # XXX: UDK probably does not have pc 1265f1e34d9SAlexandre PerrinPFLAGS ?= 1275f1e34d9SAlexandre PerrinCOMPILE.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} -c 1285f1e34d9SAlexandre PerrinLINK.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS} 1295f1e34d9SAlexandre Perrin 1305f1e34d9SAlexandre PerrinSIZE ?= size 1315f1e34d9SAlexandre Perrin 1325f1e34d9SAlexandre PerrinTSORT ?= tsort 1335f1e34d9SAlexandre Perrin 134*6eef5f0cSAntonio Huete Jimenez.if exists(${DEV_TOOLS_PREFIX}/bin/bison) 1355f1e34d9SAlexandre PerrinYACC ?= bison -y 1365f1e34d9SAlexandre Perrin.else 1375f1e34d9SAlexandre PerrinYACC ?= yacc 1385f1e34d9SAlexandre Perrin.endif 1395f1e34d9SAlexandre PerrinYFLAGS ?= -d 1405f1e34d9SAlexandre PerrinYACC.y ?= ${YACC} ${YFLAGS} 1415f1e34d9SAlexandre Perrin 1425f1e34d9SAlexandre Perrin# C 1435f1e34d9SAlexandre Perrin.c: 1445f1e34d9SAlexandre Perrin ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 1455f1e34d9SAlexandre Perrin.c.o: 1465f1e34d9SAlexandre Perrin ${COMPILE.c} ${.IMPSRC} 1475f1e34d9SAlexandre Perrin.c.a: 1485f1e34d9SAlexandre Perrin ${COMPILE.c} ${.IMPSRC} 1495f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1505f1e34d9SAlexandre Perrin rm -f $*.o 1515f1e34d9SAlexandre Perrin 1525f1e34d9SAlexandre Perrin# C++ 153f445c897SJohn Marino${CXX_SUFFIXES}: 1545f1e34d9SAlexandre Perrin ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 155f445c897SJohn Marino${CXX_SUFFIXES:%=%.o}: 1565f1e34d9SAlexandre Perrin ${COMPILE.cc} ${.IMPSRC} 157f445c897SJohn Marino${CXX_SUFFIXES:%=%.a}: 1585f1e34d9SAlexandre Perrin ${COMPILE.cc} ${.IMPSRC} 1595f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1605f1e34d9SAlexandre Perrin rm -f $*.o 1615f1e34d9SAlexandre Perrin 1625f1e34d9SAlexandre Perrin# Fortran/Ratfor 1635f1e34d9SAlexandre Perrin.f: 1645f1e34d9SAlexandre Perrin ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 1655f1e34d9SAlexandre Perrin.f.o: 1665f1e34d9SAlexandre Perrin ${COMPILE.f} ${.IMPSRC} 1675f1e34d9SAlexandre Perrin.f.a: 1685f1e34d9SAlexandre Perrin ${COMPILE.f} ${.IMPSRC} 1695f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1705f1e34d9SAlexandre Perrin rm -f $*.o 1715f1e34d9SAlexandre Perrin 1725f1e34d9SAlexandre Perrin.F: 1735f1e34d9SAlexandre Perrin ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 1745f1e34d9SAlexandre Perrin.F.o: 1755f1e34d9SAlexandre Perrin ${COMPILE.F} ${.IMPSRC} 1765f1e34d9SAlexandre Perrin.F.a: 1775f1e34d9SAlexandre Perrin ${COMPILE.F} ${.IMPSRC} 1785f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1795f1e34d9SAlexandre Perrin rm -f $*.o 1805f1e34d9SAlexandre Perrin 1815f1e34d9SAlexandre Perrin.r: 1825f1e34d9SAlexandre Perrin ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 1835f1e34d9SAlexandre Perrin.r.o: 1845f1e34d9SAlexandre Perrin ${COMPILE.r} ${.IMPSRC} 1855f1e34d9SAlexandre Perrin.r.a: 1865f1e34d9SAlexandre Perrin ${COMPILE.r} ${.IMPSRC} 1875f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1885f1e34d9SAlexandre Perrin rm -f $*.o 1895f1e34d9SAlexandre Perrin 1905f1e34d9SAlexandre Perrin# Pascal 1915f1e34d9SAlexandre Perrin.p: 1925f1e34d9SAlexandre Perrin ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 1935f1e34d9SAlexandre Perrin.p.o: 1945f1e34d9SAlexandre Perrin ${COMPILE.p} ${.IMPSRC} 1955f1e34d9SAlexandre Perrin.p.a: 1965f1e34d9SAlexandre Perrin ${COMPILE.p} ${.IMPSRC} 1975f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 1985f1e34d9SAlexandre Perrin rm -f $*.o 1995f1e34d9SAlexandre Perrin 2005f1e34d9SAlexandre Perrin# Assembly 2015f1e34d9SAlexandre Perrin.s: 2025f1e34d9SAlexandre Perrin ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 2035f1e34d9SAlexandre Perrin.s.o: 2045f1e34d9SAlexandre Perrin ${COMPILE.s} ${.IMPSRC} 2055f1e34d9SAlexandre Perrin.s.a: 2065f1e34d9SAlexandre Perrin ${COMPILE.s} ${.IMPSRC} 2075f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 2085f1e34d9SAlexandre Perrin rm -f $*.o 2095f1e34d9SAlexandre Perrin.S: 2105f1e34d9SAlexandre Perrin ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 2115f1e34d9SAlexandre Perrin.S.o: 2125f1e34d9SAlexandre Perrin ${COMPILE.S} ${.IMPSRC} 2135f1e34d9SAlexandre Perrin.S.a: 2145f1e34d9SAlexandre Perrin ${COMPILE.S} ${.IMPSRC} 2155f1e34d9SAlexandre Perrin ${AR} ${ARFLAGS} $@ $*.o 2165f1e34d9SAlexandre Perrin rm -f $*.o 2175f1e34d9SAlexandre Perrin 2185f1e34d9SAlexandre Perrin# Lex 2195f1e34d9SAlexandre Perrin.l: 2205f1e34d9SAlexandre Perrin ${LEX.l} ${.IMPSRC} 2215f1e34d9SAlexandre Perrin ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll 2225f1e34d9SAlexandre Perrin rm -f lex.yy.c 2235f1e34d9SAlexandre Perrin.l.c: 2245f1e34d9SAlexandre Perrin ${LEX.l} ${.IMPSRC} 2255f1e34d9SAlexandre Perrin mv lex.yy.c ${.TARGET} 2265f1e34d9SAlexandre Perrin.l.o: 2275f1e34d9SAlexandre Perrin ${LEX.l} ${.IMPSRC} 2285f1e34d9SAlexandre Perrin ${COMPILE.c} -o ${.TARGET} lex.yy.c 2295f1e34d9SAlexandre Perrin rm -f lex.yy.c 2305f1e34d9SAlexandre Perrin 2315f1e34d9SAlexandre Perrin# Yacc 2325f1e34d9SAlexandre Perrin.y: 2335f1e34d9SAlexandre Perrin ${YACC.y} ${.IMPSRC} 2345f1e34d9SAlexandre Perrin ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS} 2355f1e34d9SAlexandre Perrin rm -f y.tab.c 2365f1e34d9SAlexandre Perrin.y.c: 2375f1e34d9SAlexandre Perrin ${YACC.y} ${.IMPSRC} 2385f1e34d9SAlexandre Perrin mv y.tab.c ${.TARGET} 2395f1e34d9SAlexandre Perrin.y.o: 2405f1e34d9SAlexandre Perrin ${YACC.y} ${.IMPSRC} 2415f1e34d9SAlexandre Perrin ${COMPILE.c} -o ${.TARGET} y.tab.c 2425f1e34d9SAlexandre Perrin rm -f y.tab.c 2435f1e34d9SAlexandre Perrin 2445f1e34d9SAlexandre Perrin# Shell 2455f1e34d9SAlexandre Perrin.sh: 2465f1e34d9SAlexandre Perrin rm -f ${.TARGET} 2475f1e34d9SAlexandre Perrin cp ${.IMPSRC} ${.TARGET} 248*6eef5f0cSAntonio Huete Jimenez chmod a+x ${.TARGET} 249