xref: /freebsd/contrib/bmake/mk/sys/Darwin.mk (revision aca5021d5f7dcab1e11692923266373e35322d9a)
1#	$NetBSD: Darwin.sys.mk,v 1.3 2003/02/16 09:44:41 grant Exp $
2#	@(#)sys.mk	8.2 (Berkeley) 3/21/94
3
4OS=		Darwin
5unix?=		We run ${OS}.
6
7.SUFFIXES: .out .a .ln .o .s .S .c .cc .cpp .cxx .C .F .f .r .y .l .cl .p .h
8.SUFFIXES: .sh .m4 .dylib
9
10.LIBS:		.a .dylib
11
12SHLIBEXT =	.dylib
13HOST_LIBEXT =	.dylib
14DSHLIBEXT =	.dylib
15
16AR?=		ar
17ARFLAGS?=	rl
18RANLIB =
19
20AS?=		as
21AFLAGS?=
22COMPILE.s?=	${AS} ${AFLAGS}
23LINK.s?=	${CC} ${AFLAGS} ${LDFLAGS}
24COMPILE.S?=	${CC} ${AFLAGS} ${CPPFLAGS} -c
25LINK.S?=	${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
26
27.if exists(/usr/bin/gcc)
28CC?=		gcc -pipe
29.else
30CC?=		cc -pipe
31.endif
32DBG?=		-O2
33CFLAGS?=	${DBG}
34COMPILE.c?=	${CC} ${CFLAGS} ${CPPFLAGS} -c
35LINK.c?=	${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
36
37.if exists(/usr/bin/g++)
38CXX?=		g++
39.else
40CXX?=		c++
41.endif
42CXXFLAGS?=	${CFLAGS}
43COMPILE.cc?=	${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
44LINK.cc?=	${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
45
46OBJC?=		${CC}
47OBJCFLAGS?=	${CFLAGS}
48COMPILE.m?=	${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
49LINK.m?=	${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
50
51CPP?=		cpp
52NOLINT=		1
53CPPFLAGS?=
54
55MK_DEP?=	mkdeps.sh -N
56
57FC?=		f77
58FFLAGS?=	-O
59RFLAGS?=
60COMPILE.f?=	${FC} ${FFLAGS} -c
61LINK.f?=	${FC} ${FFLAGS} ${LDFLAGS}
62COMPILE.F?=	${FC} ${FFLAGS} ${CPPFLAGS} -c
63LINK.F?=	${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
64COMPILE.r?=	${FC} ${FFLAGS} ${RFLAGS} -c
65LINK.r?=	${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
66
67INSTALL?=	install
68
69LEX?=		lex
70LFLAGS?=
71LEX.l?=		${LEX} ${LFLAGS}
72
73LD?=		ld
74LDFLAGS?=
75
76SHLIB_TEENY = 0
77SHLIB_MINOR = 0
78
79MKPICLIB = no
80LIBEXT = .dylib
81
82LINT?=		lint
83LINTFLAGS?=	-chapbx
84
85LORDER?=	lorder
86
87MAKE?=		bmake
88
89NM?=		nm
90
91PC?=		pc
92PFLAGS?=
93COMPILE.p?=	${PC} ${PFLAGS} ${CPPFLAGS} -c
94LINK.p?=	${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
95
96SHELL?=		sh
97
98SIZE?=		size
99
100TSORT?=		tsort -q
101
102YACC?=		bison -y
103YFLAGS?=	-d
104YACC.y?=	${YACC} ${YFLAGS}
105
106# C
107.c:
108	${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
109.c.o:
110	${COMPILE.c} ${.IMPSRC}
111.c.a:
112	${COMPILE.c} ${.IMPSRC}
113	${AR} ${ARFLAGS} $@ $*.o
114	rm -f $*.o
115
116# C++
117.cc:
118	${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
119.cc.o:
120	${COMPILE.cc} ${.IMPSRC}
121.cc.a:
122	${COMPILE.cc} ${.IMPSRC}
123	${AR} ${ARFLAGS} $@ $*.o
124	rm -f $*.o
125
126.C:
127	${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
128.C.o:
129	${COMPILE.cc} ${.IMPSRC}
130.C.a:
131	${COMPILE.cc} ${.IMPSRC}
132	${AR} ${ARFLAGS} $@ $*.o
133	rm -f $*.o
134
135# Fortran/Ratfor
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.F:
146	${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
147.F.o:
148	${COMPILE.F} ${.IMPSRC}
149.F.a:
150	${COMPILE.F} ${.IMPSRC}
151	${AR} ${ARFLAGS} $@ $*.o
152	rm -f $*.o
153
154.r:
155	${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
156.r.o:
157	${COMPILE.r} ${.IMPSRC}
158.r.a:
159	${COMPILE.r} ${.IMPSRC}
160	${AR} ${ARFLAGS} $@ $*.o
161	rm -f $*.o
162
163# Pascal
164.p:
165	${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
166.p.o:
167	${COMPILE.p} ${.IMPSRC}
168.p.a:
169	${COMPILE.p} ${.IMPSRC}
170	${AR} ${ARFLAGS} $@ $*.o
171	rm -f $*.o
172
173# Assembly
174.s:
175	${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
176.s.o:
177	${COMPILE.s} -o ${.TARGET} ${.IMPSRC}
178.s.a:
179	${COMPILE.s} ${.IMPSRC}
180	${AR} ${ARFLAGS} $@ $*.o
181	rm -f $*.o
182.S:
183	${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
184.S.o:
185	${COMPILE.S} ${.IMPSRC}
186.S.a:
187	${COMPILE.S} ${.IMPSRC}
188	${AR} ${ARFLAGS} $@ $*.o
189	rm -f $*.o
190
191# Lex
192.l:
193	${LEX.l} ${.IMPSRC}
194	${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
195	rm -f lex.yy.c
196.l.c:
197	${LEX.l} ${.IMPSRC}
198	mv lex.yy.c ${.TARGET}
199.l.o:
200	${LEX.l} ${.IMPSRC}
201	${COMPILE.c} -o ${.TARGET} lex.yy.c
202	rm -f lex.yy.c
203
204# Yacc
205.y:
206	${YACC.y} ${.IMPSRC}
207	${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
208	rm -f y.tab.c
209.y.c:
210	${YACC.y} ${.IMPSRC}
211	mv y.tab.c ${.TARGET}
212.y.o:
213	${YACC.y} ${.IMPSRC}
214	${COMPILE.c} -o ${.TARGET} y.tab.c
215	rm -f y.tab.c
216
217# Shell
218.sh:
219	rm -f ${.TARGET}
220	cp ${.IMPSRC} ${.TARGET}
221