Debian Codegraph @

Makefile

raw
1 RTS =
2 TARGET =
3 GPRBUILD = gprbuild
4 GPRCLEAN = gprclean
5 GPRINSTALL = gprinstall
6
7 INSTALL:=$(shell exec=`which gprbuild`;if [ ! -x "$$exec" ]; then unset exec;fi;echo $$exec | sed -e 's/\/bin\/$(GPRBUILD).*//')
8
9 ifeq ($(RTS),)
10 RTS=full
11 RTS_CONF =
12 else
13 RTS_CONF = --RTS=$(RTS)
14 endif
15
16 ifeq ($(TARGET),)
17 TARGET=native
18 TARGET_CONF =
19 else
20 TARGET_CONF = --target=$(TARGET)
21 endif
22
23 MODE = Install
24
25 CONF_ARGS = $(TARGET_CONF) $(RTS_CONF)
26
27 GPROPTS = $(CONF_ARGS) -XAUNIT_BUILD_MODE=$(MODE) -XAUNIT_RUNTIME=$(RTS) \
28 -XAUNIT_PLATFORM=$(TARGET)
29
30 # For the 64 bits architectures, the large code model has to be used.
31 # with rtp-large, gprconfig ensures that -mcmodel=large is used,
32 # but it is managed here for the default (kernel).
33 GPROPTS_EXTRA=
34 ifneq ($(strip $(filter aarch64-wrs-vxworks7r2 powerpc64-wrs-vxworks7r2 x86_64-wrs-vxworks7r2,$(TARGET))),)
35 ifeq (${RTS_CONF},)
36 # This covers the kernel RTS because for rtp, the RTS_OPT variable is defined to --RTS=rtp.
37 # kernel is the default and the RTS_OPT is not set in that case.
38 GPROPTS_EXTRA+=-cargs -mcmodel=large -largs -mcmodel=large
39 endif
40 endif
41
42 .PHONY: all clean targets install_clean install
43
44 all:
45 $(GPRBUILD) -p $(GPROPTS) lib/gnat/aunit.gpr ${GPROPTS_EXTRA}
46
47 clean-lib:
48 $(RM) -fr lib/aunit lib/aunit-obj
49
50 clean: clean-lib
51 -${MAKE} -C doc clean
52
53 install-clean-legacy:
54 ifneq (,$(wildcard $(INSTALL)/lib/gnat/manifests/aunit))
55 -$(GPRINSTALL) $(GPROPTS) --uninstall --prefix=$(INSTALL) \
56 --project-subdir=lib/gnat aunit
57 endif
58
59 install-clean: install-clean-legacy
60 ifneq (,$(wildcard $(INSTALL)/share/gpr/manifests/aunit))
61 -$(GPRINSTALL) $(GPROPTS) --uninstall --prefix=$(INSTALL) aunit
62 endif
63
64 install: install-clean
65 $(GPRINSTALL) $(GPROPTS) -p -f --prefix=$(INSTALL) \
66 --no-build-var lib/gnat/aunit.gpr
67
68 .PHONY: doc
69 doc:
70 ${MAKE} -C doc
71
72 RM = rm