this folders -> this folder
[kdepim.git] / kpilot / Makefile.cmake
blob641b7f9d1afbf787cb9728a4b2d47fb574d229a5
1 # This is a GNU makefile. You need GNU make to process it.
2 # FreeBSD users should use gmake.
6 # Unusual configuration things:
7 #   CMAKE = path to cmake
8 #   BUILD_DIR = directory to build things in
9 #   CMAKE_FLAGS = extra flags to CMake.  These will get set by
10 #      ./configure, saved to CMakeOptions.txt, and read in below...
13 -include Makefile.cmake.in
15 SRC_DIR ?= ..
16 BUILD_DIR ?= build-$(shell uname -sr | tr -d [:space:] | tr -Cs a-zA-Z0-9 _ )
17 # these come from CMakeOptions.txt (from ./configure)
18 CMAKE_FLAGS ?=
19 CMAKE ?= cmake
21 all: build-check
22         @cd "$(BUILD_DIR)" && $(MAKE)
24 check: lib tests
25         $(BUILD_DIR)/tests/testconstants
26         $(BUILD_DIR)/tests/testcategories --data-dir=tests/data
27         $(BUILD_DIR)/tests/testaddresses --data-dir=tests/data
28         $(BUILD_DIR)/tests/testdatebook --data-dir=tests/data
30 install: build-check
31         @cd "$(BUILD_DIR)" && $(MAKE) install
33 uninstall: 
34         @cd "$(BUILD_DIR)" && $(MAKE) uninstall
36 lib: $(BUILD_DIR)/lib/libkpilot.so
38 $(BUILD_DIR)/lib/libkpilot.so: build-check
39         @cd "$(BUILD_DIR)/lib" && $(MAKE)
41 tests: build-check
42         @cd "$(BUILD_DIR)/tests" && $(MAKE)
44         
45 build-check:
46         test -d "$(BUILD_DIR)" || mkdir -p "$(BUILD_DIR)"
47         test -d "$(BUILD_DIR)"
48         test -f "$(BUILD_DIR)/Makefile" || (cd "$(BUILD_DIR)" && $(CMAKE) -DKPILOT_STANDALONE=YES $(SRC_DIR) )
50 messages:
51         extractrc `find . -name *.rc` > rc.cc
52         extractrc `find . -name *.ui` >> rc.cc
53         xgettext -o kpilot.po --keyword=i18n rc.cc `find . -name *.h` `find . -name *.cc` 
55 clean:
56         @rm -rf $(BUILD_DIR)
58 svnclean:
59         @rm -rf `svn status --no-ignore | awk '/^[?I]/{print $2}'`
61 help:
62         @echo "Usage: make ( all | install | uninstall | clean )"
63         @echo ""
65 .PHONY : all check install uninstall lib build-check clean help