xref: /freebsd/share/mk/sys.mk (revision e627b39baccd1ec9129690167cf5e6d860509655)
1#	from: @(#)sys.mk	8.2 (Berkeley) 3/21/94
2#	$Id: sys.mk,v 1.14 1996/05/28 16:20:13 phk Exp $
3
4unix		?=	We run FreeBSD, not UNIX.
5
6.SUFFIXES:	.out .a .ln .o .c .cc .cxx .C .F .f .e .r .y .l .S .s .cl .p .h .sh
7
8.LIBS:		.a
9
10X11BASE		?=	/usr/X11R6
11
12AR		?=	ar
13ARFLAGS		?=	rl
14RANLIB		?=	ranlib
15
16AS		?=	as
17AFLAGS		?=
18
19CC		?=	cc
20CFLAGS		?=	-O
21
22CXX		?=	c++
23CXXFLAGS	?=	${CXXINCLUDES} ${CFLAGS}
24
25CPP		?=	cpp
26
27.if ${.MAKEFLAGS:M-s} == ""
28ECHO		?=	echo
29ECHODIR		?=	echo
30.else
31ECHO		?=	true
32.if ${.MAKEFLAGS:M-s} == "-s"
33ECHODIR		?=	echo
34.else
35ECHODIR		?=	true
36.endif
37.endif
38
39FC		?=	f77
40FFLAGS		?=	-O
41EFLAGS		?=
42
43INSTALL		?=	install
44
45LEX		?=	lex
46LFLAGS		?=
47
48LD		?=	ld
49LDFLAGS		?=
50
51LINT		?=	lint
52LINTFLAGS	?=	-chapbx
53
54MAKE		?=	make
55
56PC		?=	pc
57PFLAGS		?=
58
59RC		?=	f77
60RFLAGS		?=
61
62SHELL		?=	sh
63
64YACC		?=	yacc
65YFLAGS		?=	-d
66
67.c:
68	${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
69
70.sh:
71	cp -p ${.IMPSRC} ${.TARGET}
72	chmod a+x ${.TARGET}
73
74.c.o:
75	${CC} ${CFLAGS} -c ${.IMPSRC}
76
77.cc.o .cxx.o .C.o:
78	${CXX} ${CXXFLAGS} -c ${.IMPSRC}
79
80.p.o:
81	${PC} ${PFLAGS} -c ${.IMPSRC}
82
83.e.o .r.o .F.o .f.o:
84	${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} -c ${.IMPSRC}
85
86.S.o:
87	${CC} ${CFLAGS} -c ${.IMPSRC}
88
89.s.o:
90	${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
91
92# XXX not -j safe
93.y.o:
94	${YACC} ${YFLAGS} ${.IMPSRC}
95	${CC} ${CFLAGS} -c y.tab.c -o ${.TARGET}
96	rm -f y.tab.c
97
98.l.o:
99	${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c
100	${CC} ${CFLAGS} -c ${.PREFIX}.tmp.c -o ${.TARGET}
101	rm -f ${.PREFIX}.tmp.c
102
103# XXX not -j safe
104.y.c:
105	${YACC} ${YFLAGS} ${.IMPSRC}
106	mv y.tab.c ${.TARGET}
107
108.l.c:
109	${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.TARGET}
110
111.s.out .c.out .o.out:
112	${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
113
114.f.out .F.out .r.out .e.out:
115	${FC} ${EFLAGS} ${RFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} \
116	    ${LDLIBS} -o ${.TARGET}
117	rm -f ${.PREFIX}.o
118
119# XXX not -j safe
120.y.out:
121	${YACC} ${YFLAGS} ${.IMPSRC}
122	${CC} ${CFLAGS} ${LDFLAGS} y.tab.c ${LDLIBS} -ly -o ${.TARGET}
123	rm -f y.tab.c
124
125.l.out:
126	${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c
127	${CC} ${CFLAGS} ${LDFLAGS} ${.PREFIX}.tmp.c ${LDLIBS} -ll -o ${.TARGET}
128	rm -f ${.PREFIX}.tmp.c
129
130.include <bsd.own.mk>
131
132.if exists(/etc/make.conf)
133.include </etc/make.conf>
134.endif
135