xref: /freebsd/contrib/bmake/mk/sys/OSF1.mk (revision 1d3f2ddc32fc37e4835aa5a51eabc8696c1e8114)
1#	$Id: OSF1.mk,v 1.14 2022/03/25 23:43:06 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
4
5OS ?=		OSF1
6unix ?=		We run ${OS}.
7ROOT_GROUP ?=	system
8
9# can't fine one anywhere, so just stop the dependency
10LIBCRT0 ?= /dev/null
11
12PATH ?=/usr/sbin:/usr/bin:/usr/ucb:/opt/gnu/bin:/usr/ccs/bin
13
14.SUFFIXES: .out .a .ln .o .c ${CXX_SUFFIXES} .F .f .r .y .l .s .S .cl .p .h .sh .m4
15
16.LIBS:		.a
17
18# no -X
19LD_X=
20LD_x ?=		-x
21LD_r ?=		-r
22AR ?=		ar
23ARFLAGS ?=	r
24RANLIB ?=		ranlib
25
26AS ?=		as
27AS_STDIN ?=	-
28AFLAGS=
29COMPILE.s ?=	${AS} ${AFLAGS}
30LINK.s ?=		${CC} ${AFLAGS} ${LDFLAGS}
31COMPILE.S ?=	${CC} ${AFLAGS} ${CPPFLAGS} -c
32LINK.S ?=		${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
33.if exists(/opt/gnu/bin/gcc) || exists(/usr/local/bin/gcc)
34CC ?=		gcc
35.else
36CC ?=             cc -std
37.endif
38.if (${CC:T} == "gcc")
39DBG ?=		-O -g
40STATIC ?=		-static
41DBG ?=         -g
42STATIC ?=         -non_shared
43.endif
44
45CFLAGS ?=		${DBG}
46COMPILE.c ?=	${CC} ${CFLAGS} ${CPPFLAGS} -c
47LINK.c ?=		${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
48
49CXX ?=		g++
50CXXFLAGS ?=	${CFLAGS}
51COMPILE.cc ?=	${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
52LINK.cc ?=	${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
53
54CPP ?=		/usr/ccs/lib/cpp
55.if defined(DESTDIR)
56CPPFLAGS+=	-nostdinc -idirafter ${DESTDIR}/usr/include
57.endif
58
59MK_DEP ?=	mkdeps.sh -N
60FC ?=		f77
61FFLAGS ?=		-O
62RFLAGS=
63COMPILE.f ?=	${FC} ${FFLAGS} -c
64LINK.f ?=		${FC} ${FFLAGS} ${LDFLAGS}
65COMPILE.F ?=	${FC} ${FFLAGS} ${CPPFLAGS} -c
66LINK.F ?=		${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
67COMPILE.r ?=	${FC} ${FFLAGS} ${RFLAGS} -c
68LINK.r ?=		${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
69
70LEX ?=		lex
71LFLAGS=
72LEX.l ?=		${LEX} ${LFLAGS}
73
74LD ?=		ld
75LDFLAGS=
76
77LINT ?=		lint
78LINTFLAGS ?=	-chapbx
79
80PC ?=		pc
81PFLAGS=
82COMPILE.p ?=	${PC} ${PFLAGS} ${CPPFLAGS} -c
83LINK.p ?=		${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
84
85.if exists(/usr/local/bin/bison) || exists(/opt/gnu/bin/bison)
86YACC ?=		bison -y
87.else
88YACC ?=		yacc
89.endif
90YFLAGS ?=		-d
91YACC.y ?=		${YACC} ${YFLAGS}
92
93# C
94.c:
95	${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
96.c.o:
97	${COMPILE.c} ${.IMPSRC}
98.c.a:
99	${COMPILE.c} ${.IMPSRC}
100	${AR} ${ARFLAGS} $@ $*.o
101	rm -f $*.o
102
103# C++
104${CXX_SUFFIXES}:
105	${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
106${CXX_SUFFIXES:%=%.o}:
107	${COMPILE.cc} ${.IMPSRC}
108${CXX_SUFFIXES:%=%.a}:
109	${COMPILE.cc} ${.IMPSRC}
110	${AR} ${ARFLAGS} $@ $*.o
111	rm -f $*.o
112
113# Fortran/Ratfor
114.f:
115	${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
116.f.o:
117	${COMPILE.f} ${.IMPSRC}
118.f.a:
119	${COMPILE.f} ${.IMPSRC}
120	${AR} ${ARFLAGS} $@ $*.o
121	rm -f $*.o
122
123.F:
124	${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
125.F.o:
126	${COMPILE.F} ${.IMPSRC}
127.F.a:
128	${COMPILE.F} ${.IMPSRC}
129	${AR} ${ARFLAGS} $@ $*.o
130	rm -f $*.o
131
132.r:
133	${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
134.r.o:
135	${COMPILE.r} ${.IMPSRC}
136.r.a:
137	${COMPILE.r} ${.IMPSRC}
138	${AR} ${ARFLAGS} $@ $*.o
139	rm -f $*.o
140
141# Pascal
142.p:
143	${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
144.p.o:
145	${COMPILE.p} ${.IMPSRC}
146.p.a:
147	${COMPILE.p} ${.IMPSRC}
148	${AR} ${ARFLAGS} $@ $*.o
149	rm -f $*.o
150
151# Assembly
152.s:
153	${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
154.s.o:
155	${COMPILE.s} ${.IMPSRC}
156.s.a:
157	${COMPILE.s} ${.IMPSRC}
158	${AR} ${ARFLAGS} $@ $*.o
159	rm -f $*.o
160.S:
161	${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
162.S.o:
163	${COMPILE.S} ${.IMPSRC}
164.S.a:
165	${COMPILE.S} ${.IMPSRC}
166	${AR} ${ARFLAGS} $@ $*.o
167	rm -f $*.o
168
169# Lex
170.l:
171	${LEX.l} ${.IMPSRC}
172	${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
173	rm -f lex.yy.c
174.l.c:
175	${LEX.l} ${.IMPSRC}
176	mv lex.yy.c ${.TARGET}
177.l.o:
178	${LEX.l} ${.IMPSRC}
179	${COMPILE.c} -o ${.TARGET} lex.yy.c
180	rm -f lex.yy.c
181
182# Yacc
183.y:
184	${YACC.y} ${.IMPSRC}
185	${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
186	rm -f y.tab.c
187.y.c:
188	${YACC.y} ${.IMPSRC}
189	mv y.tab.c ${.TARGET}
190.y.o:
191	${YACC.y} ${.IMPSRC}
192	${COMPILE.c} -o ${.TARGET} y.tab.c
193	rm -f y.tab.c
194
195# Shell
196.sh:
197	rm -f ${.TARGET}
198	cp ${.IMPSRC} ${.TARGET}
199	chmod a+x ${.TARGET}
200