Whamcloud - gitweb
file rename_many.c was initially added on branch b1_2.
[fs/lustre-release.git] / lustre / Rules
1 # Copyright (C) 2001  Cluster File Systems, Inc.
2 #
3 # This code is issued under the GNU General Public License.
4 # See the file COPYING in this distribution
5
6 # Build a kernel module, name.o, and install it in $(moduledir) by:
7 #  MODULE = name
8 #  module_DATA = name.o
9 #  EXTRA_PROGRAMS = name
10 #  name_SOURCES = my.c files.c
11 #  include $(top_srcdir)/Rules
12
13 if LINUX25
14
15 # FIXME
16 # need to be rewritten:
17 # - bad hacking in lvfs/Makefile.am obdclass/Makefile.am
18 # - .o -> .ko
19 #
20 basename=$(shell echo $< | sed -e 's/\.c//g' | sed -e 's/-//g' | sed -e 's/\.o//g' | sed -e 's/^.*\///g')
21 AM_CPPFLAGS=-I$(top_builddir)/include -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2  -DKBUILD_MODNAME=$(MODULE) -DKBUILD_BASENAME=$(basename)
22
23 $(MODULE).o: $($(MODULE)_OBJECTS) $($(MODULE)_DEPENDENCIES)
24         $(LD) -m $(MOD_LINK) -r -o $(MODULE)_tmp.o $($(MODULE)_OBJECTS)
25         rm -f $(MODULE)_tmp.c
26         $(LINUX)/scripts/modpost $(LINUX)/vmlinux $(MODULE)_tmp.o
27         $(COMPILE) -UKBUILD_BASENAME -DKBUILD_BASENAME=$(MODULE) -c $(MODULE)_tmp.mod.c
28         $(LD) -m $(MOD_LINK) -r -o $(MODULE).o $(MODULE)_tmp.o $(MODULE)_tmp.mod.o
29
30 else
31
32 AM_CPPFLAGS=-I$(top_builddir)/include
33 $(MODULE).o: $($(MODULE)_OBJECTS) $($(MODULE)_DEPENDENCIES)
34         $(LD) -m "`$(LD) --help | awk '/supported emulations/ {print $$4}'`" -r -o $(MODULE).o $($(MODULE)_OBJECTS)
35
36 endif
37
38
39 tags:
40         rm -f $(top_srcdir)/TAGS
41         ETAGSF=`etags --version | grep -iq exuberant && \
42                 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
43         find $(top_srcdir) -name '*.[hc]' | xargs etags $$ETAGSF -a
44
45         rm -f $(top_srcdir)/tags
46         CTAGSF=`ctags --version | grep -iq exuberant && \
47                 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
48         find $(top_srcdir) -name '*.[hc]' | xargs ctags $$CTAGSF -a
49