wireshark/packaging/portableapps/Makefile.nmake

142 lines
4.4 KiB
Makefile

#
TOPDIR = ..\..
TOOLS_DIR = $(TOPDIR)\tools
include ../../config.nmake
PROGRAM_PORTABLE = $(PROGRAM_NAME)Portable
STAGING_DIR = $(PROGRAM_PORTABLE)
APP = $(STAGING_DIR)\App
APPINFO = $(APP)\AppInfo
LAUNCHER_DIR = $(APPINFO)\Launcher
WIRESHARK_DIR = $(APP)\$(PROGRAM_NAME)
DATA = $(STAGING_DIR)\Data
OTHER = $(STAGING_DIR)\Other
SOURCE = $(OTHER)\Source
APPINFO_INI = $(APPINFO)\appinfo.ini
LAUNCHER_INI = $(LAUNCHER_DIR)\$(PROGRAM_PORTABLE).ini
WSMANIFEST = ../wireshark.manifest
NSIS_PLUGINS = nsis-plugins
FINDPROCDLL = $(WIRESHARK_LIB_DIR)\$(NSIS_PLUGINS)\FindProcDLL.dll
COPY = xcopy
MKDIR = mkdir
COPY_FLAGS = /d /y
!IFNDEF WIN32_SETUP_OPT
WIN32_SETUP_OPT = --download
!ENDIF
NSIS_DIR = $(TOPDIR)\packaging\nsis
# XXX This should be defined in config.nmake.
!IF EXIST("$(TOPDIR)\wireshark-qt-release\wireshark.exe")
QT_DIR = "$(TOPDIR)\wireshark-qt-release"
!ENDIF
!IF EXIST("$(TOPDIR)\wireshark-qt-release\Qt5Core.dll")
NEED_QT5_DLL = USE
!ENDIF
!IF EXIST("$(TOPDIR)\wireshark-qt-release\QtCore4.dll")
NEED_QT4_DLL = USE
!ENDIF
UPX_FLAGS = -q
PAPPS_VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_MICRO).0
PAPPS_PACKAGE=$(PROGRAM_PORTABLE)-$(VERSION).paf.exe
all: package
package: $(PAPPS_PACKAGE)
dirs:
if not exist $(STAGING_DIR) $(MKDIR) $(STAGING_DIR)
if not exist $(APP) $(MKDIR) $(APP)
if not exist $(APPINFO) $(MKDIR) $(APPINFO)
if not exist $(LAUNCHER_DIR) $(MKDIR) $(LAUNCHER_DIR)
if not exist $(WIRESHARK_DIR) $(MKDIR) $(WIRESHARK_DIR)
if not exist $(DATA) $(MKDIR) $(DATA)
if not exist $(OTHER) $(MKDIR) $(OTHER)
if not exist $(SOURCE) $(MKDIR) $(SOURCE)
# XXX - Figure out how to use the PA AppCompactor non-interactively and
# use it instead.
#pack: distribution
#!IFDEF UPX
# -$(UPX) $(UPX_FLAGS) $(FILES)\$(APP)\$(WIRESHARK)\[a-z]*.exe
# -$(UPX) $(UPX_FLAGS) $(FILES)\$(APP)\$(WIRESHARK)\*.dll
# -$(UPX) $(UPX_FLAGS) $(FILES)\$(APP)\$(WIRESHARK)\plugins\$(VERSION)\*.dll
# -$(UPX) $(UPX_FLAGS) $(FILES)\$(APP)\$(WIRESHARK)\lib\gtk-2.0\$(GTK_LIB_DIR)\loaders\*.dll
# -$(UPX) $(UPX_FLAGS) $(FILES)\$(APP)\$(WIRESHARK)\lib\gtk-2.0\$(GTK_LIB_DIR)\immodules\*.dll
# -$(UPX) $(UPX_FLAGS) $(FILES)\$(APP)\$(WIRESHARK)\$(GTK_WIMP_DLLDST_DIR)\*.dll
#!ENDIF
$(APPINFO_INI): dirs appinfo.tmpl $(TOPDIR)\config.nmake
sed -e 's/$$(PAPPS_VERSION)/$(PAPPS_VERSION)/g' \
-e 's/$$(VERSION)/$(VERSION)/g' \
< appinfo.tmpl > $@
$(LAUNCHER_INI): dirs $(PROGRAM_PORTABLE).ini
copy $(PROGRAM_PORTABLE).ini $(LAUNCHER_INI) /y
appinfo: $(APPINFO_INI) $(LAUNCHER_INI)
copy help.html $(STAGING_DIR)\help.html /y
copy $(TOPDIR)\image\wireshark.ico $(APPINFO)\appicon.ico /y
copy $(TOPDIR)\image\wsicon16.png $(APPINFO)\appicon_16.png /y
copy $(TOPDIR)\image\wsicon32.png $(APPINFO)\appicon_32.png /y
copy $(TOPDIR)\image\wsicon128.png $(APPINFO)\appicon_128.png /y
# It'd be nice if we could get some sort of status or debugging output. For now
# just cross our fingers.
applauncher: appinfo
$(PORTABLEAPPS_DIR)\PortableApps.comLauncher\PortableApps.comLauncherGenerator.exe \
$(MAKEDIR)\$(PROGRAM_PORTABLE)
appbinaries: applauncher
xcopy $(TOPDIR)\wireshark-qt-release $(WIRESHARK_DIR) /D /I /E /Y
xcopy $(TOPDIR)\extcap\androiddump.exe $(WIRESHARK_DIR)\extcap /d
xcopy $(TOPDIR)\capinfos.exe $(WIRESHARK_DIR) /d
xcopy $(TOPDIR)\captype.exe $(WIRESHARK_DIR) /d
xcopy $(TOPDIR)\dumpcap.exe $(WIRESHARK_DIR) /d
xcopy $(TOPDIR)\editcap.exe $(WIRESHARK_DIR) /d
xcopy $(TOPDIR)\mergecap.exe $(WIRESHARK_DIR) /d
xcopy $(TOPDIR)\randpkt.exe $(WIRESHARK_DIR) /d
xcopy $(TOPDIR)\reordercap.exe $(WIRESHARK_DIR) /d
xcopy $(TOPDIR)\rawshark.exe $(WIRESHARK_DIR) /d
xcopy $(TOPDIR)\text2pcap.exe $(WIRESHARK_DIR) /d
xcopy $(TOPDIR)\tfshark.exe $(WIRESHARK_DIR) /d
xcopy $(TOPDIR)\tshark.exe $(WIRESHARK_DIR) /d
source: dirs
$(COPY) readme.txt $(SOURCE) $(COPY_FLAGS)
$(TEXTIFY) -Destination $(SOURCE) \
$(TOPDIR)/COPYING \
$(TOPDIR)/NEWS \
$(TOPDIR)/README.windows
$(PAPPS_PACKAGE) : dirs appinfo appbinaries source
!IFDEF PORTABLEAPPS_DIR
$(PORTABLEAPPS_DIR)\PortableApps.comInstaller\PortableApps.comInstaller.exe \
$(MAKEDIR)\$(PROGRAM_PORTABLE)
!ELSE
!MESSAGE PORTABLEAPPS_DIR not configured in config.nmake. Skipping.
!ENDIF
clean:
cd ..
$(MAKE) -f Makefile.nmake $@
cd portableapps
rm -rf $(STAGING_DIR)
rm -rf appinfo.ini
rm -rf $(PAPPS_PACKAGE)
rm -rf *~ *.*~
distclean: clean
rm -rf WiresharkPortable*.paf.exe
maintainer-clean: distclean