--- truecrypt/linux/kernel/makefile 2018/04/24 16:45:01 1.1.1.3 +++ 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 @@ -50,10 +59,12 @@ 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 platform +.PHONY: clean install truecrypt + +truecrypt: $(USER_OBJS_CLEAN) platform @$(MAKE) TC_BASE=$(PWD)/../.. -C $(KERNEL_SRC) SUBDIRS=$(PWD) M=$(PWD) modules CMN := ../../Linux/Common @@ -64,9 +75,9 @@ $(CMN)/.platform: $(CMN)/Platform.c @$(CC) -o $(CMN)/platform $< @$(CMN)/platform >$(CMN)/.platform -objclean: - @if [ -f $(USER_OBJS_F) ]; then rm -f $(OBJS) $(USER_OBJS_F); fi - @>$(KERNEL_OBJS_F) +$(USER_OBJS_CLEAN): + @rm -f $(OBJS) $(USER_OBJS_PRESENT) + @>$(USER_OBJS_CLEAN) clean: -rm -f $(OBJS) ../Common/.platform ../Common/platform