aboutsummaryrefslogtreecommitdiff
path: root/kernel/Makefile.in
blob: 42d1807f58f21fbbeeb99afb56ae9938f2bd1721 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Makefile.in for kernel module

SHELL = /bin/sh
INSTALL = @INSTALL@
mkdir_p = mkdir -p
majver = @majver@
VERSION = @PACKAGE_VERSION@

DISTFILES = Makefile.in configure.ac configure config.h.in ../install-sh \
	dev.c dir.c file.c inode.c util.c fuse_i.h
COMPATDISTFILES = compat/parser.c compat/parser.h
LINUXDISTFILES = linux/fuse.h

fusemoduledir = @kmoduledir@/kernel/fs/fuse

ifeq ($(majver), 2.4)
fusemodule := fuse.o
else
fusemodule := fuse.ko
endif

all: all-spec

install: all
	$(mkdir_p) $(DESTDIR)$(fusemoduledir)
	$(INSTALL) -m 644 $(fusemodule) $(DESTDIR)$(fusemoduledir)/$(fusemodule)
	-/sbin/depmod -a

uninstall:
	rm -f $(DESTDIR)$(fusemoduledir)/$(fusemodule)
	-/sbin/depmod -a

clean:
	-rm -f $(fusemodule) *.o .*.cmd *.mod.c *.ko *.s */*.o

distclean: clean
	rm -f Makefile
	rm -f config.h config.log config.status config.cache
	rm -rf .tmp_versions

maintainer-clean: distclean

distdir: $(DISTFILES) $(COMPATDISTFILES) $(LINUXDISTFILES)
	cp -p $(DISTFILES) $(distdir)
	mkdir $(distdir)/compat
	cp -p $(COMPATDISTFILES) $(distdir)/compat
	mkdir $(distdir)/linux
	cp -p $(LINUXDISTFILES) $(distdir)/linux

ifeq ($(majver), 2.4)

CC = gcc
LD = ld
CFLAGS = -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -pipe 
CPPFLAGS = -I@kernelsrc@/include -I. -D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES -DFUSE_VERSION=\"$(VERSION)\" @KERNELCPPFLAGS@

fuse_objs = dev.o dir.o file.o inode.o util.o compat/parser.o

SUFFIXES = .c .o .s

all-spec: fuse.o

.c.o:
	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@

fuse.o: $(fuse_objs)
	$(LD) -r -o fuse.o $(fuse_objs)

fuse_headers = fuse_i.h linux/fuse.h

dev.o: $(fuse_headers)
dir.o: $(fuse_headers)
file.o: $(fuse_headers)
inode.o: $(fuse_headers)
util.o: $(fuse_headers)

else

export FUSE_INCLUDE ?= $(shell pwd)
EXTRA_CFLAGS += -I$(FUSE_INCLUDE) -DFUSE_VERSION=\"$(VERSION)\"

obj-m := fuse.o
fuse-objs := dev.o dir.o file.o inode.o util.o

all-spec:
	$(MAKE) -C @kernelsrc@ SUBDIRS=$(PWD) @KERNELMAKE_PARAMS@ modules
endif