| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332 |
- #
- # Makefile.fpc for Free Pascal Embedded 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)
- #implicitunits=exeinfo \
- # cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 \
- # cp437 cp646 cp737 cp775 cp850 cp852 cp855 cp856 cp857 cp860 cp861 cp862 \
- # cp863 cp864 cp865 cp866 cp869 cp874 cp3021 cp8859_1 cp8859_2 cp8859_3 cp8859_4 \
- # cp8859_5 cp8859_6 cp8859_7 cp8859_8 cp8859_9 cp8859_10 cp8859_11 \
- # cp8859_13 cp8859_14 cp8859_15 cp8859_16 cpkoi8_r cpkoi8_u
- #rsts=math rtlconsts varutils typinfo variants classes sysconst dateutil
- [require]
- nortl=y
- [install]
- fpcpackage=y
- [default]
- target=embedded
- [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),aarch64)
- CPU_SPECIFIC_COMMON_UNITS=sysutils math classes fgl macpas typinfo types rtlconsts getopts lineinfo
- CPU_UNITS=raspi3 mmio mailbox raspiuart gpio
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(ARCH),arm)
- CPU_SPECIFIC_COMMON_UNITS=sysutils math classes fgl macpas typinfo types rtlconsts getopts lineinfo
- ifeq ($(SUBARCH),armv7m)
- CPU_UNITS=lm3fury lm3tempest stm32f10x_ld stm32f10x_md stm32f10x_hd stm32f10x_xl stm32f10x_conn stm32f10x_cl lpc13xx lpc1768 sam3x8e xmc4500 cortexm3 cortexm4 # thumb2_bare
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(SUBARCH),armv7em)
- CPU_UNITS=lm4f120 xmc4500 mk20d5 mk20d7 mk22f51212 mk64f12 stm32f401xx stm32f407xx stm32f411xe stm32f429xx stm32f446xx stm32f745 stm32f746 stm32f756 nrf52 cortexm3 cortexm4 cortexm7 \
- samd51p19a # 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=lpc8xx lpc11xx lpc122x stm32f0xx nrf51 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
- 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),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 classes fgl macpas typinfo types rtlconsts getopts lineinfo
- # 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),rv32imac)
- override FPCOPT+=-Cprv32imac
- CPU_UNITS=fe310g000 fe310g002 gd32vf103xx
- CPU_UNITS_DEFINED=1
- endif
- ifeq ($(SUBARCH),rv32i)
- override FPCOPT+=-Cprv32i
- CPU_UNITS=
- 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),lx106)
- CPU_UNITS=esp8266
- 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),wasm32)
- CPU_SPECIFIC_COMMON_UNITS=sysutils math classes fgl macpas typinfo types rtlconsts getopts
- # lineinfo
- endif
- # Paths
- OBJPASDIR=$(RTL)/objpas
- GRAPHDIR=$(INC)/graph
- [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) $<
- #
- # Unit specific rules
- #
- define CPU_UNITS_RULE
- ifeq ($(ARCH),avr)
- $(1)$(PPUEXT): $(ARCH)/$(1).pp intrinsics$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
- else
- $(1)$(PPUEXT): $(ARCH)/$(1).pp $(SYSTEMUNIT)$(PPUEXT)
- endif
- endef
- $(foreach unit,$(CPU_UNITS),$(eval $(call CPU_UNITS_RULE,$(unit))))
- $(addsuffix $(PPUEXT),$(CPU_UNITS)):
- $(COMPILER) -g $<
- # AVR specific units
- avrsim$(PPUEXT): $(ARCH)/avrsim.pp heapmgr$(PPUEXT) consoleio$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
- $(COMPILER) $(ARCH)/avrsim.pp
- # ARM specific units
- raspi2$(PPUEXT): $(ARCH)/raspi2.pp consoleio$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
- $(COMPILER) $(ARCH)/raspi2.pp
- # AARCH64 specific units
- raspi3$(PPUEXT): $(ARCH)/raspi3.pp consoleio$(PPUEXT) mmio$(PPUEXT) mailbox$(PPUEXT) raspiuart$(PPUEXT) gpio$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
- $(COMPILER) $(ARCH)/raspi3.pp
- raspiuart$(PPUEXT): $(ARCH)/raspiuart.pp mmio$(PPUEXT) mailbox$(PPUEXT) gpio$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
- $(COMPILER) $(ARCH)/raspiuart.pp
- mailbox$(PPUEXT): $(ARCH)/mailbox.pp mmio$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
- $(COMPILER) $(ARCH)/mailbox.pp
|