📄 linux.mk
字号:
# Makefile for NT filesystem kernel module and tools.## You should have the running kernel properly configured in# /usr/src/linux to be sure module versioning is detected.NTFS_DEVICE= /dev/hdb7MOUNT_POINT= /zipDEBUG_NTFS= ySMP_KERNEL= nGREP_DISPLAY= 512MOUNT_PROG= mountUMOUNT_PROG= umountINSMOD_PROG= /sbin/insmodRMMOD_PROG= /sbin/rmmod################### End of config section ################# Set up gcc options somewhat like the kernel Makefiles would.WARNFLAG= -Wall -Wstrict-prototypesBUGFLAG= -g3 -OOPTFLAG= -O2 -fomit-frame-pointer -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2LDFLAGS=MODFLAGS= -D__KERNEL__ -DMODULE -D_POSIX_SOURCEifeq ($(DEBUG_NTFS),y)CFLAGS := -pipe -fno-strength-reduce $(BUGFLAG) $(WARNFLAG)#enable on demandMODFLAGS := $(MODFLAGS) -DDEBUGelseCFLAGS := -pipe -fno-strength-reduce $(OPTFLAG) $(WARNFLAG)endif# Find out if module versioning should be enabled.ifeq (/usr/src/linux/.config,$(wildcard /usr/src/linux/.config))include /usr/src/linux/.configelsecomplain1: @echo You do not have the Linux kernel installed and @echo configured in /usr/src/linux. Compile it too.endififeq ($(CONFIG_MODVERSIONS),y)MODFLAGS := $(MODFLAGS) -DCONFIG_MODVERSIONSendif# Check for _compiled_ kernel.ifneq (/usr/src/linux/lib/lib.a,$(wildcard /usr/src/linux/lib/lib.a))complain2: @echo You do not have the Linux kernel installed and @echo compiled in /usr/src/linux. Do that first.endififeq ($(SMP),y)MODFLAGS := $(MODFLAGS) -D__SMP__endifCOFLAGS= -lKVERSION=$(shell uname -r)SRCS= dump.c dir.c inode.c ntgrep.c ntcat.c ntdir.c ntdump.c ntfstools.c \ ntfs_fs.c super.c ntchange.c ntfs.h util.c Makefile \ mount_ntfs.c 44vfs/Makefile 44vfs/bsd.ntfs.mk 44vfs/ntfs_vfsops.c \ 44vfs/ntfs_vnops.c bsd.mk attr.c linux.mk ntfstypes.h version.hALLFILES= $(SRCS) README PROBLEMS ntfs.lpm doc \ COPYING INSTALL INSTALL.linux patchPROGRAMS= ntdir ntcat ntdump ntgrep ntchange# Create config.h if it does not exist.ifneq (config.h,$(wildcard config.h))have_no_config: config_h linuxendifall: linuxconfig_h: @echo '#define NTFS_VOLUME "'$(NTFS_DEVICE)'"' > config.h @echo '#define GREP_DISPLAY_SIZE '$(GREP_DISPLAY) >> config.h @echo '#define HAVE_GETOPT_LONG' >> config.hvars: @echo MODFLAGS is $(MODFLAGS) @echo CFLAGS is $(CFLAGS)linux: $(PROGRAMS) ntfs.ontdump: dump.o inode.o ntdump.o ntfstools.o dir.o super.o attr.o util.o $(CC) -o $@ $^ntgrep: dump.o inode.o ntgrep.o ntfstools.o dir.o super.o attr.o util.o $(CC) -o $@ $^ntdir: dir.o inode.o ntdir.o ntfstools.o super.o attr.o util.o $(CC) -o $@ $^ntcat: dir.o inode.o ntcat.o ntfstools.o super.o attr.o util.o $(CC) -o $@ $^ntchange: ntchange.o dir.o inode.o ntfstools.o super.o attr.o util.o $(CC) -o $@ $^mount_ntfs: mount_ntfs.c getmntopts.o $(CC) -o $@ $^getmntopts.o: $(MOUNT_PROG)/getmntopts.c $(CC) -c $^ntfs_fs.o: ntfs_fs.c $(CC) $(CFLAGS) $(MODFLAGS) -c ntfs_fs.cntfs.o: ntfs_fs.o inode.o dir.o super.o attr.o util.o $(LD) -r $^ /usr/src/linux/lib/lib.a -o ntfs.ontfs2.o: ntfs_fs.c inode.o dir.o super.o $(CC) $(CFLAGS) $(MODFLAGS) -DSECOND -c ntfs_fs.c -o ntfs_fs2.o $(LD) -r ntfs_fs2.o inode.o dir.o super.o -o ntfs2.oclean: rm -f core config.h doc/*~ doc/DEADJOE DEADJOE *~ *.o $(PROGRAMS)install: all install -d /usr/local/bin /lib/modules/$(KVERSION)/fs install $(PROGRAMS) /usr/local/bin install ntfs.o /lib/modules/$(KVERSION)/fs depmod -aco: $(SRCS)ci: $(SRCS) ci -l $(SRCS)mount: ntfs.o sync $(INSMOD_PROG) ntfs.o ntdebug=1 $(MOUNT_PROG) -t ntfs -oumask=0 $(NTFS_DEVICE) $(MOUNT_POINT)umount: $(UMOUNT_PROG) $(MOUNT_POINT) $(RMMOD_PROG) ntfsntfs.tar.gz: $(ALLFILES) rm -f ntfs.tar.gz date +'#define NTFS_VERSION "%y%m%d"' >version.h tar -C .. -cf ntfs.tar $(ALLFILES:%=ntfs/%) gzip -9 ntfs.taralways:# Q: Who knows to generate a portable makedepend output?# A: Linus Torvaldsattr.o: attr.c ntfs.h ntfstypes.hdir.o: dir.c ntfs.h ntfstypes.h config.hdump.o: dump.c config.h ntfs.h ntfstypes.hinode.o: inode.c ntfs.h ntfstypes.h config.hmy_create.o: my_create.c ntfs.h ntfstypes.hntcat.o: ntcat.c config.h ntfs.h ntfstypes.hntchange.o: ntchange.c config.h ntfs.h ntfstypes.hntdir.o: ntdir.c config.h ntfs.h ntfstypes.h version.hntdump.o: ntdump.c config.h ntfs.h ntfstypes.h version.hntfs_fs.o: ntfs_fs.c config.h ntfs.h ntfstypes.hntfstools.o: ntfstools.c config.h ntfs.h ntfstypes.hntgrep.o: ntgrep.c config.h ntfs.h ntfstypes.hsuper.o: super.c ntfs.h ntfstypes.h config.h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -