xref: /freebsd/contrib/bmake/mk/sys/OSF1.mk (revision 2abb9b42a53c39a8b781e25a05de1de9e98b8b9a)
1#	$Id: OSF1.mk,v 1.7 2016/03/22 20:45:15 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=	rl
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
80MAKE=		bmake
81
82PC=		pc
83PFLAGS=
84COMPILE.p=	${PC} ${PFLAGS} ${CPPFLAGS} -c
85LINK.p=		${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
86
87SHELL=		sh
88
89.if exists(/usr/local/bin/bison) || exists(/opt/gnu/bin/bison)
90YACC=		bison -y
91.else
92YACC=		yacc
93.endif
94YFLAGS=		-d
95YACC.y=		${YACC} ${YFLAGS}
96
97# C
98.c:
99	${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
100.c.o:
101	${COMPILE.c} ${.IMPSRC}
102.c.a:
103	${COMPILE.c} ${.IMPSRC}
104	${AR} ${ARFLAGS} $@ $*.o
105	rm -f $*.o
106
107# C++
108${CXX_SUFFIXES}:
109	${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
110${CXX_SUFFIXES:%=%.o}:
111	${COMPILE.cc} ${.IMPSRC}
112${CXX_SUFFIXES:%=%.a}:
113	${COMPILE.cc} ${.IMPSRC}
114	${AR} ${ARFLAGS} $@ $*.o
115	rm -f $*.o
116
117# Fortran/Ratfor
118.f:
119	${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
120.f.o:
121	${COMPILE.f} ${.IMPSRC}
122.f.a:
123	${COMPILE.f} ${.IMPSRC}
124	${AR} ${ARFLAGS} $@ $*.o
125	rm -f $*.o
126
127.F:
128	${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
129.F.o:
130	${COMPILE.F} ${.IMPSRC}
131.F.a:
132	${COMPILE.F} ${.IMPSRC}
133	${AR} ${ARFLAGS} $@ $*.o
134	rm -f $*.o
135
136.r:
137	${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
138.r.o:
139	${COMPILE.r} ${.IMPSRC}
140.r.a:
141	${COMPILE.r} ${.IMPSRC}
142	${AR} ${ARFLAGS} $@ $*.o
143	rm -f $*.o
144
145# Pascal
146.p:
147	${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
148.p.o:
149	${COMPILE.p} ${.IMPSRC}
150.p.a:
151	${COMPILE.p} ${.IMPSRC}
152	${AR} ${ARFLAGS} $@ $*.o
153	rm -f $*.o
154
155# Assembly
156.s:
157	${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
158.s.o:
159	${COMPILE.s} ${.IMPSRC}
160.s.a:
161	${COMPILE.s} ${.IMPSRC}
162	${AR} ${ARFLAGS} $@ $*.o
163	rm -f $*.o
164.S:
165	${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
166.S.o:
167	${COMPILE.S} ${.IMPSRC}
168.S.a:
169	${COMPILE.S} ${.IMPSRC}
170	${AR} ${ARFLAGS} $@ $*.o
171	rm -f $*.o
172
173# Lex
174.l:
175	${LEX.l} ${.IMPSRC}
176	${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
177	rm -f lex.yy.c
178.l.c:
179	${LEX.l} ${.IMPSRC}
180	mv lex.yy.c ${.TARGET}
181.l.o:
182	${LEX.l} ${.IMPSRC}
183	${COMPILE.c} -o ${.TARGET} lex.yy.c
184	rm -f lex.yy.c
185
186# Yacc
187.y:
188	${YACC.y} ${.IMPSRC}
189	${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
190	rm -f y.tab.c
191.y.c:
192	${YACC.y} ${.IMPSRC}
193	mv y.tab.c ${.TARGET}
194.y.o:
195	${YACC.y} ${.IMPSRC}
196	${COMPILE.c} -o ${.TARGET} y.tab.c
197	rm -f y.tab.c
198
199# Shell
200.sh:
201	rm -f ${.TARGET}
202	cp ${.IMPSRC} ${.TARGET}
203