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