Closed yunwei37 closed 5 months ago
Would -j$(nproc) be better?
Seems there are no easy ways for makefile to get -j number.
In a Makefile, the -j option is used with the make command to specify the number of jobs (commands) to run simultaneously. However, within the Makefile itself, you cannot directly retrieve the number passed to the -j option because it's an argument to the make command and not an environment variable or a Makefile variable.
If you want to act on the -j option within a Makefile, you typically have to pass it as a variable. However, GNU make provides a way to detect if the job server is enabled (which happens when you use -j without specifying the number of jobs) via the .NOTPARALLEL special target. But it does not provide a way to get the actual number of jobs specified by the user.
From GPT4
Description
Fixes #173
The build time is:
which is similar to:
Documents updated in https://eunomia.dev/bpftime/documents/build-and-test/#compilation-for-bpftime
Type of change