xref: /freebsd/contrib/bmake/mk/sys/OSF1.mk (revision 2f02600abfddfc4e9f20dd384a2e729b451e16bd)
1#	$Id: OSF1.mk,v 1.6 2003/09/30 16:42:23 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 .cc .C .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.cc:
109	${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
110.cc.o:
111	${COMPILE.cc} ${.IMPSRC}
112.cc.a:
113	${COMPILE.cc} ${.IMPSRC}
114	${AR} ${ARFLAGS} $@ $*.o
115	rm -f $*.o
116
117.C:
118	${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
119.C.o:
120	${COMPILE.cc} ${.IMPSRC}
121.C.a:
122	${COMPILE.cc} ${.IMPSRC}
123	${AR} ${ARFLAGS} $@ $*.o
124	rm -f $*.o
125
126# Fortran/Ratfor
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.F:
137	${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
138.F.o:
139	${COMPILE.F} ${.IMPSRC}
140.F.a:
141	${COMPILE.F} ${.IMPSRC}
142	${AR} ${ARFLAGS} $@ $*.o
143	rm -f $*.o
144
145.r:
146	${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
147.r.o:
148	${COMPILE.r} ${.IMPSRC}
149.r.a:
150	${COMPILE.r} ${.IMPSRC}
151	${AR} ${ARFLAGS} $@ $*.o
152	rm -f $*.o
153
154# Pascal
155.p:
156	${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
157.p.o:
158	${COMPILE.p} ${.IMPSRC}
159.p.a:
160	${COMPILE.p} ${.IMPSRC}
161	${AR} ${ARFLAGS} $@ $*.o
162	rm -f $*.o
163
164# Assembly
165.s:
166	${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
167.s.o:
168	${COMPILE.s} ${.IMPSRC}
169.s.a:
170	${COMPILE.s} ${.IMPSRC}
171	${AR} ${ARFLAGS} $@ $*.o
172	rm -f $*.o
173.S:
174	${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
175.S.o:
176	${COMPILE.S} ${.IMPSRC}
177.S.a:
178	${COMPILE.S} ${.IMPSRC}
179	${AR} ${ARFLAGS} $@ $*.o
180	rm -f $*.o
181
182# Lex
183.l:
184	${LEX.l} ${.IMPSRC}
185	${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
186	rm -f lex.yy.c
187.l.c:
188	${LEX.l} ${.IMPSRC}
189	mv lex.yy.c ${.TARGET}
190.l.o:
191	${LEX.l} ${.IMPSRC}
192	${COMPILE.c} -o ${.TARGET} lex.yy.c
193	rm -f lex.yy.c
194
195# Yacc
196.y:
197	${YACC.y} ${.IMPSRC}
198	${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
199	rm -f y.tab.c
200.y.c:
201	${YACC.y} ${.IMPSRC}
202	mv y.tab.c ${.TARGET}
203.y.o:
204	${YACC.y} ${.IMPSRC}
205	${COMPILE.c} -o ${.TARGET} y.tab.c
206	rm -f y.tab.c
207
208# Shell
209.sh:
210	rm -f ${.TARGET}
211	cp ${.IMPSRC} ${.TARGET}
212