2013-05-12 19:45:55 +00:00
|
|
|
|
|
|
|
define build-platform-headers
|
|
|
|
$(call reset)
|
|
|
|
$(eval q := $D/include/$(strip $1))
|
|
|
|
$(call installto, $(PLATIND)/$(PLATFORM)/include/$(strip $1))
|
|
|
|
$(eval PLATFORM_HEADERS_$(PLATFORM) += $q)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define build-platform-impl
|
|
|
|
$(call reset)
|
|
|
|
$(eval q := $D/descr)
|
|
|
|
$(call installto, $(PLATIND)/descr/$(PLATFORM))
|
|
|
|
|
2013-05-14 15:11:29 +00:00
|
|
|
$(foreach f, $(platform-headers), $(call build-platform-headers, $f))
|
|
|
|
|
2013-05-12 19:45:55 +00:00
|
|
|
$(eval PLATFORM_$(PLATFORM) := \
|
2013-05-13 21:12:46 +00:00
|
|
|
$(PLATIND)/descr/$(PLATFORM) \
|
2013-05-12 19:45:55 +00:00
|
|
|
$(PLATFORM_HEADERS_$(PLATFORM)) \
|
2013-05-13 22:26:15 +00:00
|
|
|
$(PLATDEP)/$(PLATFORM)/as \
|
2015-03-22 23:08:51 +00:00
|
|
|
$(if $(arch-cg-$(ARCH)), $(PLATDEP)/$(PLATFORM)/cg, $(PLATDEP)/$(PLATFORM)/ncg) \
|
2013-05-13 21:12:46 +00:00
|
|
|
$(ARCHITECTURE_$(ARCH)))
|
2013-05-12 19:45:55 +00:00
|
|
|
|
2013-05-13 22:26:15 +00:00
|
|
|
# libsys
|
|
|
|
|
2013-05-12 22:51:55 +00:00
|
|
|
$(call reset)
|
|
|
|
$(foreach f, $(platform-libsys), $(call ackfile, $D/libsys/$f))
|
|
|
|
$(call acklibrary, $(LIBDIR)/$(PLATFORM)/libsys.a)
|
|
|
|
$(call installto, $(PLATIND)/$(PLATFORM)/libsys.a)
|
|
|
|
|
2013-05-13 22:26:15 +00:00
|
|
|
# libem
|
|
|
|
|
|
|
|
$(call reset)
|
|
|
|
$(eval objdir := $(PLATFORM))
|
|
|
|
$(eval ackflags += -Ih)
|
|
|
|
$(foreach f, $(arch-libem-$(ARCH)), $(call ackfile, mach/$(ARCH)/libem/$f))
|
|
|
|
$(call acklibrary, $(LIBDIR)/$(PLATFORM)/libem.a)
|
|
|
|
$(call installto, $(PLATIND)/$(PLATFORM)/libem.a)
|
|
|
|
|
|
|
|
# libend
|
|
|
|
|
|
|
|
$(call reset)
|
|
|
|
$(eval objdir := $(PLATFORM))
|
|
|
|
$(eval ackflags += -Ih)
|
|
|
|
$(foreach f, $(arch-libend-$(ARCH)), $(call ackfile, mach/$(ARCH)/libend/$f))
|
|
|
|
$(call acklibrary, $(LIBDIR)/$(PLATFORM)/libend.a)
|
|
|
|
$(call installto, $(PLATIND)/$(PLATFORM)/libend.a)
|
|
|
|
|
|
|
|
# The tools themselves
|
|
|
|
|
|
|
|
$(call build-as)
|
2015-03-22 23:08:51 +00:00
|
|
|
$(if $(arch-cg-$(ARCH)), $(call build-cg), $(call build-ncg))
|
2013-05-13 22:26:15 +00:00
|
|
|
|
|
|
|
# Build top only if the architecture asks for it.
|
|
|
|
|
|
|
|
$(if $(arch-top-$(ARCH)), $(call build-top))
|
|
|
|
|
|
|
|
# Language runtimes
|
|
|
|
|
2013-05-12 22:51:55 +00:00
|
|
|
$(foreach runtime, $(RUNTIMES), $(build-runtime-$(runtime)))
|
2013-05-15 20:14:06 +00:00
|
|
|
|
|
|
|
# Install the ego descr file for this architecture
|
|
|
|
|
|
|
|
$(call build-ego-descr)
|
2013-05-12 19:45:55 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
build-platform = $(eval $(call build-platform-impl, $1))
|
|
|
|
|
|
|
|
|