Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build,compat: do not patch git tracked sources; apply compat patch in…
… build subdir instead Split the build process in ./drbd/. `Makefile` calls the stages, no surprise there. `Kbuild` is used to prepare the build directory, calculate the compat.h, and copy over the `Kbuild.drbd` template. `Kbuild` again is used to calculate the compat.patch using spatch via `Makefile.spatch`, and applies it, generating the patched files in build-dir. build-dir `Kbuild` (from the `Kbuild.drbd` template) is then used to build the module in build-dir. `make compat.h` Use Kbuild to generate a `build-$(KERNELRELEASE)/` subdirectory. Create a `build-current/` symlink, so a naive `make install` will work. Copy over a `Kbuild` from the `Kbuild.drbd` template. Generate `drbd_buildtag.c`. Generate `compat.h` (relevant recipes moved to `Makefile.compat`). `make spatch` Find a `compat.patch` in our `cocci_cache`, and symlink from there. Or use coccinelle spatch (or spatch-as-a-service aka SPAAS) to generate or fetch such a patch (and put it into the cocci_cache for later re-use). See also `Makefile.spatch`, which now also includes some paranoia: double check md5sum of compat.h with the path it was found under. This now passes the parameters to `gen_compat_patch.sh` via bash variables. That script now always shows spatch .stderr output, if any, even for spatch "success" (exit code 0). `make prep` Provide a list of "expected" source files in Kbuild.drbd-module-sources. Use a new `splitdiff.pl` to split that into individual patches. This has the side effect of using only the _last_ patch, should coccinelle put several patches for the same file in the compat.patch. It seems to do that for headers. Apply, and re-diff, filter through `annotate-diff-with-original-file-position-pragmas.pl` and apply again. Annotates the patched file with original source file names and line numbers, respectively with the name of the compat patch and the line number therein for patched lines, and generate single dummy hunks with only that annotation for "expected" files that remain unchanged. This way compiler error messages will point to the original sources. `make kbuild` Implicitly calls prep stage first, then use Kbuild to build the modules from the generated sources. `make install` is now also using Kbuild `modules_install` target instead of the handcrafted recipe we had before.
- Loading branch information