Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: installer/Makefile

Issue 6202981292703744: Whole installer (Closed)
Patch Set: Created June 24, 2014, 7:27 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 #---------------------------------- 1 #----------------------------------
2 # Makefile for Microsoft NMAKE 2 # Makefile for Microsoft NMAKE
3 # 3 #
4 # Call with only the version parameter to set the default target to all installe rs. 4 # Argument: VERSION
5 # nmake VERSION=1.2.3 5 # Version number to incorporate into the file names of targets
6 # Call with a definition of the NMAKE variable ARCH on the command line 6 # Defaults to 99.9 if not specified.
7 # nmake VERSION=1.2.3 ARCH=ia32 7 #
8 # nmake VERSION=1.2.3 ARCH=x64 8 # Target: ia32
9 # If an architecture is specified, the default target is constrained to it. 9 # Release version of the multilanguage, 32-bit MSI
10 # File name = adblockplusie-VERSION-multilanguage-ia32.msi
11 # Target: x64
12 # Release version of the multilanguage, 64-bit MSI
13 # File name = adblockplusie-VERSION-multilanguage-x64.msi
14 # Target: setup
15 # Release version of the executable bundle of both of the above MSI
16 # File name = adblockplusie-VERSION.exe
10 #---------------------------------- 17 #----------------------------------
11 18
12 .SUFFIXES: .msi .wixobj .wxs 19 Build_Dir_ia32 = build\ia32\ # comment prevents newline
13 20 Build_Dir_x64 = build\x64\ #
14 Build_Dir_common = ..\build\ # 21 Build_Dir_common = build\common\ #
15 Build_Dir_ia32 = ..\build\ia32\ # comment prevents newline
16 Build_Dir_x64 = ..\build\x64\ #
17
18 !ifndef Configuration
19 Configuration = Release
20 !endif
21 22
22 !ifndef VERSION 23 !ifndef VERSION
23 VERSION = 99.9 24 VERSION = 99.9
24 !endif 25 !endif
25 26
27 Installer_ia32_name = adblockplusie-$(VERSION)-multilanguage-ia32
28 Installer_ia32_base = $(Build_Dir_ia32)$(Installer_ia32_name)
29 Installer_ia32_msi = $(Installer_ia32_base).msi
30 Installer_ia32_archive = $(Installer_ia32_base).7z
31 Installer_ia32_exe = $(Installer_ia32_base).exe
32
33 Installer_x64_name = adblockplusie-$(VERSION)-multilanguage-x64
34 Installer_x64_base = $(Build_Dir_x64)$(Installer_x64_name)
35 Installer_x64_msi = $(Installer_x64_base).msi
36 Installer_x64_archive = $(Installer_x64_base).7z
37 Installer_x64_exe = $(Installer_x64_base).exe
38
39 Setup = $(Build_Dir_common)Release\adblockplusie-$(VERSION).exe
40
26 #--------------------- 41 #---------------------
27 # Default Targets 42 # Top-Level Targets
28 #
29 # We change the default rule depending upon the ARCH (architecture) definition.
30 #--------------------- 43 #---------------------
31 44
32 Installer_ia32 = $(Build_Dir_ia32)adblockplusie-$(VERSION)-en-us-ia32.msi
33 Installer_x64 = $(Build_Dir_x64)adblockplusie-$(VERSION)-en-us-x64.msi
34 Setup = $(Build_Dir_common)adblockplusie-$(VERSION).exe
35
36 !ifndef ARCH
37 default: $(Installer_ia32) $(Installer_x64)
38 !elseif "$(ARCH)"=="ia32"
39 default: $(Installer_ia32)
40 !elseif "$(ARCH)"=="x64"
41 default: $(Installer_x64)
42 !else
43 !error Unknown variable ARCH=$(ARCH)
44 !endif
45
46 default: 45 default:
47 @echo Available targets 46 @echo Available targets
48 @echo - ia32 47 @echo - ia32
49 @echo - x64 48 @echo - x64
50 @echo - setup 49 @echo - setup
51 @echo - install-ia32
52 @echo - install-x64
53 50
54 all: ia32 x64 setup 51 ia32: $(Installer_ia32_msi)
55 52
56 ia32: $(Installer_ia32) 53 x64: $(Installer_x64_msi)
57
58 x64: $(Installer_x64)
59 54
60 setup: $(Setup) 55 setup: $(Setup)
61 56
57
62 #--------------------- 58 #---------------------
63 # candle .wxs --> .wixobj 59 # MSI
60 # The real work happens in MSBuild.
61 # The output of MSBuild has a fixed name; we need a parametric one.
64 #--------------------- 62 #---------------------
65 63
66 Candle = candle -nologo -dNoDefault -dVersion=$(VERSION) "-dConfiguration=$(Conf iguration)" $(CANDLE_FLAGS) $** -out $@ 64 MSBuild_Output_ia32 = $(Build_Dir_ia32)adblockplusie-FINAL-ia32.msi
65 MSBuild_Output_x64 = $(Build_Dir_x64)adblockplusie-FINAL-x64.msi
67 66
68 objects_common = $(Build_Dir_common)custom_WixUI_InstallDir.wixobj 67 #
69 $(objects_common): custom_WixUI_InstallDir.wxs 68 # NMAKE has no way of specifying that these MSBuild rules have their own
70 » » $(Candle) 69 # dependencies and thus should be considered the moral equivalent of part of the
70 # Makefile. For -a (all) builds, this isn't a problem. For incremental builds,
71 # use the 'clean-*' targets below to delete the MSBuild outputs. This forces an
72 # invocation of MSBuild because its targets are absent. The last step of the
73 # MSBuild process is a file copy, so it's not expensive to clean and build.
74 #
75 $(Build_Dir_ia32)installer.sln $(Build_Dir_x64)installer.sln:
76 createsolutions.bat
71 77
72 objects_ia32 = $(Build_Dir_ia32)adblockplusie-$(VERSION).wixobj 78 $(MSBuild_Output_ia32): $(Build_Dir_ia32)installer.sln
73 $(objects_ia32): adblockplusie.wxs 79 msbuild /p:Configuration=Release $(Build_Dir_ia32)installer.sln
74 » » $(Candle) -arch x86
75 80
76 objects_x64 = $(Build_Dir_x64)adblockplusie-$(VERSION).wixobj 81 $(MSBuild_Output_x64): $(Build_Dir_x64)installer.sln
77 $(objects_x64): adblockplusie.wxs 82 msbuild /p:Configuration=Release $(Build_Dir_x64)installer.sln
78 » » $(Candle) -arch x64
79 83
80 object_setup = $(Build_Dir_common)setup-$(VERSION).wixobj 84 $(Installer_ia32_msi): $(MSBuild_Output_ia32)
81 $(object_setup): setup.wxs 85 copy $(MSBuild_Output_ia32) $(Installer_ia32_msi)
82 $(Candle) -ext WixBalExtension
83 86
87 $(Installer_x64_msi): $(MSBuild_Output_x64)
88 copy $(MSBuild_Output_x64) $(Installer_x64_msi)
89
90
91 clean-msi: clean-ia32 clean-x64
92
93 clean-ia32:
94 del $(MSBuild_Output_ia32) $(Installer_ia32_msi)
95
96 clean-x64:
97 del $(MSBuild_Output_x64) $(Installer_x64_msi)
98
84 #--------------------- 99 #---------------------
85 # light .wixobj --> .msi 100 # Bundle
86 #--------------------- 101 #---------------------
102 object_setup = $(Build_Dir_common)setup.wixobj
103 Source_Dir_setup = src\setup-exe\ #
104 setup_compile_sources = $(Source_Dir_setup)setup.wxs
105 setup_link_sources = $(Source_Dir_setup)bootstrap-theme.xml $(Source_Dir_setup)b ootstrap-theme.wxl
87 106
88 Light = light -notidy -nologo -cultures:en-us -ext WixUIExtension -out $@ 107 $(object_setup): $(setup_compile_sources)
108 candle -nologo -dVersion=$(VERSION) $(setup_compile_sources) -out $(object_s etup) -ext WixBalExtension
89 109
90 $(Installer_ia32): $(objects_ia32) $(objects_common) "..\build\ia32\$(Configurat ion)\AdblockPlus.dll" "build\ia32\Debug\installer-ca.dll" 110 $(Setup): $(Installer_ia32_msi) $(Installer_x64_msi)
91 $(Light) $(objects_ia32) $(objects_common) -loc en-us.wxl -sval 111 $(Setup): $(object_setup) $(setup_link_sources)
92 112 light -nologo -dVersion=$(VERSION) $(object_setup) -ext WixBalExtension -loc $(Source_Dir_setup)bootstrap-theme.wxl -out $(Setup)
93 # TODO: Don't ignore errors here (fix install paths)
94 $(Installer_x64): $(objects_x64) $(objects_common) "..\build\ia32\$(Configuratio n)\AdblockPlus.dll" "..\build\x64\$(Configuration)\AdblockPlus.dll"
95 -$(Light) $(objects_x64) $(objects_common) -loc en-us.wxl
96
97 #---------------------
98 # light .wixobj --> .exe
99 #---------------------
100
101 $(Setup): $(object_setup) bootstrap-theme.xml bootstrap-theme.wxl
102 $(Light) $(object_setup) -ext WixBalExtension -loc bootstrap-theme.wxl
103 113
104 #--------------------- 114 #---------------------
105 # msiexec .msi --> installed --> uninstalled 115 # msiexec .msi --> installed --> uninstalled
106 #--------------------- 116 #---------------------
107 117
108 install-ia32: $(Installer_ia32)
109 call <<nmake_temporary.bat
110 pushd $(Build_Dir_ia32)
111 msiexec /i $(**F) /l*v install.log
112 popd
113 <<
114
115 install-x64: $(Installer_x64)
116 call <<nmake_temporary.bat
117 pushd $(Build_Dir_x64)
118 msiexec /i $(**F) /l*v install.log
119 popd
120 <<
121
122 uninstall: 118 uninstall:
123 msiexec /x {4f27c814-5ee0-4b25-b3ab-3ad565551918} 119 msiexec /x {4f27c814-5ee0-4b25-b3ab-3ad565551918}
124 120
125 install-setup: $(Setup) 121 install-setup: $(Setup)
126 $(Setup) -log ..\build\setup.log 122 $(Setup) -log ..\build\setup.log
127 123
128 #--------------------- 124 #---------------------
129 # Miscellaneous 125 # Self-extracting versions of the MSI
130 #--------------------- 126 #---------------------
131 127
132 clean: 128 #
133 del $(objects_ia32) 129 # 7-Zip can't help but store directories (no command line switch to do otherwise ).
130 #
131 $(Installer_ia32_exe): $(Installer_ia32_msi) $(Source_Dir_setup)self-extract-con fig-ia32.txt
132 cd $(Build_Dir_ia32) & 7z a -t7z $(Installer_ia32_name).7z ..\..\$(MSBuild_O utput_ia32)
133 copy /b $(Source_Dir_setup)7zS.sfx + $(Source_Dir_setup)self-extract-config- ia32.txt + $(Installer_ia32_archive) $(Installer_ia32_exe)
134
135 $(Installer_x64_exe): $(Installer_x64_msi) $(Source_Dir_setup)self-extract-confi g-x64.txt
136 cd $(Build_Dir_x64) & 7z a -t7z $(Installer_x64_name).7z ..\..\$(MSBuild_Out put_x64)
137 copy /b $(Source_Dir_setup)7zS.sfx + $(Source_Dir_setup)self-extract-config- x64.txt + $(Installer_x64_archive) $(Installer_x64_exe)
138
OLDNEW

Powered by Google App Engine
This is Rietveld