freebsd-dev/share/mk/bsd.suffixes-posix.mk
Jonathan Anderson 808b18e4d6 Extract suffix rules into bsd.suffixes[-posix].mk.
Refactor make suffix rules into separate files (one for POSIX and one not),
and rationalise the rules so that bsd.lib.mk can contain only those rules
that are library-specific (.c.po and .c.pico).

This can be accomplished by adding ${STATIC_CFLAGS} to the .c.o rule
unconditionally. STATIC_CFLAGS are only defined for use by sys.mk rules in
lib/libpam/Makefile.inc (see r227797), so it should be safe to include
them unconditionally in sys.mk's .c.o rule (tested by make universe and a
ports exp-run).

Reviewed by:	bdrewery, sjg
Approved by:	rwatson (mentor)
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D6805
2016-10-12 00:42:46 +00:00

57 lines
1016 B
Makefile

# $FreeBSD$
# Posix 1003.2 mandated rules
#
# Quoted directly from the Posix 1003.2 draft, only the macros
# $@, $< and $* have been replaced by ${.TARGET}, ${.IMPSRC}, and
# ${.PREFIX}, resp.
# SINGLE SUFFIX RULES
.c:
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC}
.f:
${FC} ${FFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC}
.sh:
cp -f ${.IMPSRC} ${.TARGET}
chmod a+x ${.TARGET}
# DOUBLE SUFFIX RULES
.c.o:
${CC} ${CFLAGS} -c ${.IMPSRC}
.f.o:
${FC} ${FFLAGS} -c ${.IMPSRC}
.y.o:
${YACC} ${YFLAGS} ${.IMPSRC}
${CC} ${CFLAGS} -c y.tab.c
rm -f y.tab.c
mv y.tab.o ${.TARGET}
.l.o:
${LEX} ${LFLAGS} ${.IMPSRC}
${CC} ${CFLAGS} -c lex.yy.c
rm -f lex.yy.c
mv lex.yy.o ${.TARGET}
.y.c:
${YACC} ${YFLAGS} ${.IMPSRC}
mv y.tab.c ${.TARGET}
.l.c:
${LEX} ${LFLAGS} ${.IMPSRC}
mv lex.yy.c ${.TARGET}
.c.a:
${CC} ${CFLAGS} -c ${.IMPSRC}
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
rm -f ${.PREFIX}.o
.f.a:
${FC} ${FFLAGS} -c ${.IMPSRC}
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
rm -f ${.PREFIX}.o