build.mk 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. define build-platform-headers
  2. $(call reset)
  3. $(eval q := $D/include/$(strip $1))
  4. $(call installto, $(PLATIND)/$(PLATFORM)/include/$(strip $1))
  5. $(eval PLATFORM_HEADERS_$(PLATFORM) += $q)
  6. endef
  7. define build-platform-impl
  8. $(call reset)
  9. $(eval q := $D/descr)
  10. $(call installto, $(PLATIND)/descr/$(PLATFORM))
  11. $(foreach f, $(platform-headers), $(call build-platform-headers, $f))
  12. $(eval PLATFORM_$(PLATFORM) := \
  13. $(PLATIND)/descr/$(PLATFORM) \
  14. $(PLATFORM_HEADERS_$(PLATFORM)) \
  15. $(PLATDEP)/$(PLATFORM)/as \
  16. $(PLATDEP)/$(PLATFORM)/ncg \
  17. $(ARCHITECTURE_$(ARCH)))
  18. # libsys
  19. $(call reset)
  20. $(foreach f, $(platform-libsys), $(call ackfile, $D/libsys/$f))
  21. $(call acklibrary, $(LIBDIR)/$(PLATFORM)/libsys.a)
  22. $(call installto, $(PLATIND)/$(PLATFORM)/libsys.a)
  23. # libem
  24. $(call reset)
  25. $(eval objdir := $(PLATFORM))
  26. $(eval ackflags += -Ih)
  27. $(foreach f, $(arch-libem-$(ARCH)), $(call ackfile, mach/$(ARCH)/libem/$f))
  28. $(call acklibrary, $(LIBDIR)/$(PLATFORM)/libem.a)
  29. $(call installto, $(PLATIND)/$(PLATFORM)/libem.a)
  30. # libend
  31. $(call reset)
  32. $(eval objdir := $(PLATFORM))
  33. $(eval ackflags += -Ih)
  34. $(foreach f, $(arch-libend-$(ARCH)), $(call ackfile, mach/$(ARCH)/libend/$f))
  35. $(call acklibrary, $(LIBDIR)/$(PLATFORM)/libend.a)
  36. $(call installto, $(PLATIND)/$(PLATFORM)/libend.a)
  37. # The tools themselves
  38. $(call build-as)
  39. $(call build-ncg)
  40. # Build top only if the architecture asks for it.
  41. $(if $(arch-top-$(ARCH)), $(call build-top))
  42. # Language runtimes
  43. $(foreach runtime, $(RUNTIMES), $(build-runtime-$(runtime)))
  44. # Install the ego descr file for this architecture
  45. $(call build-ego-descr)
  46. endef
  47. build-platform = $(eval $(call build-platform-impl, $1))