123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306 |
- #
- # Makefile.fpc for Free Pascal FreeRTOS RTL
- #
- [package]
- main=rtl
- [target]
- loaders=$(LOADERS)
- # not all targets include enough features to build all units so
- # the common units which are not compiled for all CPUs are stored in
- # CPU_SPECIFIC_COMMON_UNITS
- units=$(SYSTEMUNIT) $(CPU_UNITS) uuchar objpas iso7185 extpas heapmgr consoleio $(CPU_SPECIFIC_COMMON_UNITS) \
- # macpas iso7185 strings
- $(STRINGSUNIT) \
- $(SORTBASEUNIT) \
- $(DOSUNIT) \
- $(CTYPESUNIT) \
- $(CHARSETUNIT) $(CPALLUNIT) \
- $(SYSCONSTUNIT) \
- $(CHARACTERUNIT)
- implicitunits=$(EXEINFOUNIT) \
- $(CP1250UNIT) $(CP1251UNIT) $(CP1252UNIT) $(CP1253UNIT) $(CP1254UNIT) $(CP1255UNIT) $(CP1256UNIT) $(CP1257UNIT) $(CP1258UNIT) \
- $(CP437UNIT) $(CP646UNIT) $(CP737UNIT) $(CP775UNIT) $(CP850UNIT) $(CP852UNIT) $(CP855UNIT) $(CP856UNIT) $(CP857UNIT) $(CP860UNIT) $(CP861UNIT) $(CP862UNIT) \
- $(CP863UNIT) $(CP864UNIT) $(CP865UNIT) $(CP866UNIT) $(CP869UNIT) $(CP874UNIT) $(CP3021UNIT) $(CP8859_1UNIT) $(CP8859_2UNIT) $(CP8859_3UNIT) $(CP8859_4UNIT) \
- $(CP8859_5UNIT) $(CP8859_6UNIT) $(CP8859_7UNIT) $(CP8859_8UNIT) $(CP8859_9UNIT) $(CP8859_10UNIT) $(CP8859_11UNIT) \
- $(CP8859_13UNIT) $(CP8859_14UNIT) $(CP8859_15UNIT) $(CP8859_16UNIT) $(CPKOI8_RUNIT) $(CPKOI8_UUNIT) \
- $(UNICODEDATAUNIT)
- #rsts=math rtlconsts varutils typinfo variants classes sysconst dateutil
- [require]
- nortl=y
- [install]
- fpcpackage=y
- [default]
- target=freertos
- [compiler]
- includedir=$(INC) $(PROCINC)
- sourcedir=$(INC) $(PROCINC) $(COMMON) $(ARCH)
- [prerules]
- RTL=..
- INC=$(RTL)/inc
- COMMON=$(RTL)/common
- PROCINC=$(RTL)/$(CPU_TARGET)
- UNITPREFIX=rtl
- SYSTEMUNIT=system
- LOADERS=
- ifeq ($(ARCH),mipsel)
- ifeq ($(SUBARCH),pic32mx)
- override LOADERS=startup
- endif
- endif
- ifdef RELEASE
- override FPCOPT+=-Ur
- endif
- # Always include rtl.cfg config file for i8086
- ifeq ($(ARCH),i8086)
- override [email protected]
- endif
- CPU_UNITS=
- SYSINIT_UNITS=
- CPU_SPECIFIC_COMMON_UNITS=
- ifeq ($(ARCH),arm)
- CPU_SPECIFIC_COMMON_UNITS=sysutils math classes fgl macpas typinfo types rtlconsts getopts lineinfo
- ifeq ($(SUBARCH),armv7m)
- CPU_UNITS=stm32f103xe cortexm3 cortexm4 # thumb2_bare
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(SUBARCH),armv7em)
- CPU_UNITS=stm32f401xe cortexm3 cortexm4 cortexm7 # thumb2_bare
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(SUBARCH),armv4t)
- CPU_UNITS=lpc21x4 at91sam7x256 sc32442b
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(SUBARCH),armv4)
- CPU_UNITS=lpc21x4 at91sam7x256 sc32442b
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(SUBARCH),armv6m)
- CPU_UNITS=stm32g071xx cortexm0
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(SUBARCH),armv7a)
- CPU_UNITS=allwinner_a20 raspi2
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(CPU_UNITS_DEFINED),)
- $(error No CPUs enabled for given SUBARCH, pass either a SUBARCH or set CPU_UNITS_DEFINED=1 if you know what you are doing)
- endif
- endif
- ifeq ($(ARCH),avr)
- CPU_SPECIFIC_COMMON_UNITS=intrinsics
- ifeq ($(SUBARCH),avrtiny)
- CPU_UNITS=attiny4 attiny5 attiny9 attiny10 attiny20 attiny40 attiny102 attiny104
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(SUBARCH),avr1)
- CPU_UNITS=attiny11 attiny12 attiny15 attiny28
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(SUBARCH),avr2)
- CPU_UNITS=attiny26
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(SUBARCH),avr25)
- CPU_UNITS=attiny13 attiny13a attiny24 attiny24a attiny25 attiny43u \
- attiny44 attiny44a attiny45 attiny48 attiny84a attiny84 attiny85 \
- attiny87 attiny88 attiny261 attiny261a attiny441 attiny461 attiny461a attiny828 \
- attiny841 attiny861 attiny861a attiny2313 attiny2313a attiny4313
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(SUBARCH),avr35)
- CPU_UNITS=at90usb82 at90usb162 atmega8u2 atmega16u2 atmega32u2 attiny167 attiny1634
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(SUBARCH),avr4)
- CPU_UNITS=at90pwm1 at90pwm2b at90pwm3b at90pwm81 ata6285 ata6286 atmega8 \
- atmega8a atmega8hva atmega48 atmega48a atmega48p atmega48pa \
- atmega48pb atmega88 atmega88a atmega88p atmega88pa atmega88pb \
- atmega8515 atmega8535
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(SUBARCH),avr5)
- CPU_UNITS=avrsim at90can32 at90can64 at90pwm161 at90pwm216 at90pwm316 \
- at90usb646 at90usb647 atmega16 atmega16a atmega16hva atmega16hvb atmega16hvbrevb atmega16m1 \
- atmega16u4 atmega32 atmega32a atmega32c1 atmega32hvb atmega32hvbrevb atmega32m1 \
- atmega32u4 atmega64 atmega64a atmega64c1 atmega64hve2 atmega64m1 atmega64rfr2 atmega162 \
- atmega164a atmega164p atmega164pa atmega165a atmega165p atmega165pa \
- atmega168 atmega168a atmega168p atmega168pa atmega168pb atmega169a atmega169p \
- atmega169pa atmega324a atmega324p atmega324pa atmega324pb atmega325 atmega325a \
- atmega325p atmega325pa atmega328 atmega328p atmega328pb atmega329 atmega329a \
- atmega329p atmega329pa atmega406 atmega640 atmega644 atmega644a atmega644p \
- atmega644pa atmega644rfr2 atmega645 atmega645a atmega645p atmega649 atmega649a \
- atmega649p atmega3250 atmega3250a atmega3250p atmega3250pa atmega3290 \
- atmega3290a atmega3290p atmega3290pa atmega6450 atmega6450a \
- atmega6450p atmega6490 atmega6490a atmega6490p
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(SUBARCH),avr51)
- CPU_UNITS=at90can128 at90usb1286 at90usb1287 atmega128 atmega128a atmega128rfa1 atmega128rfr2 \
- atmega1280 atmega1281 atmega1284 atmega1284p atmega1284rfr2
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(SUBARCH),avr6)
- CPU_UNITS=avrsim atmega256rfr2 atmega2560 atmega2561 atmega2564rfr2
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(SUBARCH),avrxmega3)
- CPU_UNITS=atmega808 atmega809 atmega1608 atmega1609 atmega3208 atmega3209 \
- atmega4808 atmega4809 attiny202 attiny204 attiny212 attiny214 \
- attiny402 attiny404 attiny406 attiny412 attiny414 attiny416 \
- attiny416auto attiny417 attiny804 attiny806 attiny807 attiny814 \
- attiny816 attiny817 attiny1604 attiny1606 attiny1607 attiny1614 \
- attiny1616 attiny1617 attiny1624 attiny1626 attiny1627 attiny3214 attiny3216 attiny3217
- CPU_UNITS_DEFINED=1
- ifeq ($(CPU_UNITS_DEFINED),)
- $(error No CPUs enabled for given SUBARCH, pass either a SUBARCH or set CPU_UNITS_DEFINED=1 if you know what you are doing)
- endif
- endif
- endif
- ifeq ($(ARCH),i386)
- CPU_SPECIFIC_COMMON_UNITS=sysutils math classes fgl macpas typinfo types rtlconsts getopts lineinfo
- CPU_UNITS=multiboot
- CPU_UNITS_DEFINED=1
- ifeq ($(CPU_UNITS_DEFINED),)
- $(error No CPUs enabled for given SUBARCH, pass either a SUBARCH or set CPU_UNITS_DEFINED=1 if you know what you are doing)
- endif
- endif
- ifeq ($(ARCH),x86_64)
- CPU_SPECIFIC_COMMON_UNITS=sysutils math classes fgl macpas typinfo types rtlconsts getopts lineinfo
- # CPU_UNITS=multiboot
- endif
- ifeq ($(ARCH),m68k)
- CPU_SPECIFIC_COMMON_UNITS=sysutils math
- # CPU_UNITS=multiboot
- endif
- ifeq ($(ARCH),mipsel)
- CPU_SPECIFIC_COMMON_UNITS=sysutils math classes fgl macpas typinfo types rtlconsts getopts lineinfo
- ifeq ($(SUBARCH),pic32mx)
- CPU_UNITS=pic32mx1xxfxxxb pic32mx2xxfxxxb pic32mx1xxfxxxc pic32mx2xxfxxxc pic32mx1xxfxxxd pic32mx2xxfxxxd pic32mx7x5fxxxl pic32mx7x5fxxxh
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(CPU_UNITS_DEFINED),)
- $(error No CPUs enabled for given SUBARCH, pass either a SUBARCH or set CPU_UNITS_DEFINED=1 if you know what you are doing)
- endif
- endif
- ifeq ($(ARCH),riscv32)
- CPU_SPECIFIC_COMMON_UNITS=sysutils math classes fgl macpas typinfo types rtlconsts getopts lineinfo
- ifeq ($(SUBARCH),rv32imc)
- override FPCOPT+=-Cprv32imc
- CPU_UNITS=esp32c3 esp32c3idf_50000
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(CPU_UNITS_DEFINED),)
- $(error No CPUs enabled for given SUBARCH, pass either a SUBARCH or set CPU_UNITS_DEFINED=1 if you know what you are doing)
- endif
- endif
- ifeq ($(ARCH),riscv64)
- CPU_SPECIFIC_COMMON_UNITS=sysutils math classes fgl macpas typinfo types rtlconsts getopts lineinfo
- CPU_UNITS=
- CPU_UNITS_DEFINED=1
- ifeq ($(CPU_UNITS_DEFINED),)
- $(error No CPUs enabled for given SUBARCH, pass either a SUBARCH or set CPU_UNITS_DEFINED=1 if you know what you are doing)
- endif
- endif
- ifeq ($(ARCH),xtensa)
- CPU_SPECIFIC_COMMON_UNITS=sysutils math classes fgl macpas typinfo types rtlconsts getopts lineinfo
- ifeq ($(SUBARCH),lx6)
- CPU_UNITS=esp32 espidf_40100 espidf_40200 espidf_40400
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(SUBARCH),lx106)
- CPU_UNITS=esp8266 esp8266rtos_30300 esp8266rtos_30400
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(CPU_UNITS_DEFINED),)
- $(error No CPUs enabled for given SUBARCH, pass either a SUBARCH or set CPU_UNITS_DEFINED=1 if you know what you are doing)
- endif
- endif
- # Paths
- OBJPASDIR=$(RTL)/objpas
- [rules]
- # .NOTPARALLEL:
- # Get the system independent include file names.
- # This will set the following variables :
- # SYSINCNAMES
- include $(INC)/makefile.inc
- SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
- # Get the processor dependent include file names.
- # This will set the following variables :
- # CPUINCNAMES
- include $(PROCINC)/makefile.cpu
- SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
- # Put system unit dependencies together.
- SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
- #
- # Loaders
- #
- startup$(OEXT) : $(CPU_TARGET)/startup.s
- $(AS) $(ASTARGET) -o $(UNITTARGETDIRPREFIX)startup$(OEXT) $(CPU_TARGET)/startup.s -mabi=32 -march=pic32mx -mtune=pic32mx -W -EL -msym32
- #
- # Base Units (System, strings, os-dependent-base-unit)
- #
- $(SYSTEMUNIT)$(PPUEXT) : $(SYSTEMUNIT).pp $(SYSDEPS) $(INC)/softfpu.pp
- $(COMPILER) $(FPC_SYSTEM_OPT) -Us -Sg $(SYSTEMUNIT).pp @system.cfg $(REDIR)
- consoleio$(PPUEXT) : consoleio.pp $(SYSTEMUNIT)$(PPUEXT)
- $(COMPILER) $<
- heapmgr$(PPUEXT) : heapmgr.pp $(SYSTEMUNIT)$(PPUEXT)
- $(COMPILER) $<
- macpas$(PPUEXT) : $(INC)/macpas.pp objpas$(PPUEXT) math$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
- $(COMPILER) $(INC)/macpas.pp $(REDIR)
- #
- # Unit specific rules
- #
- define CPU_UNITS_RULE
- ifeq ($(ARCH),avr)
- $(1)$(PPUEXT): $(ARCH)/$(1).pp intrinsics$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
- else
- ifeq ($(ARCH),xtensa)
- $(1)$(PPUEXT): $(ARCH)/$(1).pp consoleio$(PPUEXT) heapmgr$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
- else
- $(1)$(PPUEXT): $(ARCH)/$(1).pp $(SYSTEMUNIT)$(PPUEXT)
- endif
- endif
- endef
- $(foreach unit,$(CPU_UNITS),$(eval $(call CPU_UNITS_RULE,$(unit))))
- $(addsuffix $(PPUEXT),$(CPU_UNITS)):
- $(COMPILER) -g $<
|