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
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
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
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
29 LDADD
+= ${LD_bpath} ${LD_spath}
31 .if exists
(/usr
/lib
/end.o
)
32 LDADD
+= /usr
/lib
/end.o
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
)
51 CPPFLAGS
+= -nostdinc
-idirafter
${DESTDIR}/usr
/include
54 # HP's bundled compiler knows not -g or -O
57 .if exists
(/opt
/ansic
/bin
/cc)
64 STATIC?
= -Wl
,-a
,archive
66 .if
(${__HPUX_VERSION} == "10")
67 CCSOURCE_FLAGS?
= -D_HPUX_SOURCE
69 CCSOURCE_FLAGS?
= -D_HPUX_SOURCE
-D_INCLUDE_POSIX_SOURCE
-D_INCLUDE_XOPEN_SOURCE
-D_INCLUDE_XOPEN_SOURCE_EXTENDED
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}
78 COMPILE.
cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
79 LINK.
cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
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}
96 LEX.l
= ${LEX} ${LFLAGS}
108 COMPILE.p
= ${PC} ${PFLAGS} ${CPPFLAGS} -c
109 LINK.p
= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
115 .if exists
(/usr
/local
/bin
/bison
)
121 YACC.y
= ${YACC} ${YFLAGS}
125 ${LINK.c
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
127 ${COMPILE.c
} ${.IMPSRC
}
129 ${COMPILE.c
} ${.IMPSRC
}
130 ${AR} ${ARFLAGS} $@
$*.o
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
145 ${LINK.f
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
147 ${COMPILE.f
} ${.IMPSRC
}
149 ${COMPILE.f
} ${.IMPSRC
}
150 ${AR} ${ARFLAGS} $@
$*.o
154 ${LINK.F
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
156 ${COMPILE.F
} ${.IMPSRC
}
158 ${COMPILE.F
} ${.IMPSRC
}
159 ${AR} ${ARFLAGS} $@
$*.o
163 ${LINK.r
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
165 ${COMPILE.r
} ${.IMPSRC
}
167 ${COMPILE.r
} ${.IMPSRC
}
168 ${AR} ${ARFLAGS} $@
$*.o
173 ${LINK.p
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
175 ${COMPILE.p
} ${.IMPSRC
}
177 ${COMPILE.p
} ${.IMPSRC
}
178 ${AR} ${ARFLAGS} $@
$*.o
183 ${LINK.s
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
185 ${COMPILE.s
} -o
${.TARGET
} ${.IMPSRC
}
187 ${COMPILE.s
} ${.IMPSRC
}
188 ${AR} ${ARFLAGS} $@
$*.o
191 ${LINK.S
} -o
${.TARGET
} ${.IMPSRC
} ${LDLIBS}
193 ${COMPILE.S
} ${.IMPSRC
}
195 ${COMPILE.S
} ${.IMPSRC
}
196 ${AR} ${ARFLAGS} $@
$*.o
202 ${LINK.c
} -o
${.TARGET
} lex.yy.c
${LDLIBS} -ll
206 mv
lex.yy.c
${.TARGET
}
209 ${COMPILE.c
} -o
${.TARGET
} lex.yy.c
215 ${LINK.c
} -o
${.TARGET
} y.tab.c
${LDLIBS}
219 mv y.tab.c
${.TARGET
}
222 ${COMPILE.c
} -o
${.TARGET
} y.tab.c
228 cp
${.IMPSRC
} ${.TARGET
}