blob: 4015069e7488f80be49f3347013b3871ea8a7ce9 [file] [log] [blame]
Miklos Szeredif85ab242004-01-07 12:16:45 +00001# Makefile.in for kernel module
2
3SHELL = /bin/sh
4INSTALL = @INSTALL@
5mkinstalldirs = $(SHELL) ../mkinstalldirs
6majver = @majver@
7
Miklos Szeredif85ab242004-01-07 12:16:45 +00008DISTFILES = Makefile.in dev.c dir.c file.c inode.c util.c fuse_i.h
9
10fusemoduledir = @kmoduledir@/kernel/fs/fuse
11
12ifeq ($(majver), 2.4)
13fusemodule := fuse.o
14else
15fusemodule := fuse.ko
16endif
17
18all: all-spec
19
20install: all
21 @$(mkinstalldirs) $(DESTDIR)$(fusemoduledir)
22 $(INSTALL) -m 644 $(fusemodule) $(DESTDIR)$(fusemoduledir)/$(fusemodule)
23 -/sbin/depmod -a
24
25uninstall:
26 rm -f $(DESTDIR)$(fusemoduledir)/$(fusemodule)
27 -/sbin/depmod -a
28
29clean:
30 -rm -f $(fusemodule) *.o .*.cmd *.mod.c *.ko *.s
31
32distclean: clean
33 rm -f Makefile
34
35maintainer-clean: distclean
36
37distdir: $(DISTFILES)
38 cp -p $(DISTFILES) $(distdir)
39
40
41ifeq ($(majver), 2.4)
42
43CC = @CC@
44LD = @LD@
45CFLAGS = -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -pipe
Miklos Szeredi8b4e0962004-01-07 13:17:32 +000046CPPFLAGS = -I@kernelsrc@/include -I../include -D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES -DFUSE_VERSION=\"@VERSION@\"
Miklos Szeredif85ab242004-01-07 12:16:45 +000047
48fuse_objs = dev.o dir.o file.o inode.o util.o
49
50SUFFIXES = .c .o .s
51
52all-spec: fuse.o
53
54.c.o:
55 $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
56
57fuse.o: $(fuse_objs)
58 $(LD) -r -o fuse.o $(fuse_objs)
59
60fuse_headers = fuse_i.h ../include/linux/fuse.h
61
62dev.o: $(fuse_headers)
63dir.o: $(fuse_headers)
64file.o: $(fuse_headers)
65inode.o: $(fuse_headers)
66util.o: $(fuse_headers)
67
68else
69
Miklos Szeredi8b4e0962004-01-07 13:17:32 +000070EXTRA_CFLAGS := -I$(PWD)/../include -DFUSE_VERSION=\"@VERSION@\"
71
Miklos Szeredif85ab242004-01-07 12:16:45 +000072obj-m := fuse.o
73fuse-objs := dev.o dir.o file.o inode.o util.o
74
75all-spec:
76 $(MAKE) -C @kernelsrc@ SUBDIRS=$(PWD) modules
77endif
78
79
80
81