summaryrefslogtreecommitdiffstats
path: root/debian/rules.d/scripts/mod/Makefile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:49:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:49:59 +0000
commit01997497f915e8f79871f3f2acb55ac465051d24 (patch)
tree1ce1afd7246e1014199e15cbf854bf7924458e5d /debian/rules.d/scripts/mod/Makefile
parentAdding upstream version 6.1.76. (diff)
downloadlinux-01997497f915e8f79871f3f2acb55ac465051d24.tar.xz
linux-01997497f915e8f79871f3f2acb55ac465051d24.zip
Adding debian version 6.1.76-1.debian/6.1.76-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--debian/rules.d/scripts/mod/Makefile22
-rw-r--r--debian/rules.d/scripts/mod/Makefile.real23
2 files changed, 45 insertions, 0 deletions
diff --git a/debian/rules.d/scripts/mod/Makefile b/debian/rules.d/scripts/mod/Makefile
new file mode 100644
index 000000000..6ebade2bc
--- /dev/null
+++ b/debian/rules.d/scripts/mod/Makefile
@@ -0,0 +1,22 @@
+PROGS = \
+ modpost \
+ modpost.real-lsb-32 \
+ modpost.real-lsb-64 \
+ modpost.real-msb-32 \
+ modpost.real-msb-64
+
+include $(top_rulesdir)/Makefile.inc
+
+wrapperdir = $(top_rulesdir)/$(OUTDIR)
+
+modpost.real-%:
+ $(MAKE) -f $(wrapperdir)/Makefile.real TYPE=$* SOURCEDIR=$(top_srcdir)/scripts/mod
+
+%: %.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+modpost-opts.h: $(top_srcdir)/scripts/mod/modpost.c
+ $(wrapperdir)/gendef.py $< > $@
+
+modpost.o: modpost.c modpost-opts.h
+ $(CC) $(CFLAGS) $(CPPFLAGS) -I $(CURDIR) -c -o $@ $<
diff --git a/debian/rules.d/scripts/mod/Makefile.real b/debian/rules.d/scripts/mod/Makefile.real
new file mode 100644
index 000000000..6d56ff6ae
--- /dev/null
+++ b/debian/rules.d/scripts/mod/Makefile.real
@@ -0,0 +1,23 @@
+PROGS = modpost.real-$(TYPE)
+
+include $(top_rulesdir)/Makefile.inc
+
+wrapperdir = $(top_rulesdir)/$(OUTDIR)
+CFLAGS += -I $(CURDIR)/real-$(TYPE) -I $(wrapperdir)/real-$(TYPE)
+
+modpost.real-$(TYPE): file2alias.real-$(TYPE).o modpost.real-$(TYPE).o sumversion.real-$(TYPE).o
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+%.real-$(TYPE).o: $(SOURCEDIR)/%.c real-$(TYPE)/devicetable-offsets.h
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+real-$(TYPE)/devicetable-offsets.s: $(SOURCEDIR)/devicetable-offsets.c
+ mkdir -p real-$(TYPE)
+ $(CC) -include $(wrapperdir)/real-$(TYPE)/types.h $(CFLAGS) $(CPPFLAGS) -nostdinc -I$(top_srcdir)/include -S -o $@ $<
+
+real-$(TYPE)/devicetable-offsets.h: real-$(TYPE)/devicetable-offsets.s
+ echo >$@ "#define __DEVICEVTABLE_OFFSETS_H__"
+ sed -ne "s:^[[:space:]]*\.ascii[[:space:]]*\"\(.*\)\".*:\1:; \
+ /^->/{s:->#\(.*\):/* \1 */:; \
+ s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
+ s:->::; p;}" $< >>$@