Debian Codegraph @

Makefile

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 PREFIX ?= $(HOME)/libraries
2 TESTDIR = tests
3 OBJDIR = obj
4 LIBDIR = lib
5
6 PKGCONF = `pkg-config --cflags --libs dbus-glib-1`
7 TESTBIN = $(OBJDIR)/tests/rebounder
8 TESTPID = `pidof rebounder`
9
10 MAJOR = 0
11 MINOR = 6
12 REV = 3
13 VERSION = $(MAJOR).$(MINOR).$(REV)
14 # Set VERSION to '' for a static library.
15 DBUSADA = libdbusada-$(VERSION)
16 TARBALL = $(DBUSADA).tar.bz2
17
18 NUM_CPUS ?= 1
19
20 # GNAT_BUILDER_FLAGS, ADAFLAGS and LDFLAGS may be overridden in the
21 # environment or on the command line.
22 GNAT_BUILDER_FLAGS ?= -R -j$(NUM_CPUS)
23
24 # GMAKE_OPTS should not be overridden because -p is essential.
25 GMAKE_OPTS = -p ${GNAT_BUILDER_FLAGS} \
26 $(foreach v,ADAFLAGS LDFLAGS,"-X$(v)=$($(v))")
27
28 # This variable explicitly exists for override by people with a
29 # different directory hierarchy.
30 # exec is unrelated and currently only used by tests
31 GPRINSTALLFLAGS := \
32 --prefix=$(PREFIX) \
33 --no-manifest \
34 --exec-subdir=tests \
35 --ali-subdir=lib/dbus-ada \
36 --lib-subdir=lib \
37 --project-subdir=lib/gnat \
38 --sources-subdir=include/dbus-ada \
39 # EOL
40
41 all: build-lib
42
43 build-lib:
44 gprbuild $(GMAKE_OPTS) -Pdbusada -XVERSION=$(VERSION)
45
46 build-tests:
47 gprbuild $(GMAKE_OPTS) -Pd_bus_ada_tests -XVERSION=
48
49 build-examples:
50 gprbuild $(GMAKE_OPTS) -Pd_bus_ada_examples -XVERSION=
51
52 install: build-lib
53 gprinstall -f -p -Pdbusada -XVERSION=$(VERSION) $(GPRINSTALLFLAGS)
54
55 tests: build-tests $(TESTBIN)
56 @$(TESTBIN) &
57 @$(OBJDIR)/tests/runner || true
58 @kill $(TESTPID)
59
60 $(OBJDIR)/tests:
61 @mkdir -p $@
62
63 $(TESTBIN): $(TESTDIR)/c/dbus-rebound.c | $(OBJDIR)/tests
64 $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $^ $(PKGCONF) $(LDLIBS)
65
66 clean:
67 @rm -rf $(OBJDIR)
68 @rm -rf $(LIBDIR)
69
70 dist:
71 @echo "Creating release tarball $(TARBALL) ... "
72 @git archive --format=tar HEAD --prefix $(DBUSADA)/ | bzip2 > $(TARBALL)
73
74 .PHONY: tests
75
76 include doc/doc.mk