1 Index: shfs-0.35/shfs/Linux-2.4/Makefile
2 ===================================================================
3 --- shfs-0.35.orig/shfs/Linux-2.4/Makefile 2007-06-04 13:22:58.143016200 +0200
4 +++ shfs-0.35/shfs/Linux-2.4/Makefile 2007-06-04 13:22:58.209006168 +0200
7 +# the original Makefile was trashed and replaced by this one
8 +# The main reason is that loadable modules should be built with
9 +# the same compile flags the kernel was built with, so we'd better
10 +# let the kernel tree build the module for us, like that :
12 +# make -C $(KERNEL_DIR) SUBDIRS="$(shell pwd)" modules
13 +# make -C $(KERNEL_DIR) SUBDIRS="$(shell pwd)" modules_install
17 KERNEL=$(shell uname -r)
20 KERNEL_SOURCES=${MODULESDIR}/build
23 -ifeq (${MODVERSIONS},detect)
24 - ifeq ($(shell test -e ${KERNEL_SOURCES}/include/linux/modversions.h; echo $$?),0)
29 -ifeq (${MODVERSIONS},yes)
30 -MVER=-DMODVERSIONS -DEXPORT_SYMTAB
33 -LINVER=linux-${KERNEL}
35 -ALL_TARGETS := shfs.o
37 -SEARCHDIRS := -I- -I. -I${KERNEL_SOURCES}/include #-I/usr/src/linux/include/
41 -CFLAGS = -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -Wall ${SEARCHDIRS} -DMODULE ${MVER} -D__KERNEL__ -DLINUX
48 +shfs-objs := dcache.o dir.o fcache.o file.o inode.o ioctl.o proc.o shell.o symlink.o
50 -%.o: %.c $(wildcard *.h)
51 - ${CC} ${CFLAGS} -c $< -o $@
52 +obj-y := $(shfs-objs)
55 -shfs.o: dcache.o dir.o fcache.o file.o inode.o ioctl.o proc.o shell.o symlink.o
56 - ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LOADLIBES}
59 - ${RM} core dcache.o dir.o fcache.o file.o inode.o ioctl.o proc.o shell.o symlink.o
61 -clean: tidy patch-clean
63 +-include $(TOPDIR)/Rules.make
66 + make -C ${KERNEL_SOURCES} TOPDIR="${KERNEL_SOURCES}" SUBDIRS="$(shell pwd)" modules
69 rm -f ${MODULESDIR}/kernel/fs/shfs/shfs.o
70 install -m644 -b -D shfs.o ${MODULESDIR}/kernel/fs/shfs/shfs.o
71 - if [ -x /sbin/depmod -a "${ROOT}" = "/" ]; then /sbin/depmod -aq; fi
74 rm -rf ${MODULESDIR}/kernel/fs/shfs
75 - if [ -x /sbin/depmod -a "${ROOT}" = "/" ]; then /sbin/depmod -aq; fi
78 - rm -rf ${LINVER} ${LINVER}.orig; mkdir ${LINVER};
79 - for i in Documentation fs/shfs include/linux; do \
80 - mkdir -p ${LINVER}/$$i; \
82 - cp ${KERNEL_SOURCES}/Documentation/Configure.help ${LINVER}/Documentation
83 - cp ${KERNEL_SOURCES}/fs/{Makefile,Config.in} ${LINVER}/fs
84 - cp -r ${LINVER} ${LINVER}.orig
85 - cp ../../Changelog *.c shfs_debug.h proc.h ${LINVER}/fs/shfs/
86 - cp shfs.h shfs_fs* ${LINVER}/include/linux/
87 - (cd ${LINVER}; patch -p1 <../kernel-config.diff)
88 - find . -type f -name "*.orig" -print | xargs rm -f
89 - diff -urN ${LINVER}.orig ${LINVER} >${LINVER}.diff; true
92 - rm -rf ${LINVER} ${LINVER}.orig;
93 - rm -f ${LINVER}.diff
95 -.PHONY : all tidy clean install uninstall patch patch-clean
97 + rm -f core *.o *.a *.s