📄 gnumakefile.in
字号:
# Makefile for the NT filesystem kernel part## Copyright (C) 1997 R間is Duchesne## Note : Do 'make clean_makespace' each time you modify this Makefile.# Files# Sources that go into the kernelKSRC = fs.c sysctl.c support.c ../common/util.c ../common/inode.c ../common/dir.c ../common/super.c ../common/attr.cKHEADERS = \ ../common/attr.h \ ../common/inode.h \ ../common/struct.h \ ../common/support.h \ ../common/util.h \ ../common/dir.h \ ../common/macros.h \ ../common/super.h \ ../common/ntfsendian.h \ ntfstypes.h \ sysctl.h# Objects to buildOBJ = $(KSRC:.c=.o)# Module to buildMOD = ../ntfs.o# DependanciesDDIR = .dependDFILE = all# LinuxKERNEL=/usr/src/linuxLMAKEFILE = $(KERNEL)/MakefileLCONFIG = $(KERNEL)/.configLMODVER = $(KERNEL)/include/linux/modversions.h# ProgramLD = @LD@CC = @CC@INSTALL = @INSTALL@DEPMOD = @DEPMOD@INSMOD = @INSMOD@RMMOD = @RMMOD@MOUNT = @MOUNT@UMOUNT = @UMOUNT@# Variables# Version of the installed kernel sourcesKVERSION = @kversion@# Allow debuggingDEBUG = @debug@# Mount point for the NTFS partitionMOUNT_POINT = @mount_point@# Default NTFS deviceMDEVICE = @ntfs_volume@.PHONY : all check_make smp check_conf modver cflags clean clean_worspace \ clean_makespace install mount umountall: smp modver cflags $(MOD)# Check the Linux kernel main Makefile presencecheck_make:ifeq ($(LMAKEFILE),$(wildcard $(LMAKEFILE))) @echo Found Linux kernel main MakefileSMP = $(shell sed -n -e "s/^SMP = \(.*\)/\1/p" $(LMAKEFILE))else @echo $(LMAKEFILE) is missing @echo Please install kernel sources before trying againendifsmp: check_make# SMP kernel detectionifeq ($(SMP),1) @echo Running kernel is SMP - OKDFLAGS += -D__SMP__else @echo Running kernel is not SMP - OKendif# Check the Linux kernel configuration file presencecheck_conf:ifeq ($(LCONFIG),$(wildcard $(LCONFIG))) @echo Found Linux kernel configuration fileinclude $(LCONFIG)else @echo $(LCONFIG) is missing @echo Please configure kernel sources before trying againendifmodver: check_conf# Module versioning detectionifeq ($(CONFIG_MODVERSIONS),y) @echo Running kernel has module versioning enabledDFLAGS += -DMODVERSIONS -include $(LMODVER)else @echo Running kernel has module versioning disabledendif# Compilation flagscflags:# To reach config.hCFLAGS = -I..# To reach the common stuffCFLAGS += -I../common -I.# Compute dependencies (.d)CFLAGS += -MMD# WarningsCFLAGS += -Wall -Wstrict-prototypes# Kernel codeCFLAGS += -D__KERNEL__ -D_POSIX_SOURCE# Kernel moduleCFLAGS += -DMODULE# Detected flagsCFLAGS += $(DFLAGS)# Flags from 'configure'CFLAGS += @gcccflags@ @DEFS@# Build kernel module$(MOD): $(OBJ) $(LD) -r $(OBJ) $(LLIB) -o $@%.o: %.c $(CC) $(CFLAGS) -c $< -o $@ @if [ -r $(@:.o=.d) ]; then \ if [ ! -d $(DDIR) ]; then \ echo Creating the dependancy directory; \ mkdir $(DDIR); \ fi; \ mv $(@:.o=.d) $(DDIR); \ cat $(DDIR)/*.d > $(DDIR)/$(DFILE); \ fi# Include the dependancies. Don't warn (-) if there is no .d-include $(DDIR)/$(DFILE)# Put the tree in its scratch stateclean: clean_workspace clean_makespacedistclean: clean @rm -f GNUmakefile *.d# Remove work files from the work spaceclean_workspace: @rm -f core *~; \ echo Linux21 workspace is now clean# Remove files created by this Makefileclean_makespace: @rm -rf $(DDIR) $(OBJ) $(MOD); \ echo Linux21 makespace is now clean# Install the moduleinstall: all $(INSTALL) -d /lib/modules/$(KVERSION)/fs; \ $(INSTALL) $(MOD) /lib/modules/$(KVERSION)/fs; \ $(DEPMOD) -a# Mount the NT filesystemmount: allifneq ($(MDEVICE),)ifneq ($(MOUNT_POINT),) sync; \ $(INSMOD) -m $(MOD) > ntfs.map; \ $(MOUNT) -t ntfs -oumask=0 $(MDEVICE) $(MOUNT_POINT)else @echo You must specify a mount point in configureendifelse @echo You must specify the device to mount in configureendif# Umount the NT filesystemumount: $(UMOUNT) $(MOUNT_POINT); \ $(RMMOD) ntfs# produce kernel patch#FIXME: how get I rid of the last chunk of struct.h?#FIXME: how can I split with only one marker up-to and starting-fromntfs_fs_i.h: ../common/struct.h ntfs_fs_i.h.in csplit ../common/struct.h %NTFS_INODE_INFO_START%+1 /NTFS_INODE_INFO_END/ csplit -f yy $@.in /BODY1/ %BODY2%+1 cat yy00 xx00 yy01 >$@ rm xx?? yy??ntfs_fs_sb.h: ../common/struct.h ntfs_fs_sb.h.in csplit ../common/struct.h %NTFS_SB_INFO_START%+1 /NTFS_SB_INFO_END/ csplit -f yy $@.in /BODY1/ %BODY2%+1 cat yy00 >$@ sed 's/ntfs_inode/ntfs_inode_info/' <xx00 >>$@ cat yy01 >>$@ rm xx?? yy??patch-kernel: ntfs_fs_i.h ntfs_fs_sb.h cmp -s $(KERNEL)/include/linux/ntfs_fs_i.h ntfs_fs_i.h|| install ntfs_fs_i.h $(KERNEL)/include/linux cmp -s $(KERNEL)/include/linux/ntfs_fs_sb.h ntfs_fs_sb.h|| install ntfs_fs_sb.h $(KERNEL)/include/linux cmp -s $(KERNEL)/include/linux/ntfs_fs.h ntfs_fs.h || install ntfs_fs.h $(KERNEL)/include/linux install ntfs.txt $(KERNEL)/Documentation/filesystems install -d $(KERNEL)/fs/ntfs for f in $(KSRC) $(KHEADERS);do \ cmp -s $$f $(KERNEL)/fs/ntfs/$$f || \ install $$f $(KERNEL)/fs/ntfs; \ done sed "s/DATE/`date +%y%m%d`/" <kernelmakefile >$(KERNEL)/fs/ntfs/Makefile# This is not needed anymore since 2.1.74# patch -N -p1 -d $(KERNEL) <kernelpatch
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -