xref: /freebsd/share/mk/bsd.suffixes-posix.mk (revision f81cdf24ba5436367377f7c8e8f51f6df2a75ca7)
1
2# Posix 1003.2 mandated rules
3#
4# Quoted directly from the Posix 1003.2 draft, only the macros
5# $@, $< and $* have been replaced by ${.TARGET}, ${.IMPSRC}, and
6# ${.PREFIX}, resp.
7
8# SINGLE SUFFIX RULES
9.c:
10	${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC}
11
12.f:
13	${FC} ${FFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC}
14
15.sh:
16	cp -f ${.IMPSRC} ${.TARGET}
17	chmod a+x ${.TARGET}
18
19# DOUBLE SUFFIX RULES
20
21.c.o:
22	${CC} ${CFLAGS} -c ${.IMPSRC}
23
24.f.o:
25	${FC} ${FFLAGS} -c ${.IMPSRC}
26
27.y.o:
28	${YACC} ${YFLAGS} ${.IMPSRC}
29	${CC} ${CFLAGS} -c y.tab.c
30	rm -f y.tab.c
31	mv y.tab.o ${.TARGET}
32
33.l.o:
34	${LEX} ${LFLAGS} ${.IMPSRC}
35	${CC} ${CFLAGS} -c lex.yy.c
36	rm -f lex.yy.c
37	mv lex.yy.o ${.TARGET}
38
39.y.c:
40	${YACC} ${YFLAGS} ${.IMPSRC}
41	mv y.tab.c ${.TARGET}
42
43.l.c:
44	${LEX} ${LFLAGS} ${.IMPSRC}
45	mv lex.yy.c ${.TARGET}
46
47.c.a:
48	${CC} ${CFLAGS} -c ${.IMPSRC}
49	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
50	rm -f ${.PREFIX}.o
51
52.f.a:
53	${FC} ${FFLAGS} -c ${.IMPSRC}
54	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
55	rm -f ${.PREFIX}.o
56