OLD | NEW |
1 #!/usr/bin/make -f | 1 #!/usr/bin/make -f |
2 export DH_VERBOSE = 1 | 2 export DH_VERBOSE = 1 |
3 | 3 |
4 # Use DEB_BUILD_OPTIONS's parallel=n option (see Policy 4.9.1) | 4 # Use DEB_BUILD_OPTIONS's parallel=n option (see Policy 4.9.1) |
5 ifneq (,$(findstring parallel,$(DEB_BUILD_OPTIONS))) | 5 ifneq (,$(findstring parallel,$(DEB_BUILD_OPTIONS))) |
6 PARALLEL_JOBS := $(shell echo $(DEB_BUILD_OPTIONS) | \ | 6 PARALLEL_JOBS := $(shell echo $(DEB_BUILD_OPTIONS) | \ |
7 sed -e 's/.*parallel=\([0-9]\+\).*/\1/') | 7 sed -e 's/.*parallel=\([0-9]\+\).*/\1/') |
8 else | 8 else |
9 PARALLEL_JOBS := 1 | 9 PARALLEL_JOBS := 1 |
10 endif | 10 endif |
11 | 11 |
12 DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) | |
13 ifeq (amd64,$(DEB_HOST_ARCH_CPU)) | 12 ifeq (amd64,$(DEB_HOST_ARCH_CPU)) |
14 BUILD_TYPE += ReleaseX64 | 13 BUILD_TYPE += ReleaseX64 |
| 14 ARCH += x64 |
15 else | 15 else |
16 ifeq (i386,$(DEB_HOST_ARCH_CPU)) | 16 ifeq (i386,$(DEB_HOST_ARCH_CPU)) |
17 BUILD_TYPE += ReleaseIA32 | 17 BUILD_TYPE += ReleaseIA32 |
| 18 ARCH += ia32 |
18 else | 19 else |
19 $(warning unsupported target arch $(DEB_HOST_ARCH_CPU) - continuing anyway) | 20 ifeq (arm,$(DEB_HOST_ARCH_CPU)) |
| 21 ifeq ($(DEB_BUILD_ARCH_CPU),$(DEB_HOST_ARCH_CPU)) |
| 22 BUILD_TYPE += ReleaseARM |
| 23 else |
| 24 BUILD_TYPE += ReleaseXARM |
| 25 endif |
| 26 ARCH += arm |
| 27 else |
| 28 $(error unsupported target arch '$(DEB_HOST_ARCH_CPU)') |
| 29 endif |
20 endif | 30 endif |
21 endif | 31 endif |
22 | 32 |
23 # Verbose? | 33 # Verbose? |
24 ifeq (1,$(DH_VERBOSE)) | 34 ifeq (1,$(DH_VERBOSE)) |
25 BUILD_ARGS += V=1 | 35 BUILD_ARGS += V=1 |
26 endif | 36 endif |
27 | 37 |
28 %: | 38 %: |
29 dh $@ | 39 dh $@ |
30 | 40 |
31 override_dh_auto_clean: | 41 override_dh_auto_clean: |
32 echo $(DEB_BUILD_OPTIONS) | 42 echo $(DEB_BUILD_OPTIONS) |
33 rm -fr dart/out dart/Makefile | 43 rm -fr dart/out dart/Makefile |
34 find . -name *.tmp -execdir rm -f {} \; | 44 find . -name *.tmp -execdir rm -f {} \; |
35 find . -name *.pyc -execdir rm -f {} \; | 45 find . -name *.pyc -execdir rm -f {} \; |
36 find . -name *.mk -execdir rm -f {} \; | 46 find . -name *.mk -execdir rm -f {} \; |
37 find . -name *.Makefile -execdir rm -f {} \; | 47 find . -name *.Makefile -execdir rm -f {} \; |
38 | 48 |
39 override_dh_auto_configure: | 49 override_dh_auto_configure: |
40 GYP_GENERATORS=make python dart/tools/gyp_dart.py all | 50 GYP_GENERATORS=make python dart/tools/gyp_dart.py all |
41 | 51 |
42 override_dh_auto_build: | 52 override_dh_auto_build: |
43 » make -C dart -j$(PARALLEL_JOBS) \ | 53 » cd dart; \ |
44 » » BUILDTYPE=$(BUILD_TYPE) $(BUILD_ARGS) create_sdk | 54 » python tools/build.py -v -m release -a $(ARCH) $(TOOLCHAIN) create_sdk;
\ |
| 55 » cd .. |
45 | 56 |
46 # Building the Dart SDK will already strip all binaries. | 57 # Building the Dart SDK will already strip all binaries. |
47 override_dh_strip: | 58 override_dh_strip: |
48 | 59 |
| 60 # This override allows us to ignore spurious missing library errors when |
| 61 # cross-compiling. |
| 62 override_dh_shlibdeps: |
| 63 dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info |
| 64 |
49 override_dh_auto_install: | 65 override_dh_auto_install: |
50 mkdir -p debian/tmp/out | 66 mkdir -p debian/tmp/out |
51 cp -R dart/out/$(BUILD_TYPE)/dart-sdk debian/tmp/out | 67 cp -R dart/out/$(BUILD_TYPE)/dart-sdk debian/tmp/out |
52 mv debian/tmp/out/dart-sdk debian/tmp/out/dart | 68 mv debian/tmp/out/dart-sdk debian/tmp/out/dart |
53 dh_install | 69 dh_install |
54 dh_link | 70 dh_link |
OLD | NEW |