1 --- shfs-0.35-orig/shfs/Linux-2.4/Makefile 2004-06-01 15:16:19.000000000 +0200
2 +++ shfs-0.35-2/shfs/Linux-2.4/Makefile 2005-04-09 02:34:35.000000000 +0200
5 +# the original Makefile was trashed and replaced by this one
6 +# The main reason is that loadable modules should be built with
7 +# the same compile flags the kernel was built with, so we'd better
8 +# let the kernel tree build the module for us, like that :
10 +# make -C $(KERNEL_DIR) SUBDIRS="$(shell pwd)" modules
11 +# make -C $(KERNEL_DIR) SUBDIRS="$(shell pwd)" modules_install
15 KERNEL=$(shell uname -r)
18 KERNEL_SOURCES=${MODULESDIR}/build
21 -ifeq (${MODVERSIONS},detect)
22 - ifeq ($(shell test -e ${KERNEL_SOURCES}/include/linux/modversions.h; echo $$?),0)
27 -ifeq (${MODVERSIONS},yes)
28 -MVER=-DMODVERSIONS -DEXPORT_SYMTAB
31 -LINVER=linux-${KERNEL}
33 -ALL_TARGETS := shfs.o
35 -SEARCHDIRS := -I- -I. -I${KERNEL_SOURCES}/include #-I/usr/src/linux/include/
39 -CFLAGS = -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -Wall ${SEARCHDIRS} -DMODULE ${MVER} -D__KERNEL__ -DLINUX
46 +shfs-objs := dcache.o dir.o fcache.o file.o inode.o ioctl.o proc.o shell.o symlink.o
48 -%.o: %.c $(wildcard *.h)
49 - ${CC} ${CFLAGS} -c $< -o $@
50 +obj-y := $(shfs-objs)
53 -shfs.o: dcache.o dir.o fcache.o file.o inode.o ioctl.o proc.o shell.o symlink.o
54 - ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LOADLIBES}
57 - ${RM} core dcache.o dir.o fcache.o file.o inode.o ioctl.o proc.o shell.o symlink.o
59 -clean: tidy patch-clean
61 +-include $(TOPDIR)/Rules.make
64 + make -C ${KERNEL_SOURCES} TOPDIR="${KERNEL_SOURCES}" SUBDIRS="$(shell pwd)" modules
67 rm -f ${MODULESDIR}/kernel/fs/shfs/shfs.o
68 install -m644 -b -D shfs.o ${MODULESDIR}/kernel/fs/shfs/shfs.o
69 - if [ -x /sbin/depmod -a "${ROOT}" = "/" ]; then /sbin/depmod -aq; fi
72 rm -rf ${MODULESDIR}/kernel/fs/shfs
73 - if [ -x /sbin/depmod -a "${ROOT}" = "/" ]; then /sbin/depmod -aq; fi
76 - rm -rf ${LINVER} ${LINVER}.orig; mkdir ${LINVER};
77 - for i in Documentation fs/shfs include/linux; do \
78 - mkdir -p ${LINVER}/$$i; \
80 - cp ${KERNEL_SOURCES}/Documentation/Configure.help ${LINVER}/Documentation
81 - cp ${KERNEL_SOURCES}/fs/{Makefile,Config.in} ${LINVER}/fs
82 - cp -r ${LINVER} ${LINVER}.orig
83 - cp ../../Changelog *.c shfs_debug.h proc.h ${LINVER}/fs/shfs/
84 - cp shfs.h shfs_fs* ${LINVER}/include/linux/
85 - (cd ${LINVER}; patch -p1 <../kernel-config.diff)
86 - find . -type f -name "*.orig" -print | xargs rm -f
87 - diff -urN ${LINVER}.orig ${LINVER} >${LINVER}.diff; true
90 - rm -rf ${LINVER} ${LINVER}.orig;
91 - rm -f ${LINVER}.diff
93 -.PHONY : all tidy clean install uninstall patch patch-clean
95 + rm -f core *.o *.a *.s