Makefile.fpc 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #
  2. # Makefile.fpc for WASI
  3. #
  4. [package]
  5. main=rtl
  6. [target]
  7. loaders=
  8. units=$(SYSTEMUNIT) $(SYSINIT_UNITS) $(OBJPASUNIT) $(EXTPASUNIT) $(MACPASUNIT) $(ISO7185UNIT) $(UUCHARUNIT) \
  9. $(WASIAPIUNIT) $(CTYPESUNIT) $(STRINGSUNIT) $(SYSCONSTUNIT) $(SYSUTILSUNIT) \
  10. $(SORTBASEUNIT) $(MATHUNIT) $(RTLCONSTSUNIT) $(TYPESUNIT) $(TYPINFOUNIT) $(FGLUNIT) $(GETOPTSUNIT) \
  11. $(CHARSETUNIT) $(CPALLUNIT) $(CHARACTERUNIT) $(FPWIDESTRINGUNIT) $(NOTHREADSUNIT) \
  12. $(CLASSESUNIT) $(DOSUNIT) $(RESUNIT) $(HEAPTRCUNIT) $(WASIUTILUNIT) $(WEBASSEMBLYUNIT)
  13. implicitunits= $(CP_UNITS) $(UNICODEDATAUNIT)
  14. [require]
  15. nortl=y
  16. [install]
  17. fpcpackage=y
  18. [default]
  19. target=wasip1
  20. cpu=wasm32
  21. [compiler]
  22. includedir=$(INC) $(PROCINC) $(WASICOMMONINC)
  23. sourcedir=$(INC) $(PROCINC) $(COMMON)
  24. [prerules]
  25. RTL=..
  26. INC=../inc
  27. WASICOMMONINC=$(RTL)/wasicommon
  28. SYSTEMDIR=$(WASICOMMONINC)
  29. DOSDIR=$(WASICOMMONINC)
  30. NSOSDIR=$(NSDIR)/wasi
  31. COMMON=$(RTL)/common
  32. PROCINC=../$(CPU_TARGET)
  33. UNITPREFIX=rtl
  34. SYSINIT_UNITS=si_prc si_dll
  35. RESUNIT=$(FPINTRESUNIT)
  36. # Paths
  37. OBJPASDIR=$(RTL)/objpas
  38. # Insert exception handler in system unit
  39. ifdef EXCEPTIONS_IN_SYSTEM
  40. override FPCOPT+=-dEXCEPTIONS_IN_SYSTEM
  41. endif
  42. # Insert exception handler in system unit
  43. ifdef NO_EXCEPTIONS_IN_SYSTEM
  44. override FPCOPT+=-dNO_EXCEPTIONS_IN_SYSTEM
  45. endif
  46. override FPC_SYSTEM_OPT += -Fi$(WASICOMMONINC)/wasiinc
  47. DOS_DEPS_OS=$(WASIAPIUNIT)$(PPUEXT) $(WASIUTILUNIT)$(PPUEXT)
  48. [rules]
  49. # Get the system independent include file names.
  50. # This will set the following variables :
  51. # SYSINCNAMES
  52. include $(INC)/makefile.inc
  53. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  54. # Get the processor dependent include file names.
  55. # This will set the following variables :
  56. # CPUINCNAMES
  57. include $(PROCINC)/makefile.cpu
  58. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  59. # Put system unit dependencies together.
  60. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS) $(WASICOMMONINC)/wasiinc/wasitypes.inc $(WASICOMMONINC)/wasiinc/wasiprocs.inc
  61. SYSUTILS_DEPS_OS=$(WASIUTILUNIT)$(PPUEXT)
  62. #
  63. # $(SYSINIT_UNITS) Units
  64. #
  65. si_prc$(PPUEXT) : $(WASICOMMONINC)/si_prc.pp $(SYSTEMUNIT)$(PPUEXT)
  66. $(COMPILER) $<
  67. si_dll$(PPUEXT) : $(WASICOMMONINC)/si_dll.pp $(SYSTEMUNIT)$(PPUEXT)
  68. $(COMPILER) $<
  69. #
  70. # Other $(SYSTEMUNIT)-dependent RTL Units
  71. #
  72. WEBASSEMBLYDEPS=$(PROCINC)/webassembly.pp $(SYSTEMUNIT)$(PPUEXT) $(PROCINC)/cpuh.inc $(PROCINC)/cpuinnr.inc $(OBJPASUNIT)$(PPUEXT)
  73. webassembly$(PPUEXT) : $(WEBASSEMBLYDEPS)
  74. $(COMPILER) $<
  75. Wasm.Api$(PPUEXT) : $(NSDIR)/wasm32/Wasm.Api.pp $(WEBASSEMBLYDEPS)
  76. $(COMPILER) $<
  77. #
  78. # WASIAPI
  79. #
  80. WASIAPIDEPS=$(WASICOMMONINC)/wasiinc/wasitypes.inc $(WASICOMMONINC)/wasiinc/wasiprocs.inc $(SYSTEMUNIT)$(PPUEXT)
  81. wasiapi$(PPUEXT) : wasiapi.pp $(WASIAPIDEPS)
  82. $(COMPILER) $< -Fiwasiinc
  83. WASIApi.WASIApi$(PPUEXT) : $(NSOSDIR)/WASIApi.WASIApi.pp $(WASIAPIDEPS)
  84. $(COMPILER) $< -Fiwasiinc
  85. #
  86. # wasiutils
  87. #
  88. WASIUTILDEPS=$(WASIAPIUNIT)$(PPUEXT) $(OBJPASUNIT)$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
  89. wasiutil$(PPUEXT) : wasiutil.pp $(WASIUTILDEPS)
  90. $(COMPILER) $<
  91. WASIApi.WASIUtil$(PPUEXT) : $(NSOSDIR)/WASIApi.WASIUtil.pp $(WASIUTILDEPS)
  92. $(COMPILER) $<