-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathversions.mk
31 lines (23 loc) · 862 Bytes
/
versions.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
ifdef CONFIG_MODVERSIONS
TOPINCL := $(TOPDIR)/include/linux
# Uses SYMTAB_OBJS
# Separate the object into "normal" objects and "exporting" objects
# Exporting objects are: all objects that define symbol tables
#
# Add dependence on $(SYMTAB_OBJS) to the main target
#
.SUFFIXES: .ver
.c.ver:
@if [ ! -x /sbin/genksyms ]; then echo "Please read: README.modules"; fi
$(CC) $(CFLAGS) -E -DCONFIG_MODVERSIONS -D__GENKSYMS__ $< | /sbin/genksyms -w $(TOPINCL)/modules
@ln -sf $(TOPINCL)/modules/$@ .
$(SYMTAB_OBJS):
$(CC) $(CFLAGS) -DEXPORT_SYMTAB -c $(@:.o=.c)
$(SYMTAB_OBJS:.o=.ver): $(TOPINCL)/autoconf.h
$(TOPINCL)/modversions.h: $(SYMTAB_OBJS:.o=.ver)
@echo updating $(TOPINCL)/modversions.h
@(cd $(TOPINCL)/modules; for f in *.ver;\
do echo "#include <linux/modules/$${f}>"; done) \
> $(TOPINCL)/modversions.h
dep: $(TOPINCL)/modversions.h
endif