#!/usr/bin/make -f # The next line will cause Dart to be used if it is installed... #USE_DARTP:=$(shell if [ -d /usr/share/Dart ]; then echo true; fi ) USE_DARTP:= DARCH := $(shell dpkg --print-installation-architecture) CFLAGS := -Wall -g $(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),-O0,-O2) QUILT_CALL := QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null BUILD_FLAGS_FILE := build-flags.cmake # Hack for parisc64 to close bug #133696 ifeq ($(shell arch),parisc64) CFLAGS += -ffunction-sections endif patch: patch-stamp patch-stamp: $(QUILT_CALL) push -a || test $$? = 2 touch $@ unpatch: $(QUILT_CALL) pop -a -R || test $$? = 2 $(BUILD_FLAGS_FILE): touch $@ echo 'set(CMAKE_SKIP_RPATH YES CACHE BOOL "Skip rpath" FORCE)' >> $@ echo 'set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "Verbose build" FORCE)' >> $@ echo 'set(CMAKE_C_FLAGS "$(CFLAGS)" CACHE STRING "C flags" FORCE)' >> $@ echo 'set(CMAKE_CXX_FLAGS "$(CFLAGS)" CACHE STRING "C++ flags" FORCE)' >> $@ # echo 'set(BUILD_WXDialog ON CACHE STRING "Build WXDialog" FORCE)' >> $@ echo 'set(BUILD_CursesDialog TRUE CACHE BOOL "Build curses GUI" FORCE)' >> $@ echo 'set(BUILD_QtDialog TRUE CACHE BOOL "Build Qt4 GUI" FORCE)' >> $@ # echo 'set(TARGET_VERSION CACHE STRING ""FORCE)' >> $@ # echo 'set(TARGET_SOVERSION CACHE STRING "" FORCE)' >> $@ # echo 'set(BUILD_DOCUMENTATION ON CACHE BOOL "" FORCE)' >> $@ # echo 'set(BUILD_DOXYGEN ON CACHE BOOL "" FORCE)' >> $@ $(if $(USE_DARTP),echo 'set(DART_ROOT /usr/share/Dart CACHE STRING "" FORCE)' >> $@) $(if $(USE_DARTP),echo 'set(BUILDNAME "cmake_2.2.3-1_$(DARCH).deb" CACHE STRING "" FORCE)' >> $@) configure: configure-stamp configure-stamp: $(BUILD_FLAGS_FILE) dh_testdir # pre-load the cache to avoid setting rpath: rm -rf Build && mkdir -p Build cd Build && ../bootstrap --prefix=/usr --docdir=/share/doc/cmake --mandir=/share/man \ --init=../$(BUILD_FLAGS_FILE) --system-libs chmod -x ChangeLog.manual chmod -x Modules/*.cmake Modules/*.cmake.in Modules/*.cxx Modules/Platform/* touch $@ build: patch-stamp configure-stamp build-stamp build-stamp: dh_testdir cd Build && $(MAKE) $(if $(USE_DARTP),Experimental && $(MAKE) ExperimentalSubmit) touch $@ clean: unpatch dh_testdir dh_testroot rm -rf .pc build-stamp configure-stamp patch-stamp $(BUILD_FLAGS_FILE) rm -rf Build dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/cmake. cd Build && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install dh_lintian #cp Docs/cmake-indent.vim debian/cmake/usr/share/vim/addons/indent/cmake.vim #cp Docs/cmake-syntax.vim debian/cmake/usr/share/vim/addons/syntax/cmake.vim # Build architecture-independent files here. binary-indep: build install # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot dh_install dh_installdocs dh_installexamples dh_installmenu dh_installemacsen dh_installcron dh_installman dh_installinfo dh_installchangelogs ChangeLog.manual dh_link dh_strip dh_compress -XCMake.pdf dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure patch unpatch