xref: /linux/arch/microblaze/Makefile (revision 04e3a553e0cbed369e5649c472ac317b6c45215d)
15f8ffb5fSMichal SimekUTS_SYSNAME = -DUTS_SYSNAME=\"uClinux\"
25f8ffb5fSMichal Simek
35f8ffb5fSMichal Simek# What CPU vesion are we building for, and crack it open
45f8ffb5fSMichal Simek# as major.minor.rev
55f8ffb5fSMichal SimekCPU_VER=$(subst ",,$(CONFIG_XILINX_MICROBLAZE0_HW_VER) )
65f8ffb5fSMichal SimekCPU_MAJOR=$(shell echo $(CPU_VER) | cut -d '.' -f 1)
75f8ffb5fSMichal SimekCPU_MINOR=$(shell echo $(CPU_VER) | cut -d '.' -f 2)
85f8ffb5fSMichal SimekCPU_REV=$(shell echo $(CPU_VER) | cut -d '.' -f 3)
95f8ffb5fSMichal Simek
105f8ffb5fSMichal Simekexport CPU_VER CPU_MAJOR CPU_MINOR CPU_REV
115f8ffb5fSMichal Simek
125f8ffb5fSMichal Simek# Use cpu-related CONFIG_ vars to set compile options.
135f8ffb5fSMichal Simek
145f8ffb5fSMichal Simek# Work out HW multipler support.  This is icky.
155f8ffb5fSMichal Simek# 1. Spartan2 has no HW multiplers.
165f8ffb5fSMichal Simek# 2. MicroBlaze v3.x always uses them, except in Spartan 2
175f8ffb5fSMichal Simek# 3. All other FPGa/CPU ver combos, we can trust the CONFIG_ settings
185f8ffb5fSMichal Simekifeq (,$(findstring spartan2,$(CONFIG_XILINX_MICROBLAZE0_FAMILY)))
195f8ffb5fSMichal Simek  ifeq ($(CPU_MAJOR),3)
205f8ffb5fSMichal Simek    CPUFLAGS-1 += -mno-xl-soft-mul
215f8ffb5fSMichal Simek  else
225f8ffb5fSMichal Simek    # USE_HW_MUL can be 0, 1, or 2, defining a heirarchy of HW Mul support.
235f8ffb5fSMichal Simek    CPUFLAGS-$(subst 1,,$(CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL)) += -mxl-multiply-high
245f8ffb5fSMichal Simek    CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL) += -mno-xl-soft-mul
255f8ffb5fSMichal Simek  endif
265f8ffb5fSMichal Simekendif
275f8ffb5fSMichal SimekCPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_DIV) += -mno-xl-soft-div
285f8ffb5fSMichal SimekCPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_BARREL) += -mxl-barrel-shift
29*04e3a553SMichal SimekCPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare
305f8ffb5fSMichal Simek
315f8ffb5fSMichal SimekCPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER))
325f8ffb5fSMichal Simek
335f8ffb5fSMichal Simek# The various CONFIG_XILINX cpu features options are integers 0/1/2...
345f8ffb5fSMichal Simek# rather than bools y/n
355f8ffb5fSMichal SimekCFLAGS += $(CPUFLAGS-1)
365f8ffb5fSMichal SimekCFLAGS += $(CPUFLAGS-2)
375f8ffb5fSMichal Simek
385f8ffb5fSMichal Simek# r31 holds current when in kernel mode
395f8ffb5fSMichal SimekCFLAGS += -ffixed-r31
405f8ffb5fSMichal Simek
415f8ffb5fSMichal SimekLDFLAGS_BLOB := --format binary --oformat elf32-microblaze
425f8ffb5fSMichal Simek
435f8ffb5fSMichal SimekLIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
445f8ffb5fSMichal Simek
455f8ffb5fSMichal Simekhead-y		:= arch/microblaze/kernel/head.o
465f8ffb5fSMichal Simeklibs-y		+= arch/microblaze/lib/ $(LIBGCC)
475f8ffb5fSMichal Simekcore-y		+= arch/microblaze/kernel/ arch/microblaze/mm/ \
485f8ffb5fSMichal Simek		   arch/microblaze/platform/
495f8ffb5fSMichal Simek
505f8ffb5fSMichal Simekboot := arch/$(ARCH)/boot
515f8ffb5fSMichal Simek
525f8ffb5fSMichal Simek# defines filename extension depending memory management type
535f8ffb5fSMichal Simekifeq ($(CONFIG_MMU),)
545f8ffb5fSMichal SimekMMUEXT		:= -nommu
555f8ffb5fSMichal Simekendif
565f8ffb5fSMichal Simekexport	MMUEXT
575f8ffb5fSMichal Simek
585f8ffb5fSMichal Simekall: linux.bin
595f8ffb5fSMichal Simek
605f8ffb5fSMichal Simekarchclean:
615f8ffb5fSMichal Simek	$(Q)$(MAKE) $(clean)=$(boot)
625f8ffb5fSMichal Simek
635f8ffb5fSMichal Simeklinux.bin linux.bin.gz: vmlinux
645f8ffb5fSMichal Simek	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
655f8ffb5fSMichal Simek
665f8ffb5fSMichal Simekdefine archhelp
675f8ffb5fSMichal Simek  echo  '* linux.bin    - Create raw binary'
685f8ffb5fSMichal Simek  echo  '  linux.bin.gz - Create compressed raw binary'
695f8ffb5fSMichal Simekendef
70