blob: 9c68624947c13c6480dd05356dfad0454dc671d8 [file] [log] [blame]
Nico Huberbe5492a2015-09-29 16:41:19 +02001##
2## This file is part of the coreboot project.
3##
4## Copyright (C) 2016 Nico Huber <nico.h@gmx.de>
5##
6## This program is free software; you can redistribute it and/or modify
7## it under the terms of the GNU General Public License as published by
8## the Free Software Foundation; version 2 of the License.
9##
10## This program is distributed in the hope that it will be useful,
11## but WITHOUT ANY WARRANTY; without even the implied warranty of
12## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13## GNU General Public License for more details.
14##
15
16define libgnat-template
17# $1 arch
18
19additional-dirs += $$(obj)/libgnat-$(1)/adainclude
20additional-dirs += $$(obj)/libgnat-$(1)/adalib
21
22ADAFLAGS_libgnat-$(1) := \
23 --RTS=$$(obj)/libgnat-$(1)/ \
24 -gnatg \
25 -gnatpg \
26 -I$$(src)/lib/gnat/ \
27
28libgnat-$(1)-y += a-unccon.ads
29libgnat-$(1)-y += ada.ads
30libgnat-$(1)-y += g-souinf.ads
31libgnat-$(1)-y += gnat.ads
32libgnat-$(1)-y += i-c.adb
33libgnat-$(1)-y += i-c.ads
34libgnat-$(1)-y += interfac.ads
35libgnat-$(1)-y += s-atacco.ads
36libgnat-$(1)-y += s-imenne.adb
37libgnat-$(1)-y += s-imenne.ads
38libgnat-$(1)-y += s-maccod.ads
39libgnat-$(1)-y += s-parame.ads
40libgnat-$(1)-y += s-stoele.adb
41libgnat-$(1)-y += s-stoele.ads
42libgnat-$(1)-y += s-unstyp.ads
43libgnat-$(1)-y += system.ads
44
45# Copy bodies too for inlining
46$$(obj)/libgnat-$(1)/libgnat.a: $$$$(libgnat-$(1)-objs)
47 cp $$(libgnat-$(1)-srcs) $$(libgnat-$(1)-extra-specs) \
48 $$(obj)/libgnat-$(1)/adainclude/
49 cp $$(libgnat-$(1)-alis) \
50 $$(obj)/libgnat-$(1)/adalib/
51 rm -f $$@
52 @printf " AR $$(subst $$(obj)/,,$$(@))\n"
53 $$(AR_libgnat-$(1)) cr $$@ $$^
54
55endef
56
57
58$(foreach arch,$(standard-archs), \
59 $(eval $(call define_class,libgnat-$(arch),$(arch))))
60
61$(foreach arch,$(standard-archs), \
62 $(eval $(call libgnat-template,$(arch))))
Nico Hubere0ed9022016-10-07 12:58:17 +020063
64ifeq ($(CONFIG_RAMSTAGE_ADA),y)
Nico Huberc83239e2016-10-05 17:46:49 +020065ramstage-libs += $(obj)/libgnat-$(ARCH-ramstage-y)/libgnat.a
Nico Hubere0ed9022016-10-07 12:58:17 +020066endif