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 | 51ec103 | 2004-11-10 11:52:26 +0000 | [diff] [blame] | 10 | dev.c dir.c file.c inode.c util.c fuse_i.h |
Miklos Szeredi | 127d49b | 2004-10-14 13:33:39 +0000 | [diff] [blame] | 11 | COMPATDISTFILES = compat/parser.c compat/parser.h |
Miklos Szeredi | 51ec103 | 2004-11-10 11:52:26 +0000 | [diff] [blame] | 12 | LINUXDISTFILES = linux/fuse.h |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 13 | |
| 14 | fusemoduledir = @kmoduledir@/kernel/fs/fuse |
| 15 | |
| 16 | ifeq ($(majver), 2.4) |
| 17 | fusemodule := fuse.o |
| 18 | else |
| 19 | fusemodule := fuse.ko |
| 20 | endif |
| 21 | |
| 22 | all: all-spec |
| 23 | |
| 24 | install: all |
Miklos Szeredi | c6f5bb4 | 2004-05-27 10:29:19 +0000 | [diff] [blame] | 25 | $(mkdir_p) $(DESTDIR)$(fusemoduledir) |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 26 | $(INSTALL) -m 644 $(fusemodule) $(DESTDIR)$(fusemoduledir)/$(fusemodule) |
| 27 | -/sbin/depmod -a |
| 28 | |
| 29 | uninstall: |
| 30 | rm -f $(DESTDIR)$(fusemoduledir)/$(fusemodule) |
| 31 | -/sbin/depmod -a |
| 32 | |
| 33 | clean: |
Miklos Szeredi | 8ec48ec | 2004-04-19 10:24:41 +0000 | [diff] [blame] | 34 | -rm -f $(fusemodule) *.o .*.cmd *.mod.c *.ko *.s */*.o |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 35 | |
| 36 | distclean: clean |
| 37 | rm -f Makefile |
Miklos Szeredi | 51ec103 | 2004-11-10 11:52:26 +0000 | [diff] [blame] | 38 | rm -f config.h config.log config.status config.cache |
| 39 | rm -rf .tmp_versions |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 40 | |
| 41 | maintainer-clean: distclean |
| 42 | |
Miklos Szeredi | 51ec103 | 2004-11-10 11:52:26 +0000 | [diff] [blame] | 43 | distdir: $(DISTFILES) $(COMPATDISTFILES) $(LINUXDISTFILES) |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 44 | cp -p $(DISTFILES) $(distdir) |
Miklos Szeredi | 127d49b | 2004-10-14 13:33:39 +0000 | [diff] [blame] | 45 | mkdir $(distdir)/compat |
| 46 | cp -p $(COMPATDISTFILES) $(distdir)/compat |
Miklos Szeredi | 51ec103 | 2004-11-10 11:52:26 +0000 | [diff] [blame] | 47 | mkdir $(distdir)/linux |
| 48 | cp -p $(LINUXDISTFILES) $(distdir)/linux |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 49 | |
| 50 | ifeq ($(majver), 2.4) |
| 51 | |
Miklos Szeredi | 51ec103 | 2004-11-10 11:52:26 +0000 | [diff] [blame] | 52 | CC = gcc |
| 53 | LD = ld |
Miklos Szeredi | 8ec48ec | 2004-04-19 10:24:41 +0000 | [diff] [blame] | 54 | CFLAGS = -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -pipe |
Miklos Szeredi | 51ec103 | 2004-11-10 11:52:26 +0000 | [diff] [blame] | 55 | 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] | 56 | |
Miklos Szeredi | 8ec48ec | 2004-04-19 10:24:41 +0000 | [diff] [blame] | 57 | fuse_objs = dev.o dir.o file.o inode.o util.o compat/parser.o |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 58 | |
| 59 | SUFFIXES = .c .o .s |
| 60 | |
| 61 | all-spec: fuse.o |
| 62 | |
| 63 | .c.o: |
Miklos Szeredi | 8ec48ec | 2004-04-19 10:24:41 +0000 | [diff] [blame] | 64 | $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 65 | |
| 66 | fuse.o: $(fuse_objs) |
| 67 | $(LD) -r -o fuse.o $(fuse_objs) |
| 68 | |
Miklos Szeredi | 51ec103 | 2004-11-10 11:52:26 +0000 | [diff] [blame] | 69 | fuse_headers = fuse_i.h linux/fuse.h |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 70 | |
| 71 | dev.o: $(fuse_headers) |
| 72 | dir.o: $(fuse_headers) |
| 73 | file.o: $(fuse_headers) |
| 74 | inode.o: $(fuse_headers) |
| 75 | util.o: $(fuse_headers) |
| 76 | |
| 77 | else |
| 78 | |
Miklos Szeredi | 51ec103 | 2004-11-10 11:52:26 +0000 | [diff] [blame] | 79 | export FUSE_INCLUDE ?= $(shell pwd) |
| 80 | EXTRA_CFLAGS += -I$(FUSE_INCLUDE) -DFUSE_VERSION=\"$(VERSION)\" |
Miklos Szeredi | 8b4e096 | 2004-01-07 13:17:32 +0000 | [diff] [blame] | 81 | |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 82 | obj-m := fuse.o |
| 83 | fuse-objs := dev.o dir.o file.o inode.o util.o |
| 84 | |
| 85 | all-spec: |
Miklos Szeredi | 851948c | 2004-04-02 14:58:22 +0000 | [diff] [blame] | 86 | $(MAKE) -C @kernelsrc@ SUBDIRS=$(PWD) @KERNELMAKE_PARAMS@ modules |
Miklos Szeredi | f85ab24 | 2004-01-07 12:16:45 +0000 | [diff] [blame] | 87 | endif |