aboutsummaryrefslogtreecommitdiff
path: root/make.c
diff options
context:
space:
mode:
Diffstat (limited to 'make.c')
-rw-r--r--make.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/make.c b/make.c
index 5d9212b..4692189 100644
--- a/make.c
+++ b/make.c
@@ -61,7 +61,7 @@ static void mkgmp(int);
static bool tagvalid(const char *);
static void chk_cpu_flags(void);
static int globerr(const char *, int);
-static tjob cc, cc_test;
+static tjob cc, cc_test, gperf;
static void
usage(void)
@@ -158,7 +158,14 @@ main(int argc, char **argv)
glob_t g;
+ /* GNU Perf files */
+ assert(glob("src/*.gperf", 0, globerr, &g) == 0);
+ for (size_t i = 0; i < g.gl_pathc; i++)
+ tpenq(&tp, gperf, g.gl_pathv[i], NULL);
+ tpwait(&tp);
+
/* C files */
+ globfree(&g);
assert(glob("src/*.c", 0, globerr, &g) == 0);
for (size_t i = 0; i < g.gl_pathc; i++)
tpenq(&tp, cc, g.gl_pathv[i], NULL);
@@ -261,6 +268,24 @@ out:
}
void
+gperf(void *arg)
+{
+ struct strs cmd = {0};
+ char *dst = swpext(arg, "gen.c"), *src = arg;
+
+ if (!fflag && fmdnewer(dst, src))
+ goto out;
+
+ strspushl(&cmd, "gperf", src, "--output-file", dst);
+
+ cmdput(cmd);
+ cmdexec(cmd);
+ strsfree(&cmd);
+out:
+ free(dst);
+}
+
+void
ld(void)
{
glob_t g;