mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-23 02:04:46 +00:00
Add a -C ala GNU make(1) for Makefiles which are too lazy to use $(MAKE) and
this particular GNU flag. It changes into the given directory for the operation in question. This just goes into said directory at the time of parsing the argument for getopt(3). Submitted by: Rachel Hestilow <rachel@jerkcity.com>
This commit is contained in:
parent
34bdf0dcbf
commit
acdb9a105e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=102393
|
@ -15,7 +15,7 @@ SRCS+= lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \
|
|||
|
||||
NOSHARED?= YES
|
||||
|
||||
CFLAGS+=-DMAKE_VERSION=\"5200205240\"
|
||||
CFLAGS+=-DMAKE_VERSION=\"5200208240\"
|
||||
|
||||
main.o: ${MAKEFILE}
|
||||
|
||||
|
|
|
@ -167,12 +167,15 @@ MainParseArgs(argc, argv)
|
|||
|
||||
optind = 1; /* since we're called more than once */
|
||||
#ifdef REMOTE
|
||||
# define OPTFLAGS "BD:E:I:L:PSV:Xd:ef:ij:km:nqrstv"
|
||||
# define OPTFLAGS "BC:D:E:I:L:PSV:Xd:ef:ij:km:nqrstv"
|
||||
#else
|
||||
# define OPTFLAGS "BD:E:I:PSV:Xd:ef:ij:km:nqrstv"
|
||||
# define OPTFLAGS "BC:D:E:I:PSV:Xd:ef:ij:km:nqrstv"
|
||||
#endif
|
||||
rearg: while((c = getopt(argc, argv, OPTFLAGS)) != -1) {
|
||||
switch(c) {
|
||||
case 'C':
|
||||
chdir(optarg);
|
||||
break;
|
||||
case 'D':
|
||||
Var_Set(optarg, "1", VAR_GLOBAL);
|
||||
Var_Append(MAKEFLAGS, "-D", VAR_GLOBAL);
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl BPSXeiknqrstv
|
||||
.Op Fl C Ar directory
|
||||
.Op Fl D Ar variable
|
||||
.Op Fl d Ar flags
|
||||
.Op Fl E Ar variable
|
||||
|
@ -88,6 +89,10 @@ by executing the commands to make the sources of a dependency line in sequence.
|
|||
This is turned on by default unless
|
||||
.Fl j
|
||||
is used.
|
||||
.It Fl C Ar directory
|
||||
Change to
|
||||
.Ar directory
|
||||
while running.
|
||||
.It Fl D Ar variable
|
||||
Define
|
||||
.Ar variable
|
||||
|
|
Loading…
Reference in a new issue