"Fossies" - the Fresh Open Source Software Archive

Member "src/Boot/Windows/Makefile" (10 Oct 2018, 5444 Bytes) of package /windows/misc/VeraCrypt_1.23-Hotfix-2_Source.zip:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "Makefile": 1.21_Source_vs_1.22_Source.

    1 #
    2 # Derived from source code of TrueCrypt 7.1a, which is
    3 # Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
    4 # by the TrueCrypt License 3.0.
    5 #
    6 # Modifications and additions to the original source code (contained in this file)
    7 # and all other portions of this file are Copyright (c) 2013-2017 IDRIX
    8 # and are governed by the Apache License 2.0 the full text of which is
    9 # contained in the file License.txt included in VeraCrypt binary and source
   10 # code distribution packages.
   11 
   12 PROJ = BootLoader
   13 .SILENT:
   14 
   15 !ifndef MSVC16_ROOT
   16 !error Environment variable MSVC16_ROOT must point to the installation directory of MS Visual C++ 1.5
   17 !endif
   18 
   19 ENVPATH = $(PATH)
   20 
   21 CC = $(MSVC16_ROOT)\bin\cl.exe
   22 LD = $(MSVC16_ROOT)\bin\link.exe
   23 
   24 AFLAGS = /nologo /omf
   25 
   26 CFLAGS = /nologo /W3 /Fc /I "$(MSVC16_ROOT)\Include" /I"..\..\.." /I"..\..\..\Common" /I"..\..\..\Crypto"
   27 CFLAGS = $(CFLAGS) /D __int8=char /D __int16=int /D __int32=long /D BOOL=char /D FALSE=0 /D TRUE=1
   28 CFLAGS = $(CFLAGS) /D LITTLE_ENDIAN=1234 /D BYTE_ORDER=1234 /D TC_WINDOWS_BOOT /D TC_MINIMIZE_CODE_SIZE /D TC_NO_COMPILER_INT64
   29 CFLAGS = $(CFLAGS) /D malloc=malloc_NA
   30 
   31 LFLAGS = /NOLOGO /ONERROR:NOEXE /NOI /BATCH
   32 
   33 OBJDIR = Release
   34 
   35 !ifdef RESCUE_DISK
   36 OBJDIR = Rescue
   37 CFLAGS = $(CFLAGS) /D TC_WINDOWS_BOOT_RESCUE_DISK_MODE
   38 !endif
   39 
   40 !ifdef SINGLE_CIPHER
   41 OBJDIR = $(OBJDIR)_$(SINGLE_CIPHER)
   42 CFLAGS = $(CFLAGS) /D TC_WINDOWS_BOOT_SINGLE_CIPHER_MODE /D TC_WINDOWS_BOOT_$(SINGLE_CIPHER)
   43 !endif
   44 
   45 !ifdef SINGLE_PRF
   46 OBJDIR = $(OBJDIR)_$(SINGLE_PRF)
   47 CFLAGS = $(CFLAGS) /D TC_WINDOWS_BOOT_$(SINGLE_PRF)
   48 !else
   49 CFLAGS = $(CFLAGS) /D TC_WINDOWS_BOOT_RIPEMD160
   50 !endif
   51 
   52 OUTDIR = $(OBJDIR)
   53 TARGETEXT = com
   54 TARGETS = $(OUTDIR)\BootDefs.i $(OUTDIR)\BootSector.bin $(OUTDIR)\Decompressor.com
   55 CFLAGS = $(CFLAGS) /AT /Zl /f- /G3 /Oe /Os /Ob1 /OV0 /Gs /Gf /Gy /D NDEBUG
   56 LFLAGS = $(LFLAGS) /NOD /NOE /TINY
   57 OBJS = $(OUTDIR)\BootCrt.obj
   58 LIBS = slibce
   59 
   60 !if 1
   61 SRCDIR = ..
   62 !else
   63 SRCDIR = $(MAKEDIR)
   64 !endif
   65 
   66 TARGETS = $(TARGETS) $(OUTDIR)\$(PROJ).$(TARGETEXT)
   67 
   68 OBJS = $(OBJS) $(OUTDIR)\BootConfig.obj
   69 OBJS = $(OBJS) $(OUTDIR)\BootConsoleIo.obj
   70 OBJS = $(OBJS) $(OUTDIR)\BootDebug.obj
   71 OBJS = $(OBJS) $(OUTDIR)\BootDiskIo.obj
   72 OBJS = $(OBJS) $(OUTDIR)\BootEncryptedIo.obj
   73 OBJS = $(OBJS) $(OUTDIR)\BootMain.obj
   74 OBJS = $(OBJS) $(OUTDIR)\BootMemory.obj
   75 OBJS = $(OBJS) $(OUTDIR)\IntFilter.obj
   76 OBJS = $(OBJS) $(OUTDIR)\Platform.obj
   77 
   78 OBJS = $(OBJS) $(OUTDIR)\Crc.obj
   79 OBJS = $(OBJS) $(OUTDIR)\Crypto.obj
   80 OBJS = $(OBJS) $(OUTDIR)\Endian.obj
   81 OBJS = $(OBJS) $(OUTDIR)\Pkcs5.obj
   82 OBJS = $(OBJS) $(OUTDIR)\Volumes.obj
   83 OBJS = $(OBJS) $(OUTDIR)\Xts.obj
   84 
   85 !if "$(SINGLE_PRF)" == "SHA2"
   86 OBJS = $(OBJS) $(OUTDIR)\Sha2Small.obj
   87 !else
   88 OBJS = $(OBJS) $(OUTDIR)\Rmd160.obj
   89 !endif
   90 
   91 !if !DEFINED (SINGLE_CIPHER)
   92 OBJS = $(OBJS) $(OUTDIR)\AesSmall.obj
   93 !else if "$(SINGLE_CIPHER)" == "AES"
   94 OBJS = $(OBJS) $(OUTDIR)\Aes_hw_cpu.obj
   95 OBJS = $(OBJS) $(OUTDIR)\AesSmall_x86.obj
   96 OBJS = $(OBJS) $(OUTDIR)\Aestab.obj
   97 !endif
   98 
   99 !if !DEFINED (SINGLE_CIPHER) || "$(SINGLE_CIPHER)" == "SERPENT"
  100 OBJS = $(OBJS) $(OUTDIR)\Serpent.obj
  101 !endif
  102 
  103 !if !DEFINED (SINGLE_CIPHER) || "$(SINGLE_CIPHER)" == "TWOFISH"
  104 OBJS = $(OBJS) $(OUTDIR)\Twofish.obj
  105 !endif
  106 
  107 !if "$(SINGLE_CIPHER)" == "CAMELLIA"
  108 OBJS = $(OBJS) $(OUTDIR)\CamelliaSmall.obj
  109 !endif
  110 
  111 all: env $(TARGETS)
  112 
  113 env:
  114 	set INCLUDE=.
  115 	set LIB=.
  116 	set LIBPATH=.
  117 
  118 clean:
  119 	-del /q /s $(OBJDIR) >NUL:
  120 
  121 
  122 .asm{$(OUTDIR)}.obj:
  123 	cd $(OBJDIR)
  124 	$(AS) $(AFLAGS) /c "$(SRCDIR)\$<"
  125 	cd ..
  126 
  127 {..\..\Crypto}.asm{$(OUTDIR)}.obj:
  128 	cd $(OBJDIR)
  129 	echo $(<F)
  130 	nasm.exe -Xvc -f obj -Ox -o "$(<B).obj" -l "$(<B).lst" "$(SRCDIR)\$<"
  131 	cd ..
  132 
  133 {..\..\Crypto}.c{$(OUTDIR)}.obj:
  134 	cd $(OBJDIR)
  135 	set PATH=.
  136 	$(CC) $(CFLAGS) /c "$(SRCDIR)\$<"
  137 	set PATH=$(ENVPATH)
  138 	cd ..
  139 
  140 {..\..\Common}.c{$(OUTDIR)}.obj:
  141 	cd $(OBJDIR)
  142 	set PATH=.
  143 	$(CC) $(CFLAGS) /c "$(SRCDIR)\$<"
  144 	set PATH=$(ENVPATH)
  145 	cd ..
  146 
  147 .c{$(OUTDIR)}.obj:
  148 	cd $(OBJDIR)
  149 	set PATH=.
  150 	$(CC) $(CFLAGS) /c "$(SRCDIR)\$<"
  151 	set PATH=$(ENVPATH)
  152 	cd ..
  153 
  154 .cpp{$(OUTDIR)}.obj:
  155 	cd $(OBJDIR)
  156 	set PATH=.
  157 	$(CC) $(CFLAGS) /c "$(SRCDIR)\$<"
  158 	set PATH=$(ENVPATH)
  159 	cd ..
  160 
  161 $(OUTDIR)\BootDefs.i: BootDefs.h
  162 	cd $(OBJDIR)
  163 	set PATH=.
  164 	$(CC) $(CFLAGS) /D TC_ASM_PREPROCESS /P /EP "$(SRCDIR)\BootDefs.h"
  165 	set PATH=$(ENVPATH)
  166 	cd ..
  167 
  168 $(OUTDIR)\BootSector.bin: $(OUTDIR)\BootSector.obj
  169 	cd $(OBJDIR)
  170 	$(LD) $(LFLAGS) BootSector.obj,BootSector.bin,,,, >NUL:
  171 	-dd.exe conv=notrunc bs=512 if=BootSector.bin of=$(PROJ).flp 2>NUL:
  172 	cd ..
  173 
  174 $(OUTDIR)\Decompressor.com: $(OUTDIR)\BootCrt.obj $(OUTDIR)\Decompressor.obj
  175 	cd $(OBJDIR)
  176 	$(LD) $(LFLAGS) BootCrt.obj Decompressor.obj,Decompressor.com,Decompressor.map,$(MSVC16_ROOT)\lib\+slibce,,
  177 	-dd.exe conv=notrunc,sync bs=512 seek=1 if=Decompressor.com of=$(PROJ).flp 2>NUL:
  178 	cd ..
  179 
  180 $(OUTDIR)\$(PROJ).$(TARGETEXT): $(OBJS)
  181 	@echo Linking...
  182 	cd $(OBJDIR)
  183 
  184 	echo >NUL: @<<$(PROJ).crf2
  185 
  186 $(PROJ).$(TARGETEXT)
  187 $(PROJ).map
  188 $(MSVC16_ROOT)\lib\+
  189 $(LIBS)
  190 ;
  191 <<
  192 	del $(PROJ).crf >NUL: 2>NUL:
  193 	for %F in ($(**F)) do @echo %F + >>$(PROJ).crf
  194 	type $(PROJ).crf2 >>$(PROJ).crf
  195 
  196 	$(LD) $(LFLAGS) @$(PROJ).crf
  197 	del $(PROJ).crf $(PROJ).crf2
  198 
  199 # Compress the Rescue Disk botloader for Cascades and Serpent since it is too big (size > 31232 bytes)
  200 #!if DEFINED(RESCUE_DISK) && (!DEFINED (SINGLE_CIPHER) || ("$(SINGLE_CIPHER)" == "SERPENT") || ("$(SINGLE_CIPHER)" == "CAMELLIA"))
  201 	upx $(PROJ).$(TARGETEXT)
  202 #!endif
  203 	gzip.exe -c -n --best $(PROJ).$(TARGETEXT) >$(PROJ).$(TARGETEXT).gz
  204 	-dd.exe conv=notrunc,sync bs=512 seek=5 if=$(PROJ).$(TARGETEXT).gz of=$(PROJ).flp 2>NUL:
  205 	cd ..