MFC r297282,r297456,r298012,r298013,r298014:

r297282 (by bdrewery):

We don't have a CPPFLAGS, COPTS or CPUFLAGS.

r297456 (by bdrewery):

We don't support DPLIBS.

r298012:

Add DEBUG_FLAGS to PROG_VARS and STRIP to PROG_OVERRIDE_VARS

This will allow the variables [*] to be overridden on a per-PROG basis,
which is useful when controlling "stripping" behavior for some tests
that require debug symbols or to be unstripped

DEBUG_FLAGS (similar to CFLAGS) supports appending, whereas STRIP is
an override

*: Due to how STRIP is defined in bsd.own.mk (in addition to
bsd.lib.mk and bsd.prog.mk), and the fact that bsd.test.mk pulls in
bsd.own.mk first, overriding STRIP doesn't work today.

A follow up commit is pending to "rectify" this after additional
testing is done.

Discussed with: bdrewery

r298013:

Commit documentation change for r298012

Requested by: bdrewery

r298014:

Regenerate the list of bsd.progs.mk supported variables

Prefix with dashes (unordered list) and put one variable on each
line (to avoid future conflicts)

Done via the following one-liner:

> sh -c 'for i in $(make -C tests/sys/aio PROG=foo -VPROG_VARS:O); do printf "\t\t- $i\n"; done'
This commit is contained in:
ngie 2016-04-23 07:09:23 +00:00
parent c5bc872f5c
commit 48f1966681
4 changed files with 23 additions and 6 deletions

View File

@ -77,7 +77,6 @@ SRCS= base64.c \
write_pid.c \
xfree.c
CPPFLAGS+= -DBUILD_ROKEN_LIB
CFLAGS+=-I${KRB5DIR}/lib/roken -I.
CLEANFILES= roken.h

View File

@ -262,9 +262,26 @@ PROGS_CXX PROG and PROGS_CXX in one Makefile. To define
LDADD.foo= -lutil
SRCS.bar= bar_src.c
The supported variables are BINDIR BINGRP BINMODE BINOWN
CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS DPSRCS LDADD
LDFLAGS MAN MLINKS PROGNAME SRCS.
The supported variables are:
- BINDIR
- BINGRP
- BINMODE
- BINOWN
- CFLAGS
- CXXFLAGS
- DEBUG_FLAGS
- DPADD
- DPSRCS
- LDADD
- LDFLAGS
- LINKS
- MAN
- MLINKS
- NO_WERROR
- PROGNAME
- SRCS
- STRIP
- WARNS
PROGNAME The name that the above program will be installed as, if
different from ${PROG}.

View File

@ -7,6 +7,7 @@
# XXX The use of COPTS in modern makefiles is discouraged.
.if defined(COPTS)
.warning COPTS should be CFLAGS.
CFLAGS+=${COPTS}
.endif

View File

@ -34,8 +34,8 @@ UPDATE_DEPENDFILE_PROG?= no
.if defined(PROG)
# just one of many
PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE DPSRCS MAN NO_WERROR \
PROGNAME SRCS WARNS
PROG_VARS += CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD LINKS \
PROGNAME SRCS STRIP WARNS
PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD LDADD LIBADD LINKS \
LDFLAGS MLINKS ${PROG_OVERRIDE_VARS}
.for v in ${PROG_VARS:O:u}
.if empty(${PROG_OVERRIDE_VARS:M$v})