summaryrefslogtreecommitdiff
path: root/src/lib/gnat/Makefile.inc
blob: 1318ebde731f867ed833b2699bd535c4fc3a1485 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
##
##
##
## SPDX-License-Identifier: GPL-2.0-only

define libgnat-template
# $1 arch

additional-dirs += $$(obj)/libgnat-$(1)/adainclude
additional-dirs += $$(obj)/libgnat-$(1)/adalib

ADAFLAGS_libgnat-$(1) := \
	--RTS=$$(obj)/libgnat-$(1)/ \
	-gnatg \
	-gnatpg \
	-I$$(src)/lib/gnat/ \
	$$(GCC_ADAFLAGS_$(1)) \
	-Werror \

libgnat-$(1)-y += a-unccon.ads
libgnat-$(1)-y += ada.ads
libgnat-$(1)-y += g-souinf.ads
libgnat-$(1)-y += gnat.ads
libgnat-$(1)-y += i-c.adb
libgnat-$(1)-y += i-c.ads
libgnat-$(1)-y += interfac.ads
libgnat-$(1)-y += s-atacco.ads
libgnat-$(1)-y += s-imenne.adb
libgnat-$(1)-y += s-imenne.ads
libgnat-$(1)-y += s-maccod.ads
libgnat-$(1)-y += s-parame.ads
libgnat-$(1)-y += s-stoele.adb
libgnat-$(1)-y += s-stoele.ads
libgnat-$(1)-y += s-unstyp.ads
libgnat-$(1)-y += system.ads

# Copy bodies too for inlining
$$(obj)/libgnat-$(1)/libgnat.a: $$$$(libgnat-$(1)-objs)
	cp $$(libgnat-$(1)-srcs) $$(libgnat-$(1)-extra-specs) \
	   $$(obj)/libgnat-$(1)/adainclude/
	cp $$(libgnat-$(1)-alis) \
	   $$(obj)/libgnat-$(1)/adalib/
	rm -f $$@
	@printf "    AR         $$(subst $$(obj)/,,$$(@))\n"
	$$(AR_libgnat-$(1)) cr $$@ $$^

endef


$(foreach arch,$(standard-archs), \
	$(eval $(call define_class,libgnat-$(arch),$(arch))))

$(foreach arch,$(standard-archs), \
	$(eval $(call libgnat-template,$(arch))))

ifeq ($(CONFIG_RAMSTAGE_ADA),y)
ramstage-libs += $(obj)/libgnat-$(ARCH-ramstage-y)/libgnat.a
endif