4 # Copyright (C) 2011 The Libphonenumber Authors
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # Uncomment this to turn on verbose mode.
23 JAVA_HOME ?= /usr/lib/jvm/default-java
25 CMAKE_FLAGS := -DCMAKE_INSTALL_PREFIX=/usr
26 CPP_BUILD := cpp/build
27 JAVA_BUILD := java/build
29 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
34 ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
37 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
38 NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
39 MAKEFLAGS += -j$(NUMJOBS)
43 dh $@ --with javahelper
45 override_dh_auto_configure:
46 mkdir -p $(CPP_BUILD) && cd $(CPP_BUILD) && $(CMAKE) $(CMAKE_FLAGS) ..
48 override_dh_auto_build:
49 $(MAKE) -C $(CPP_BUILD) phonenumber phonenumber-shared
50 $(ANT) -f $(JAVA_BUILD).xml jar
52 override_dh_auto_test:
53 ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
54 $(MAKE) -C $(CPP_BUILD) test
55 $(ANT) -f $(JAVA_BUILD).xml junit
58 override_dh_auto_install:
59 dh_auto_install --builddirectory=$(CPP_BUILD)
61 override_dh_auto_clean:
62 -test -d $(CPP_BUILD) && $(MAKE) -C $(CPP_BUILD) clean
63 -$(ANT) -f $(JAVA_BUILD).xml clean