2.1.60 Rules.make

Bryan W. Headley (bheadley@interaccess.com)
Sat, 25 Oct 1997 21:19:26 -0500


I'm seeing a few messages about symbols being redefined in
include/linux/modules/<yournamehere>.ver. There's a distressing number of
headers out in include/linux without the '#ifndef _foo_h; #define _foo_h; ...
#endif' structure, not the least of which are the auto-generated .ver files.
Here's a fix for the .ver files, at least:

MODINCL = $(TOPDIR)/include/linux/modules

# The -w option (enable warnings) for genksyms will return here in 2.1
$(MODINCL)/%.ver: %.c
- $(CC) $(CFLAGS) -E -D__GENKSYMS__ $<\
- $(GENKSYMS) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp
+ targ=`basename $@|sed 's/\./_/g'|tr a-z A-Z` ;\
+ $(CC) $(CFLAGS) -E -D__GENKSYMS__ $<\
+ | (echo "#ifndef _$$targ" ;\
+ echo "#define _$$targ" ;\
+ $(GENKSYMS) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) ;\
+ echo "#endif /* _$$targ */" ;\
+ ) > $@.tmp ;\
mv $@.tmp $@

The shame of it is that genksym will do this for us if it weren't for the fact
that we're piped in as stdin.

Off to 2.2-land!

-- 
Bryan W. Headley                    Home:   bheadley@interaccess.com
211 East Pineview Drive             Office: bryan.headley@abnamro.com
Round Lake Park, IL 60073           Phone:  847 740-1446