SunOS.mk revision 272461
11573Srgrimes# $Id: SunOS.mk,v 1.5 2010/01/11 23:02:05 sjg Exp $ 21573Srgrimes 31573Srgrimes.if ${.PARSEFILE} == "sys.mk" 41573Srgrimes.include <host-target.mk> 51573Srgrimes 61573SrgrimesOS?= SunOS.${HOST_OSMAJOR} 71573Srgrimesunix?= We run ${OS}. 81573Srgrimes.endif 91573Srgrimes 101573Srgrimes.if ${HOST_OSMAJOR} > 4 111573SrgrimesROOT_GROUP= root 121573Srgrimes 131573SrgrimesSHLIB_FULLVERSION = ${SHLIB_MAJOR} 141573Srgrimes 151573Srgrimes# supress the dependency 16249808SemasteLIBCRT0= /dev/null 171573Srgrimes 181573Srgrimes.ifndef CC 191573Srgrimes# the PATH below may find an ancient gcc 201573SrgrimesCC := ${gcc:L:${M_whence}} 211573Srgrimes.export CC 221573Srgrimes.endif 231573Srgrimes 241573Srgrimes# the stuff in /usr/xpg4/bin is usually more sane. 251573SrgrimesPATH=/usr/xpg4/bin:/usr/sbin:/usr/bin:/usr/ucb:/usr/sfw/bin:/opt/gnu/bin:/usr/ccs/bin:/usr/local/bin 261573Srgrimes.export PATH 271573Srgrimes 281573SrgrimesDSHLIBEXT = .so 291573SrgrimesHOST_LIBDIRS = /usr/lib /lib /usr/sfw/lib 301573Srgrimes 311573Srgrimes# no -X 321573SrgrimesLD_X= 331573SrgrimesLD_x= 341573SrgrimesRANLIB= : 351573SrgrimesCPP= /usr/ccs/lib/cpp 3692986Sobrien.else 3792986SobrienROOT_GROUP= wheel 381573SrgrimesRANLIB= ranlib 3943782SdtCPP= cpp 401573Srgrimes.endif 411573Srgrimes 421573Srgrimes# the rest is common 431573Srgrimes 441573Srgrimes.SUFFIXES: .out .a .ln .o .c .cc .C .F .f .r .y .l .s .S .cl .p .h .sh .m4 4516586Sjraynard 46249810Semaste.LIBS: .a 471573Srgrimes 4843782SdtAR= ar 491573SrgrimesARFLAGS= rl 50 51AS= as 52AS_STDIN= - 53AFLAGS= 54COMPILE.s= ${AS} ${AFLAGS} 55LINK.s= ${CC} ${AFLAGS} ${LDFLAGS} 56COMPILE.S= ${CC} ${AFLAGS} ${CPPFLAGS} -c 57LINK.S= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS} 58.if exists(/opt/gnu/bin/gcc) || exists(/usr/local/bin/gcc) 59CC ?= gcc -pipe 60DBG= -O -g 61STATIC= -static 62.else 63CC ?= cc 64DBG= -g 65STATIC= -Bstatic 66.endif 67CFLAGS= ${DBG} 68COMPILE.c= ${CC} ${CFLAGS} ${CPPFLAGS} -c 69LINK.c= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} 70 71CXX= g++ 72CXXFLAGS= ${CFLAGS} 73COMPILE.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c 74LINK.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS} 75 76.if defined(DESTDIR) 77CPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include 78.endif 79 80MK_DEP= mkdeps.sh -N 81FC= f77 82FFLAGS= -O 83RFLAGS= 84COMPILE.f= ${FC} ${FFLAGS} -c 85LINK.f= ${FC} ${FFLAGS} ${LDFLAGS} 86COMPILE.F= ${FC} ${FFLAGS} ${CPPFLAGS} -c 87LINK.F= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS} 88COMPILE.r= ${FC} ${FFLAGS} ${RFLAGS} -c 89LINK.r= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS} 90 91LEX= lex 92LFLAGS= 93LEX.l= ${LEX} ${LFLAGS} 94 95LD= ld 96LDFLAGS= 97 98LINT= lint 99LINTFLAGS= -chapbx 100 101MAKE= bmake 102 103PC= pc 104PFLAGS= 105COMPILE.p= ${PC} ${PFLAGS} ${CPPFLAGS} -c 106LINK.p= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS} 107 108SHELL= sh 109 110.if exists(/usr/local/bin/bison) || exists(/opt/gnu/bin/bison) 111YACC= bison -y 112.else 113YACC= yacc 114.endif 115YFLAGS= -d 116YACC.y= ${YACC} ${YFLAGS} 117 118# C 119.c: 120 ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 121.c.o: 122 ${COMPILE.c} ${.IMPSRC} 123.c.a: 124 ${COMPILE.c} ${.IMPSRC} 125 ${AR} ${ARFLAGS} $@ $*.o 126 rm -f $*.o 127 128# C++ 129.cc: 130 ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 131.cc.o: 132 ${COMPILE.cc} ${.IMPSRC} 133.cc.a: 134 ${COMPILE.cc} ${.IMPSRC} 135 ${AR} ${ARFLAGS} $@ $*.o 136 rm -f $*.o 137 138.C: 139 ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 140.C.o: 141 ${COMPILE.cc} ${.IMPSRC} 142.C.a: 143 ${COMPILE.cc} ${.IMPSRC} 144 ${AR} ${ARFLAGS} $@ $*.o 145 rm -f $*.o 146 147# Fortran/Ratfor 148.f: 149 ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 150.f.o: 151 ${COMPILE.f} ${.IMPSRC} 152.f.a: 153 ${COMPILE.f} ${.IMPSRC} 154 ${AR} ${ARFLAGS} $@ $*.o 155 rm -f $*.o 156 157.F: 158 ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 159.F.o: 160 ${COMPILE.F} ${.IMPSRC} 161.F.a: 162 ${COMPILE.F} ${.IMPSRC} 163 ${AR} ${ARFLAGS} $@ $*.o 164 rm -f $*.o 165 166.r: 167 ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 168.r.o: 169 ${COMPILE.r} ${.IMPSRC} 170.r.a: 171 ${COMPILE.r} ${.IMPSRC} 172 ${AR} ${ARFLAGS} $@ $*.o 173 rm -f $*.o 174 175# Pascal 176.p: 177 ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 178.p.o: 179 ${COMPILE.p} ${.IMPSRC} 180.p.a: 181 ${COMPILE.p} ${.IMPSRC} 182 ${AR} ${ARFLAGS} $@ $*.o 183 rm -f $*.o 184 185# Assembly 186.s: 187 ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 188.s.o: 189 ${COMPILE.s} ${.IMPSRC} 190.s.a: 191 ${COMPILE.s} ${.IMPSRC} 192 ${AR} ${ARFLAGS} $@ $*.o 193 rm -f $*.o 194.S: 195 ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} 196.S.o: 197 ${COMPILE.S} ${.IMPSRC} 198.S.a: 199 ${COMPILE.S} ${.IMPSRC} 200 ${AR} ${ARFLAGS} $@ $*.o 201 rm -f $*.o 202 203# Lex 204.l: 205 ${LEX.l} ${.IMPSRC} 206 ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll 207 rm -f lex.yy.c 208.l.c: 209 ${LEX.l} ${.IMPSRC} 210 mv lex.yy.c ${.TARGET} 211.l.o: 212 ${LEX.l} ${.IMPSRC} 213 ${COMPILE.c} -o ${.TARGET} lex.yy.c 214 rm -f lex.yy.c 215 216# Yacc 217.y: 218 ${YACC.y} ${.IMPSRC} 219 ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS} 220 rm -f y.tab.c 221.y.c: 222 ${YACC.y} ${.IMPSRC} 223 mv y.tab.c ${.TARGET} 224.y.o: 225 ${YACC.y} ${.IMPSRC} 226 ${COMPILE.c} -o ${.TARGET} y.tab.c 227 rm -f y.tab.c 228 229# Shell 230.sh: 231 rm -f ${.TARGET} 232 cp ${.IMPSRC} ${.TARGET} 233