login: SIGINT should interrupt motd printing
[unleashed.git] / bin / bmake / mk / sys / HP-UX.mk
blob95cc59595c685f798933ad4f6f14f354a0a7ded4
1 # $Id: HP-UX.mk,v 1.10 2016/03/22 20:45:14 sjg Exp $
2 # $NetBSD: sys.mk,v 1.19.2.1 1994/07/26 19:58:31 cgd Exp $
3 # @(#)sys.mk 5.11 (Berkeley) 3/13/91
5 OS= HP-UX
6 ROOT_GROUP= root
7 unix?= We run ${OS}.
9 # HP-UX's cc does not provide any clues as to wether this is 9.x or 10.x
10 # nor does sys/param.h, so we'll use the existence of /hp-ux
11 .if exists("/hp-ux")
12 OSMAJOR?=9
13 .endif
14 OSMAJOR?=10
15 __HPUX_VERSION?=${OSMAJOR}
17 .SUFFIXES: .out .a .ln .o .c ${CXX_SUFFIXES} .F .f .r .y .l .s .S .cl .p .h .sh .m4
19 LIBMODE= 755
20 LIBCRT0= /lib/crt0.o
22 .LIBS: .a
24 # +b<path> is needed to stop the binaries from insisting on having
25 # the build tree available :-)
26 # +s tells the dynamic loader to use SHLIB_PATH if set
27 LD_bpath?=-Wl,+b/lib:/usr/lib:/usr/local/lib
28 LD_spath?=-Wl,+s
29 LDADD+= ${LD_bpath} ${LD_spath}
31 .if exists(/usr/lib/end.o)
32 LDADD+= /usr/lib/end.o
33 .endif
35 AR= ar
36 ARFLAGS= rl
37 RANLIB= :
39 AFLAGS=
40 COMPILE.s= ${AS} ${AFLAGS}
41 LINK.s= ${CC} ${AFLAGS} ${LDFLAGS}
42 COMPILE.S= ${CC} ${AFLAGS} ${CPPFLAGS} -c
43 LINK.S= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
44 .if exists(/usr/local/bin/gcc)
45 PIPE?= -pipe
46 CC?= gcc ${PIPE}
47 AS= gas
48 DBG?= -O -g
49 STATIC?= -static
50 .if defined(DESTDIR)
51 CPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include
52 .endif
53 .else
54 # HP's bundled compiler knows not -g or -O
55 AS= as
56 CC= cc
57 .if exists(/opt/ansic/bin/cc)
58 CCMODE?=-Ae +ESlit
59 PICFLAG?= +z
60 LD_x=
61 DBG?=-g -O
62 .endif
63 DBG?=
64 STATIC?= -Wl,-a,archive
65 .endif
66 .if (${__HPUX_VERSION} == "10")
67 CCSOURCE_FLAGS?= -D_HPUX_SOURCE
68 .else
69 CCSOURCE_FLAGS?= -D_HPUX_SOURCE -D_INCLUDE_POSIX_SOURCE -D_INCLUDE_XOPEN_SOURCE -D_INCLUDE_XOPEN_SOURCE_EXTENDED
70 .endif
71 CFLAGS= ${DBG}
72 CFLAGS+= ${CCMODE} -D__hpux__ -D__HPUX_VERSION=${__HPUX_VERSION} ${CCSOURCE_FLAGS}
73 COMPILE.c= ${CC} ${CFLAGS} ${CPPFLAGS} -c
74 LINK.c= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
76 CXX= g++
77 CXXFLAGS= ${CFLAGS}
78 COMPILE.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
79 LINK.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
81 CPP= cpp
83 MK_DEP= mkdeps.sh -N
84 FC= f77
85 FFLAGS= -O
86 RFLAGS=
87 COMPILE.f= ${FC} ${FFLAGS} -c
88 LINK.f= ${FC} ${FFLAGS} ${LDFLAGS}
89 COMPILE.F= ${FC} ${FFLAGS} ${CPPFLAGS} -c
90 LINK.F= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
91 COMPILE.r= ${FC} ${FFLAGS} ${RFLAGS} -c
92 LINK.r= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
94 LEX= lex
95 LFLAGS=
96 LEX.l= ${LEX} ${LFLAGS}
98 LD= ld
99 LDFLAGS=
101 LINT= lint
102 LINTFLAGS= -chapbx
104 MAKE= bmake
106 PC= pc
107 PFLAGS=
108 COMPILE.p= ${PC} ${PFLAGS} ${CPPFLAGS} -c
109 LINK.p= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
111 # HP's sh sucks
112 ENV=
113 SHELL= /bin/ksh
115 .if exists(/usr/local/bin/bison)
116 YACC= bison -y
117 .else
118 YACC= yacc
119 .endif
120 YFLAGS= -d
121 YACC.y= ${YACC} ${YFLAGS}
125 ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
126 .c.o:
127 ${COMPILE.c} ${.IMPSRC}
128 .c.a:
129 ${COMPILE.c} ${.IMPSRC}
130 ${AR} ${ARFLAGS} $@ $*.o
131 rm -f $*.o
133 # C++
134 ${CXX_SUFFIXES}:
135 ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
136 ${CXX_SUFFIXES:%=%.o}:
137 ${COMPILE.cc} ${.IMPSRC}
138 ${CXX_SUFFIXES:%=%.a}:
139 ${COMPILE.cc} ${.IMPSRC}
140 ${AR} ${ARFLAGS} $@ $*.o
141 rm -f $*.o
143 # Fortran/Ratfor
145 ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
146 .f.o:
147 ${COMPILE.f} ${.IMPSRC}
148 .f.a:
149 ${COMPILE.f} ${.IMPSRC}
150 ${AR} ${ARFLAGS} $@ $*.o
151 rm -f $*.o
154 ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
155 .F.o:
156 ${COMPILE.F} ${.IMPSRC}
157 .F.a:
158 ${COMPILE.F} ${.IMPSRC}
159 ${AR} ${ARFLAGS} $@ $*.o
160 rm -f $*.o
163 ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
164 .r.o:
165 ${COMPILE.r} ${.IMPSRC}
166 .r.a:
167 ${COMPILE.r} ${.IMPSRC}
168 ${AR} ${ARFLAGS} $@ $*.o
169 rm -f $*.o
171 # Pascal
173 ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
174 .p.o:
175 ${COMPILE.p} ${.IMPSRC}
176 .p.a:
177 ${COMPILE.p} ${.IMPSRC}
178 ${AR} ${ARFLAGS} $@ $*.o
179 rm -f $*.o
181 # Assembly
183 ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
184 .s.o:
185 ${COMPILE.s} -o ${.TARGET} ${.IMPSRC}
186 .s.a:
187 ${COMPILE.s} ${.IMPSRC}
188 ${AR} ${ARFLAGS} $@ $*.o
189 rm -f $*.o
191 ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
192 .S.o:
193 ${COMPILE.S} ${.IMPSRC}
194 .S.a:
195 ${COMPILE.S} ${.IMPSRC}
196 ${AR} ${ARFLAGS} $@ $*.o
197 rm -f $*.o
199 # Lex
201 ${LEX.l} ${.IMPSRC}
202 ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
203 rm -f lex.yy.c
204 .l.c:
205 ${LEX.l} ${.IMPSRC}
206 mv lex.yy.c ${.TARGET}
207 .l.o:
208 ${LEX.l} ${.IMPSRC}
209 ${COMPILE.c} -o ${.TARGET} lex.yy.c
210 rm -f lex.yy.c
212 # Yacc
214 ${YACC.y} ${.IMPSRC}
215 ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
216 rm -f y.tab.c
217 .y.c:
218 ${YACC.y} ${.IMPSRC}
219 mv y.tab.c ${.TARGET}
220 .y.o:
221 ${YACC.y} ${.IMPSRC}
222 ${COMPILE.c} -o ${.TARGET} y.tab.c
223 rm -f y.tab.c
225 # Shell
226 .sh:
227 rm -f ${.TARGET}
228 cp ${.IMPSRC} ${.TARGET}