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