--- truecrypt/linux/cli/makefile 2018/04/24 16:43:12 1.1.1.1 +++ truecrypt/linux/cli/makefile 2018/04/24 16:47:48 1.1.1.6 @@ -1,9 +1,15 @@ -# TrueCrypt Linux Makefile +# +# Copyright (c) TrueCrypt Foundation. All rights reserved. +# +# Covered by the TrueCrypt License 2.3 the full text of which is contained +# in the file License.txt included in TrueCrypt binary and source code +# distribution packages. +# TC_COMMON := ../../Common TC_CRYPTO := ../../Crypto -CC := gcc +CC ?= gcc ifneq ($(MAKECMDGOALS),clean) -include ../Common/.platform @@ -14,18 +20,20 @@ CFLAGS := -w else CFLAGS := -W endif -CFLAGS += -I../../Crypto -I../../Common -I../Kernel -CFLAGS += -D_cdecl="" -DBOOL=int -DTRUE=1 -DFALSE=0 -DMAX_PATH=260 +CFLAGS += -I../../Crypto -I../../Common -I../Kernel -I../.. +CFLAGS += -DBOOL=int -DTRUE=1 -DFALSE=0 -DMAX_PATH=260 CFLAGS += $(TYPES) ifndef DEBUG +# Do not enable strict aliasing CFLAGS += -O2 -fno-strict-aliasing else CFLAGS += -ggdb +NO_STRIP := 1 endif -KERNEL_OBJS_F := ../.kernel-objs -USER_OBJS_F := ../.user-objs +KERNEL_OBJS_PRESENT := ../.kernel-objs +KERNEL_OBJS_CLEAN := ../.user-objs OBJS := $(TC_CRYPTO)/Aescrypt.o OBJS += $(TC_CRYPTO)/Aeskey.o @@ -48,45 +56,48 @@ OBJS += $(TC_CRYPTO)/Whirlpool.o OBJS += $(TC_COMMON)/Crc.o OBJS += $(TC_COMMON)/Crypto.o OBJS += $(TC_COMMON)/Endian.o +OBJS += $(TC_COMMON)/GfMul.o +OBJS += $(TC_COMMON)/Fat.o +OBJS += $(TC_COMMON)/Format.o OBJS += $(TC_COMMON)/Keyfiles.o OBJS += $(TC_COMMON)/Pkcs5.o +OBJS += $(TC_COMMON)/Random.o OBJS += $(TC_COMMON)/Volumes.o OBJS += $(TC_COMMON)/Tests.o OBJS += Cli.o %.o: %.c @echo Compiling $($@ +.PHONY: all clean man -all: objclean truecrypt +all: $(KERNEL_OBJS_CLEAN) truecrypt @echo Done. +$(KERNEL_OBJS_CLEAN): + @rm -f ${OBJS} $(KERNEL_OBJS_PRESENT) + @>$(KERNEL_OBJS_CLEAN) + ../Common/.platform: ../Common/Platform.c - @$(CC) -o ../Common/platform $< + @echo Compiling Platform.c + @$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o ../Common/platform $< + @echo Detecting platform options @../Common/platform >../Common/.platform -ifneq ($(MAKECMDGOALS),clean) --include $(OBJS:.o=.dep) -endif +-include $(OBJS:.o=.d) truecrypt: $(OBJS) - @echo Linking truecrypt - @$(CC) -o truecrypt $(OBJS) -ifndef DEBUG - @strip truecrypt + @echo Linking $@ + @$(CC) $(EXTRA_LFLAGS) -o $@ $(OBJS) +ifndef NO_STRIP + @strip $@ endif - + man: truecrypt.1 -truecrypt.1: objclean truecrypt +truecrypt.1: $(KERNEL_OBJS_CLEAN) truecrypt help2man -N -i Man/help2man.inc ./truecrypt >Man/truecrypt.1 - -objclean: - @if [ -f $(KERNEL_OBJS_F) ]; then rm -f ${OBJS} $(KERNEL_OBJS_F); fi - @>$(USER_OBJS_F) clean: - -rm -f truecrypt ${OBJS} *.dep $(TC_COMMON)/*.dep $(TC_CRYPTO)/*.dep ../Common/platform ../Common/.platform + -rm -f truecrypt ${OBJS} *.d $(TC_COMMON)/*.d $(TC_CRYPTO)/*.d ../Common/platform ../Common/.platform