Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 1 | # Makefile.in for kernel module |
| 2 | |
| 3 | SHELL = /bin/sh |
| 4 | INSTALL = @INSTALL@ |
Miklos Szeredi | 51ec103 | 2004-11-10 11:52:26 +0000 | [diff] [blame] | 5 | mkdir_p = mkdir -p |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 6 | majver = @majver@ |
Miklos Szeredi | 51ec103 | 2004-11-10 11:52:26 +0000 | [diff] [blame] | 7 | VERSION = @PACKAGE_VERSION@ |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 8 | |
Miklos Szeredi | 3a6ea06 | 2004-11-11 10:33:58 +0000 | [diff] [blame] | 9 | DISTFILES = Makefile.in configure.ac configure config.h.in ../install-sh \ |
Miklos Szeredi | 91762cd | 2006-06-29 14:38:35 +0000 | [diff] [blame^] | 10 | dev.c dir.c file.c inode.c fuse_i.h fuse_kernel.h control.c |
Miklos Szeredi | 127d49b | 2004-10-14 13:33:39 +0000 | [diff] [blame] | 11 | COMPATDISTFILES = compat/parser.c compat/parser.h |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 12 | |
| 13 | fusemoduledir = @kmoduledir@/kernel/fs/fuse |
| 14 | |
| 15 | ifeq ($(majver), 2.4) |
| 16 | fusemodule := fuse.o |
| 17 | else |
| 18 | fusemodule := fuse.ko |
| 19 | endif |
| 20 | |
Miklos Szeredi | 8c7da23 | 2005-01-09 12:27:41 +0000 | [diff] [blame] | 21 | all: all-@ENABLE_FUSE_MODULE@ |
| 22 | install: install-@ENABLE_FUSE_MODULE@ |
| 23 | uninstall: uninstall-@ENABLE_FUSE_MODULE@ |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 24 | |
Miklos Szeredi | 8c7da23 | 2005-01-09 12:27:41 +0000 | [diff] [blame] | 25 | all-n: |
| 26 | install-n: |
| 27 | uninstall-n: |
| 28 | |
| 29 | all-y: all-spec |
| 30 | |
| 31 | install-y: all |
Miklos Szeredi | c6f5bb4 | 2004-05-27 10:29:19 +0000 | [diff] [blame] | 32 | $(mkdir_p) $(DESTDIR)$(fusemoduledir) |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 33 | $(INSTALL) -m 644 $(fusemodule) $(DESTDIR)$(fusemoduledir)/$(fusemodule) |
| 34 | -/sbin/depmod -a |
| 35 | |
Miklos Szeredi | 8c7da23 | 2005-01-09 12:27:41 +0000 | [diff] [blame] | 36 | uninstall-y: |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 37 | rm -f $(DESTDIR)$(fusemoduledir)/$(fusemodule) |
| 38 | -/sbin/depmod -a |
| 39 | |
| 40 | clean: |
Miklos Szeredi | 8ec48ec | 2004-04-19 10:24:41 +0000 | [diff] [blame] | 41 | -rm -f $(fusemodule) *.o .*.cmd *.mod.c *.ko *.s */*.o |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 42 | |
| 43 | distclean: clean |
| 44 | rm -f Makefile |
Miklos Szeredi | 51ec103 | 2004-11-10 11:52:26 +0000 | [diff] [blame] | 45 | rm -f config.h config.log config.status config.cache |
| 46 | rm -rf .tmp_versions |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 47 | |
| 48 | maintainer-clean: distclean |
| 49 | |
Miklos Szeredi | b9b94cd | 2004-12-01 18:56:39 +0000 | [diff] [blame] | 50 | distdir: $(DISTFILES) $(COMPATDISTFILES) |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 51 | cp -p $(DISTFILES) $(distdir) |
Miklos Szeredi | 127d49b | 2004-10-14 13:33:39 +0000 | [diff] [blame] | 52 | mkdir $(distdir)/compat |
| 53 | cp -p $(COMPATDISTFILES) $(distdir)/compat |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 54 | |
| 55 | ifeq ($(majver), 2.4) |
| 56 | |
Miklos Szeredi | 51ec103 | 2004-11-10 11:52:26 +0000 | [diff] [blame] | 57 | CC = gcc |
| 58 | LD = ld |
Miklos Szeredi | 3cc8a26 | 2005-11-29 11:04:27 +0000 | [diff] [blame] | 59 | CFLAGS = -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -pipe @KERNELCFLAGS@ |
Miklos Szeredi | 51ec103 | 2004-11-10 11:52:26 +0000 | [diff] [blame] | 60 | CPPFLAGS = -I@kernelsrc@/include -I. -D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES -DFUSE_VERSION=\"$(VERSION)\" @KERNELCPPFLAGS@ |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 61 | |
Miklos Szeredi | 91762cd | 2006-06-29 14:38:35 +0000 | [diff] [blame^] | 62 | fuse_objs = dev.o dir.o file.o inode.o compat/parser.o control.o |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 63 | |
| 64 | SUFFIXES = .c .o .s |
| 65 | |
| 66 | all-spec: fuse.o |
| 67 | |
| 68 | .c.o: |
Miklos Szeredi | 8ec48ec | 2004-04-19 10:24:41 +0000 | [diff] [blame] | 69 | $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 70 | |
| 71 | fuse.o: $(fuse_objs) |
| 72 | $(LD) -r -o fuse.o $(fuse_objs) |
| 73 | |
Miklos Szeredi | b9b94cd | 2004-12-01 18:56:39 +0000 | [diff] [blame] | 74 | fuse_headers = fuse_i.h fuse_kernel.h |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 75 | |
| 76 | dev.o: $(fuse_headers) |
| 77 | dir.o: $(fuse_headers) |
| 78 | file.o: $(fuse_headers) |
| 79 | inode.o: $(fuse_headers) |
Miklos Szeredi | 91762cd | 2006-06-29 14:38:35 +0000 | [diff] [blame^] | 80 | control.o: $(fuse_headers) |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 81 | |
| 82 | else |
| 83 | |
Miklos Szeredi | 4e35880 | 2005-01-04 13:37:55 +0000 | [diff] [blame] | 84 | EXTRA_CFLAGS += -DFUSE_VERSION=\"$(VERSION)\" |
Miklos Szeredi | 8b4e096 | 2004-01-07 13:17:32 +0000 | [diff] [blame] | 85 | |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 86 | obj-m := fuse.o |
Miklos Szeredi | 91762cd | 2006-06-29 14:38:35 +0000 | [diff] [blame^] | 87 | fuse-objs := dev.o dir.o file.o inode.o control.o |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 88 | |
| 89 | all-spec: |
Miklos Szeredi | 851948c | 2004-04-02 14:58:22 +0000 | [diff] [blame] | 90 | $(MAKE) -C @kernelsrc@ SUBDIRS=$(PWD) @KERNELMAKE_PARAMS@ modules |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 91 | endif |