--- truecrypt/linux/kernel/makefile 2018/04/24 16:43:12 1.1 +++ truecrypt/linux/kernel/makefile 2018/04/24 16:46:48 1.1.1.5 @@ -1,4 +1,10 @@ -# TrueCrypt Linux Kernel Module Makefile +# +# Copyright (c) TrueCrypt Foundation. All rights reserved. +# +# Covered by the TrueCrypt License 2.2 the full text of which is contained +# in the file License.txt included in TrueCrypt binary and source code +# distribution packages. +# ifndef KERNEL_SRC KERNEL_SRC := /usr/src/linux @@ -18,12 +24,15 @@ EXTRA_CFLAGS += -w else EXTRA_CFLAGS += -Wno-strict-prototypes endif +# Do not enable strict aliasing +EXTRA_CFLAGS += -fno-strict-aliasing EXTRA_CFLAGS += $(TYPES) -EXTRA_CFLAGS += -D_cdecl="" -DBOOL=int -DTRUE=1 -DFALSE=0 +EXTRA_CFLAGS += -DBOOL=int -DTRUE=1 -DFALSE=0 EXTRA_CFLAGS += -DLINUX_DRIVER EXTRA_CFLAGS += -I$(KERNEL_SRC)/drivers/md EXTRA_CFLAGS += -I$(TC_BASE)/Crypto EXTRA_CFLAGS += -I$(TC_BASE)/Common +EXTRA_CFLAGS += -I$(TC_BASE) OBJS := $(TC_CRYPTO)/Aescrypt.o OBJS += $(TC_CRYPTO)/Aeskey.o @@ -43,25 +52,32 @@ OBJS += $(TC_CRYPTO)/Twofish.o OBJS += $(TC_COMMON)/Crc.o OBJS += $(TC_COMMON)/Crypto.o OBJS += $(TC_COMMON)/Endian.o +OBJS += $(TC_COMMON)/GfMul.o OBJS += $(TC_COMMON)/Tests.o OBJS += Dm-target.o truecrypt-objs := $(OBJS) obj-m := truecrypt.o -USER_OBJS_F := ../.user-objs -KERNEL_OBJS_F := ../.kernel-objs +USER_OBJS_PRESENT := ../.user-objs +USER_OBJS_CLEAN := ../.kernel-objs -truecrypt: objclean +.PHONY: clean install truecrypt + +truecrypt: $(USER_OBJS_CLEAN) platform @$(MAKE) TC_BASE=$(PWD)/../.. -C $(KERNEL_SRC) SUBDIRS=$(PWD) M=$(PWD) modules -$(TC_BASE)/Linux/Common/.platform: $(TC_BASE)/Linux/Common/Platform.c - @$(CC) -o $(TC_BASE)/Linux/Common/platform $< - @$(TC_BASE)/Linux/Common/platform >$(TC_BASE)/Linux/Common/.platform - -objclean: - @if [ -f $(USER_OBJS_F) ]; then rm -f $(OBJS) $(USER_OBJS_F); fi - @>$(KERNEL_OBJS_F) +CMN := ../../Linux/Common + +platform: $(CMN)/.platform + +$(CMN)/.platform: $(CMN)/Platform.c + @$(CC) -o $(CMN)/platform $< + @$(CMN)/platform >$(CMN)/.platform + +$(USER_OBJS_CLEAN): + @rm -f $(OBJS) $(USER_OBJS_PRESENT) + @>$(USER_OBJS_CLEAN) clean: -rm -f $(OBJS) ../Common/.platform ../Common/platform