aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-05-20 23:41:48 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-05-20 23:41:48 +0200
commit7e195fc95cdb0f3bf95e25967ddd00d9cf246fc0 (patch)
treeb17b9bbec027583471e547e8394b004b39592ad2
parenteed4a51465794ece57fa98c4e672e4413d681b7d (diff)
Add -p
-rw-r--r--make.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/make.c b/make.c
index 1b48bbd..ce4524f 100644
--- a/make.c
+++ b/make.c
@@ -58,11 +58,11 @@ main(int argc, char **argv)
cbsinit(argc, argv);
rebuild();
- while ((opt = getopt(argc, argv, "afj:rs")) != -1) {
+ while ((opt = getopt(argc, argv, "afj:prs")) != -1) {
switch (opt) {
case '?':
fprintf(stderr,
- "Usage: %s [-j procs] [-afrs]\n"
+ "Usage: %s [-j procs] [-afprs]\n"
" %s clean | gen | test\n",
*argv, *argv);
exit(EXIT_FAILURE);
@@ -129,7 +129,10 @@ main(int argc, char **argv)
{
cmdadd(&c, "ar", "rcs", LIBNAME ".a");
cmdaddv(&c, g.gl_pathv, g.gl_pathc);
- fprintf(stderr, "AR\t%s\n", LIBNAME ".a");
+ if (flagset('p'))
+ cmdput(c);
+ else
+ fprintf(stderr, "AR\t%s\n", LIBNAME ".a");
CMDRC(c);
}
@@ -143,7 +146,10 @@ main(int argc, char **argv)
cmdaddv(&c, sv.buf, sv.len);
cmdadd(&c, "-shared", "-o", LIBNAME ".so");
cmdaddv(&c, g.gl_pathv, g.gl_pathc);
- fprintf(stderr, "CC\t%s\n", LIBNAME ".so");
+ if (flagset('p'))
+ cmdput(c);
+ else
+ fprintf(stderr, "CC\t%s\n", LIBNAME ".so");
CMDRC(c);
}
@@ -172,7 +178,10 @@ work(void *p)
env_or_default(&sv, "CFLAGS", CFLAGS_DBG);
cmdaddv(&c, sv.buf, sv.len);
cmdadd(&c, CFLAGS_ALL, "-fPIC", "-o", dst, "-c", src);
- fprintf(stderr, "CC\t%s\n", dst);
+ if (flagset('p'))
+ cmdput(c);
+ else
+ fprintf(stderr, "CC\t%s\n", dst);
CMDRC(c);
}