"Fossies" - the Fresh Open Source Software Archive

Member "src/Main/Main.make" (10 Oct 2018, 11789 Bytes) of package /windows/misc/VeraCrypt_1.23-Hotfix-2_Source.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Make source code syntax highlighting (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 "Main.make": 1.22_Source_vs_1.23_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 
   13 OBJS :=
   14 OBJS += Application.o
   15 OBJS += CommandLineInterface.o
   16 OBJS += FavoriteVolume.o
   17 OBJS += LanguageStrings.o
   18 OBJS += StringFormatter.o
   19 OBJS += TextUserInterface.o
   20 OBJS += UserInterface.o
   21 OBJS += UserPreferences.o
   22 OBJS += Xml.o
   23 OBJS += Unix/Main.o
   24 OBJS += Resources.o
   25 
   26 ifndef TC_NO_GUI
   27 OBJS += FatalErrorHandler.o
   28 OBJS += GraphicUserInterface.o
   29 OBJS += VolumeHistory.o
   30 OBJS += Forms/AboutDialog.o
   31 OBJS += Forms/BenchmarkDialog.o
   32 OBJS += Forms/ChangePasswordDialog.o
   33 OBJS += Forms/DeviceSelectionDialog.o
   34 OBJS += Forms/EncryptionOptionsWizardPage.o
   35 OBJS += Forms/EncryptionTestDialog.o
   36 OBJS += Forms/FavoriteVolumesDialog.o
   37 OBJS += Forms/Forms.o
   38 OBJS += Forms/InfoWizardPage.o
   39 OBJS += Forms/KeyfileGeneratorDialog.o
   40 OBJS += Forms/KeyfilesDialog.o
   41 OBJS += Forms/KeyfilesPanel.o
   42 OBJS += Forms/LegalNoticesDialog.o
   43 OBJS += Forms/MainFrame.o
   44 OBJS += Forms/MountOptionsDialog.o
   45 OBJS += Forms/NewSecurityTokenKeyfileDialog.o
   46 OBJS += Forms/PreferencesDialog.o
   47 OBJS += Forms/ProgressWizardPage.o
   48 OBJS += Forms/RandomPoolEnrichmentDialog.o
   49 OBJS += Forms/SecurityTokenKeyfilesDialog.o
   50 OBJS += Forms/SelectDirectoryWizardPage.o
   51 OBJS += Forms/VolumePasswordPanel.o
   52 OBJS += Forms/VolumePropertiesDialog.o
   53 OBJS += Forms/VolumeCreationProgressWizardPage.o
   54 OBJS += Forms/VolumeCreationWizard.o
   55 OBJS += Forms/VolumeFormatOptionsWizardPage.o
   56 OBJS += Forms/VolumeLocationWizardPage.o
   57 OBJS += Forms/VolumePasswordWizardPage.o
   58 OBJS += Forms/VolumePimWizardPage.o
   59 OBJS += Forms/VolumeSizeWizardPage.o
   60 OBJS += Forms/WaitDialog.o
   61 OBJS += Forms/WizardFrame.o
   62 endif
   63 
   64 ifndef DISABLE_PRECOMPILED_HEADERS
   65 PCH := SystemPrecompiled.h.gch
   66 endif
   67 
   68 RESOURCES :=
   69 RESOURCES += ../License.txt.h
   70 RESOURCES += ../Common/Language.xml.h
   71 ifndef TC_NO_GUI
   72 RESOURCES += ../Common/Textual_logo_96dpi.bmp.h
   73 RESOURCES += ../Format/VeraCrypt_Wizard.bmp.h
   74 RESOURCES += ../Mount/Drive_icon_96dpi.bmp.h
   75 RESOURCES += ../Mount/Drive_icon_mask_96dpi.bmp.h
   76 RESOURCES += ../Mount/Logo_96dpi.bmp.h
   77 endif
   78 
   79 CXXFLAGS += -I$(BASE_DIR)/Main
   80 
   81 
   82 #------ wxWidgets configuration ------
   83 
   84 ifdef TC_NO_GUI
   85 ifdef VC_WX_STATIC
   86 WX_CONFIG_LIBS := base
   87 else
   88 WX_CONFIG_LIBS := adv,core,base
   89 endif
   90 else
   91 WX_CONFIG_LIBS := adv,core,base
   92 endif
   93 
   94 ifeq "$(TC_BUILD_CONFIG)" "Release"
   95 
   96 CXXFLAGS += $(shell $(WX_CONFIG) $(WX_CONFIG_ARGS) --cxxflags)
   97 WX_LIBS = $(shell $(WX_CONFIG) $(WX_CONFIG_ARGS) --libs $(WX_CONFIG_LIBS))
   98 
   99 else
  100 
  101 CXXFLAGS += $(shell $(WX_CONFIG) --debug $(WX_CONFIG_ARGS) --cxxflags)
  102 WX_LIBS = $(shell $(WX_CONFIG) --debug $(WX_CONFIG_ARGS) --libs $(WX_CONFIG_LIBS))
  103 
  104 endif
  105 
  106 
  107 #------ FUSE configuration ------
  108 
  109 ifeq "$(PLATFORM)" "MacOSX"
  110 FUSE_LIBS = $(shell pkg-config osxfuse --libs)
  111 else
  112 FUSE_LIBS = $(shell pkg-config fuse --libs)
  113 endif
  114 
  115 #------ Executable ------
  116 
  117 export TC_VERSION := $(shell grep VERSION_STRING ../Common/Tcdefs.h | head -n 1 | cut -d'"' -f 2)
  118 
  119 #------ Linux package naming ------
  120 ifeq "$(PLATFORM)" "Linux"
  121 
  122 ifdef TC_NO_GUI
  123 INSTALLER_TYPE := console
  124 ifeq "$(origin NOSSE2)" "command line"
  125 PACKAGE_NAME := $(APPNAME)_$(TC_VERSION)_console_$(PLATFORM_ARCH)_legacy.tar.gz
  126 else
  127 PACKAGE_NAME := $(APPNAME)_$(TC_VERSION)_console_$(PLATFORM_ARCH).tar.gz
  128 endif
  129 else
  130 INSTALLER_TYPE := gui
  131 ifeq "$(origin NOSSE2)" "command line"
  132 PACKAGE_NAME := $(APPNAME)_$(TC_VERSION)_$(PLATFORM_ARCH)_legacy.tar.gz
  133 else
  134 PACKAGE_NAME := $(APPNAME)_$(TC_VERSION)_$(PLATFORM_ARCH).tar.gz
  135 endif
  136 endif
  137 
  138 ifeq "$(origin NOSSE2)" "command line"
  139 INTERNAL_INSTALLER_NAME := veracrypt_install_$(INSTALLER_TYPE)_$(CPU_ARCH)_legacy.sh
  140 INSTALLER_NAME := veracrypt-$(TC_VERSION)-setup-$(INSTALLER_TYPE)-$(CPU_ARCH)-legacy
  141 else
  142 INTERNAL_INSTALLER_NAME := veracrypt_install_$(INSTALLER_TYPE)_$(CPU_ARCH).sh
  143 INSTALLER_NAME := veracrypt-$(TC_VERSION)-setup-$(INSTALLER_TYPE)-$(CPU_ARCH)
  144 endif
  145 
  146 endif
  147 #-----------------------------------
  148 
  149 #------ FreeBSD package naming ------
  150 ifeq "$(PLATFORM)" "FreeBSD"
  151 
  152 SYSTEMNAME = $(shell uname -n)
  153 
  154 ifdef TC_NO_GUI
  155 INSTALLER_TYPE := console
  156 PACKAGE_NAME := $(APPNAME)_$(TC_VERSION)_$(SYSTEMNAME)_console_$(PLATFORM_ARCH).tar.gz
  157 else
  158 INSTALLER_TYPE := gui
  159 PACKAGE_NAME := $(APPNAME)_$(TC_VERSION)_$(SYSTEMNAME)_$(PLATFORM_ARCH).tar.gz
  160 endif
  161 
  162 INTERNAL_INSTALLER_NAME := veracrypt_install_f$(SYSTEMNAME)_$(INSTALLER_TYPE)_$(CPU_ARCH).sh
  163 INSTALLER_NAME := veracrypt-$(TC_VERSION)-$(SYSTEMNAME)-setup-$(INSTALLER_TYPE)-$(CPU_ARCH)
  164 
  165 endif
  166 #-----------------------------------
  167 
  168 $(APPNAME): $(LIBS) $(OBJS)
  169     @echo Linking $@
  170     $(CXX) -o $(APPNAME) $(OBJS) $(LIBS) $(FUSE_LIBS) $(WX_LIBS) $(LFLAGS)
  171 
  172 ifeq "$(TC_BUILD_CONFIG)" "Release"
  173 ifndef NOSTRIP
  174     strip $(APPNAME)
  175 endif
  176 
  177 ifndef NOTEST
  178     ./$(APPNAME) --text --test >/dev/null || exit 1
  179 endif
  180 
  181 ifeq "$(PLATFORM_UNSUPPORTED)" "1"
  182     @echo; echo "WARNING: This platform may be unsupported. To avoid possible serious problems, please read the chapter pertaining to $(PLATFORM) in Readme.txt."; echo
  183 endif
  184 endif
  185 
  186 ifeq "$(PLATFORM)" "MacOSX"
  187 prepare: $(APPNAME)
  188     mkdir -p $(APPNAME).app/Contents/MacOS $(APPNAME).app/Contents/Resources/doc/HTML
  189     -rm -f $(APPNAME).app/Contents/MacOS/$(APPNAME)
  190     -rm -f $(APPNAME).app/Contents/MacOS/$(APPNAME)_console
  191 
  192 ifeq "$(TC_BUILD_CONFIG)" "Release"
  193 ifdef TC_NO_GUI
  194     cp $(PWD)/Main/$(APPNAME) $(APPNAME).app/Contents/MacOS/$(APPNAME)_console
  195 else
  196     cp $(PWD)/Main/$(APPNAME) $(APPNAME).app/Contents/MacOS/$(APPNAME)
  197 endif
  198 else
  199 ifdef TC_NO_GUI
  200     -rm -f $(PWD)/Main/$(APPNAME)_console
  201     cp $(PWD)/Main/$(APPNAME) $(PWD)/Main/$(APPNAME)_console
  202     -ln -sf $(PWD)/Main/$(APPNAME)_console $(APPNAME).app/Contents/MacOS/$(APPNAME)_console
  203 else
  204     -ln -sf $(PWD)/Main/$(APPNAME) $(APPNAME).app/Contents/MacOS/$(APPNAME)
  205 endif
  206 endif
  207 
  208     cp $(PWD)/Resources/Icons/VeraCrypt.icns $(APPNAME).app/Contents/Resources
  209     cp $(PWD)/Resources/Icons/VeraCrypt_Volume.icns $(APPNAME).app/Contents/Resources
  210     cp $(PWD)/../doc/html/* $(APPNAME).app/Contents/Resources/doc/HTML
  211 
  212     echo -n APPLTRUE >$(APPNAME).app/Contents/PkgInfo
  213     sed -e 's/_VERSION_/$(patsubst %a,%.1,$(patsubst %b,%.2,$(TC_VERSION)))/' ../Build/Resources/MacOSX/Info.plist.xml >$(APPNAME).app/Contents/Info.plist
  214     codesign -s "Developer ID Application: IDRIX (Z933746L2S)" --timestamp $(APPNAME).app
  215 
  216 install: prepare
  217     cp -R $(APPNAME).app /Applications/.
  218 
  219 package: prepare
  220     /usr/local/bin/packagesbuild $(PWD)/Setup/MacOSX/veracrypt.pkgproj
  221     productsign --sign "Developer ID Installer: IDRIX (Z933746L2S)" --timestamp "$(PWD)/Setup/MacOSX/VeraCrypt $(TC_VERSION).pkg" $(PWD)/Setup/MacOSX/VeraCrypt_$(TC_VERSION).pkg
  222     rm -f $(APPNAME)_$(TC_VERSION).dmg
  223     rm -f "$(PWD)/Setup/MacOSX/template.dmg"
  224     rm -fr "$(PWD)/Setup/MacOSX/VeraCrypt_dmg"
  225     mkdir -p "$(PWD)/Setup/MacOSX/VeraCrypt_dmg"
  226     bunzip2 -k -f "$(PWD)/Setup/MacOSX/template.dmg.bz2"
  227     hdiutil attach "$(PWD)/Setup/MacOSX/template.dmg" -noautoopen -quiet -mountpoint "$(PWD)/Setup/MacOSX/VeraCrypt_dmg"
  228     cp "$(PWD)/Setup/MacOSX/VeraCrypt_$(TC_VERSION).pkg" "$(PWD)/Setup/MacOSX/VeraCrypt_dmg/VeraCrypt_Installer.pkg"
  229     hdiutil detach "$(PWD)/Setup/MacOSX/VeraCrypt_dmg" -quiet -force
  230     hdiutil convert "$(PWD)/Setup/MacOSX/template.dmg" -quiet -format UDZO -imagekey zlib-level=9 -o $(APPNAME)_$(TC_VERSION).dmg
  231     rm -f "$(PWD)/Setup/MacOSX/template.dmg"
  232     rm -fr "$(PWD)/Setup/MacOSX/VeraCrypt_dmg"
  233 endif
  234 
  235 
  236 
  237 ifeq "$(PLATFORM)" "Linux"
  238 prepare: $(APPNAME)
  239     rm -fr $(PWD)/Setup/Linux/usr
  240     mkdir -p $(PWD)/Setup/Linux/usr/bin
  241     mkdir -p $(PWD)/Setup/Linux/usr/share/$(APPNAME)/doc/HTML
  242     cp $(PWD)/Main/$(APPNAME) $(PWD)/Setup/Linux/usr/bin/$(APPNAME)
  243     cp $(PWD)/Setup/Linux/$(APPNAME)-uninstall.sh $(PWD)/Setup/Linux/usr/bin/$(APPNAME)-uninstall.sh
  244     chmod +x $(PWD)/Setup/Linux/usr/bin/$(APPNAME)-uninstall.sh
  245     cp $(PWD)/License.txt $(PWD)/Setup/Linux/usr/share/$(APPNAME)/doc/License.txt
  246     cp $(PWD)/../doc/html/* "$(PWD)/Setup/Linux/usr/share/$(APPNAME)/doc/HTML"
  247 
  248 ifndef TC_NO_GUI
  249     mkdir -p $(PWD)/Setup/Linux/usr/share/applications
  250     mkdir -p $(PWD)/Setup/Linux/usr/share/pixmaps
  251     cp $(PWD)/Resources/Icons/VeraCrypt-256x256.xpm $(PWD)/Setup/Linux/usr/share/pixmaps/$(APPNAME).xpm
  252     cp $(PWD)/Setup/Linux/$(APPNAME).desktop $(PWD)/Setup/Linux/usr/share/applications/$(APPNAME).desktop
  253 endif
  254 
  255 
  256 install: prepare
  257     cp -R $(CURDIR)/Setup/Linux/usr $(DESTDIR)/.
  258 
  259 ifeq "$(TC_BUILD_CONFIG)" "Release"
  260 package: prepare
  261     tar cfz $(PWD)/Setup/Linux/$(PACKAGE_NAME) --directory $(PWD)/Setup/Linux usr
  262 
  263     @rm -fr $(INTERNAL_INSTALLER_NAME)
  264     @echo "#!/bin/sh" > $(INTERNAL_INSTALLER_NAME)
  265     @echo "VERSION=$(TC_VERSION)" >> $(INTERNAL_INSTALLER_NAME)
  266     @echo "PACKAGE_TYPE=tar" >> $(INTERNAL_INSTALLER_NAME)
  267     @echo "PACKAGE_NAME=$(PACKAGE_NAME)" >> $(INTERNAL_INSTALLER_NAME)
  268     @echo "PACKAGE_START=1107" >> $(INTERNAL_INSTALLER_NAME)
  269     @echo "INSTALLER_TYPE=$(INSTALLER_TYPE)" >> $(INTERNAL_INSTALLER_NAME)
  270 
  271     @cat $(PWD)/Setup/Linux/veracrypt_install_template.sh >> $(INTERNAL_INSTALLER_NAME)
  272     @cat $(PWD)/Setup/Linux/$(PACKAGE_NAME) >> $(INTERNAL_INSTALLER_NAME)
  273     chmod +x $(INTERNAL_INSTALLER_NAME)
  274 
  275     rm -fr $(PWD)/Setup/Linux/packaging
  276     mkdir -p $(PWD)/Setup/Linux/packaging
  277     cp $(INTERNAL_INSTALLER_NAME) $(PWD)/Setup/Linux/packaging/.
  278     makeself $(PWD)/Setup/Linux/packaging $(PWD)/Setup/Linux/$(INSTALLER_NAME) "VeraCrypt $(TC_VERSION) Installer" ./$(INTERNAL_INSTALLER_NAME)
  279 
  280 endif
  281 
  282 endif
  283 
  284 ifeq "$(PLATFORM)" "FreeBSD"
  285 prepare: $(APPNAME)
  286     rm -fr $(PWD)/Setup/FreeBSD/usr
  287     mkdir -p $(PWD)/Setup/FreeBSD/usr/bin
  288     mkdir -p $(PWD)/Setup/FreeBSD/usr/share/$(APPNAME)/doc/HTML
  289     cp $(PWD)/Main/$(APPNAME) $(PWD)/Setup/FreeBSD/usr/bin/$(APPNAME)
  290     cp $(PWD)/Setup/Linux/$(APPNAME)-uninstall.sh $(PWD)/Setup/FreeBSD/usr/bin/$(APPNAME)-uninstall.sh
  291     chmod +x $(PWD)/Setup/FreeBSD/usr/bin/$(APPNAME)-uninstall.sh
  292     cp $(PWD)/License.txt $(PWD)/Setup/FreeBSD/usr/share/$(APPNAME)/doc/License.txt
  293     cp $(PWD)/../doc/html/* "$(PWD)/Setup/FreeBSD/usr/share/$(APPNAME)/doc/HTML"
  294 
  295 ifndef TC_NO_GUI
  296     mkdir -p $(PWD)/Setup/FreeBSD/usr/share/applications
  297     mkdir -p $(PWD)/Setup/FreeBSD/usr/share/pixmaps
  298     cp $(PWD)/Resources/Icons/VeraCrypt-256x256.xpm $(PWD)/Setup/FreeBSD/usr/share/pixmaps/$(APPNAME).xpm
  299     cp $(PWD)/Setup/Linux/$(APPNAME).desktop $(PWD)/Setup/FreeBSD/usr/share/applications/$(APPNAME).desktop
  300 endif
  301     chown -R root:wheel $(PWD)/Setup/FreeBSD/usr
  302     chmod -R go-w $(PWD)/Setup/FreeBSD/usr
  303 
  304 
  305 install: prepare
  306     cp -R $(CURDIR)/Setup/FreeBSD/usr $(DESTDIR)/.
  307 
  308 ifeq "$(TC_BUILD_CONFIG)" "Release"
  309 package: prepare
  310     tar cfz $(PWD)/Setup/FreeBSD/$(PACKAGE_NAME) --directory $(PWD)/Setup/FreeBSD usr
  311 
  312     @rm -fr $(INTERNAL_INSTALLER_NAME)
  313     @echo "#!/bin/sh" > $(INTERNAL_INSTALLER_NAME)
  314     @echo "VERSION=$(TC_VERSION)" >> $(INTERNAL_INSTALLER_NAME)
  315     @echo "PACKAGE_TYPE=tar" >> $(INTERNAL_INSTALLER_NAME)
  316     @echo "PACKAGE_NAME=$(PACKAGE_NAME)" >> $(INTERNAL_INSTALLER_NAME)
  317     @echo "PACKAGE_START=1107" >> $(INTERNAL_INSTALLER_NAME)
  318     @echo "INSTALLER_TYPE=$(INSTALLER_TYPE)" >> $(INTERNAL_INSTALLER_NAME)
  319 
  320     @cat $(PWD)/Setup/FreeBSD/veracrypt_install_template.sh >> $(INTERNAL_INSTALLER_NAME)
  321     @cat $(PWD)/Setup/FreeBSD/$(PACKAGE_NAME) >> $(INTERNAL_INSTALLER_NAME)
  322     chmod +x $(INTERNAL_INSTALLER_NAME)
  323 
  324     rm -fr $(PWD)/Setup/FreeBSD/packaging
  325     mkdir -p $(PWD)/Setup/FreeBSD/packaging
  326     cp $(INTERNAL_INSTALLER_NAME) $(PWD)/Setup/FreeBSD/packaging/.
  327     makeself $(PWD)/Setup/FreeBSD/packaging $(PWD)/Setup/FreeBSD/$(INSTALLER_NAME) "VeraCrypt $(TC_VERSION) $(SYSTEMNAME) Installer" ./$(INTERNAL_INSTALLER_NAME)
  328 
  329 endif
  330 
  331 endif
  332 
  333 $(OBJS): $(PCH)
  334 
  335 Resources.o: $(RESOURCES)
  336 
  337 include $(BUILD_INC)/Makefile.inc