📄 gnumakefile.in
字号:
# Makefile for the NT filesystem kernel part## Copyright (C) 1999 Martin v. L鰓is# Copyright (C) 1997 R間is Duchesne## Note : Do 'make clean_makespace' each time you modify this Makefile.# FilesKSRC = 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/types.h \ sysctl.h# Objects to buildOBJ = fs.o sysctl.o support.o ../common/util.o ../common/inode.o ../common/dir.o ../common/super.o ../common/attr.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# Debug optionifeq ($(DEBUG),y)CFLAGS += -g3 -OCFLAGS += -DDEBUGelseCFLAGS += -O2 -fomit-frame-pointerendif# Kernel codeCFLAGS += -D__KERNEL__ -D_POSIX_SOURCE -I$(KERNEL)/include# Kernel moduleCFLAGS += -DMODULE# Detected flagsCFLAGS += $(DFLAGS)# Flags from 'configure'CFLAGS += @gcccflags@ @DEFS@# Build kernel module$(MOD): $(OBJ) $(LD) -r $(OBJ) -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# Remove work files from the work spaceclean_workspace: @rm -f core *~; \ echo Linux20 workspace is now clean# Remove files created by this Makefileclean_makespace: @rm -rf $(DDIR) $(OBJ) $(MOD); \ echo Linux20 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#patch the kernelpatch-kernel: 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 patch -N -p1 -d $(KERNEL) <patch
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -