xref: /openbmc/linux/arch/alpha/lib/Makefile (revision d4d016ca)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
21da177e4SLinus Torvalds#
31da177e4SLinus Torvalds# Makefile for alpha-specific library files..
41da177e4SLinus Torvalds#
51da177e4SLinus Torvalds
68a362cd6Smatt mooneyasflags-y := $(KBUILD_CFLAGS)
78a362cd6Smatt mooneyccflags-y := -Werror
81da177e4SLinus Torvalds
91da177e4SLinus Torvalds# Many of these routines have implementations tuned for ev6.
101da177e4SLinus Torvalds# Choose them iff we're targeting ev6 specifically.
111da177e4SLinus Torvaldsev6-$(CONFIG_ALPHA_EV6) := ev6-
121da177e4SLinus Torvalds
131da177e4SLinus Torvalds# Several make use of the cttz instruction introduced in ev67.
141da177e4SLinus Torvaldsev67-$(CONFIG_ALPHA_EV67) := ev67-
151da177e4SLinus Torvalds
161da177e4SLinus Torvaldslib-y =	__divqu.o __remqu.o __divlu.o __remlu.o \
17*d4d016caSLinus Torvalds	udiv-qrnnd.o \
181da177e4SLinus Torvalds	udelay.o \
191da177e4SLinus Torvalds	$(ev6-y)memset.o \
201da177e4SLinus Torvalds	$(ev6-y)memcpy.o \
211da177e4SLinus Torvalds	memmove.o \
221da177e4SLinus Torvalds	checksum.o \
231da177e4SLinus Torvalds	csum_partial_copy.o \
241da177e4SLinus Torvalds	$(ev67-y)strlen.o \
254758ce82SRichard Henderson	stycpy.o \
264758ce82SRichard Henderson	styncpy.o \
271da177e4SLinus Torvalds	$(ev67-y)strchr.o \
281da177e4SLinus Torvalds	$(ev67-y)strrchr.o \
291da177e4SLinus Torvalds	$(ev6-y)memchr.o \
301da177e4SLinus Torvalds	$(ev6-y)copy_user.o \
311da177e4SLinus Torvalds	$(ev6-y)clear_user.o \
321da177e4SLinus Torvalds	$(ev6-y)csum_ipv6_magic.o \
331da177e4SLinus Torvalds	$(ev6-y)clear_page.o \
341da177e4SLinus Torvalds	$(ev6-y)copy_page.o \
351da177e4SLinus Torvalds	fpreg.o \
3674fd1b68SRichard Henderson	callback_srm.o srm_puts.o srm_printk.o \
3774fd1b68SRichard Henderson	fls.o
381da177e4SLinus Torvalds
391da177e4SLinus Torvalds# The division routines are built from single source, with different defines.
401da177e4SLinus TorvaldsAFLAGS___divqu.o = -DDIV
411da177e4SLinus TorvaldsAFLAGS___remqu.o =       -DREM
421da177e4SLinus TorvaldsAFLAGS___divlu.o = -DDIV       -DINTSIZE
431da177e4SLinus TorvaldsAFLAGS___remlu.o =       -DREM -DINTSIZE
441da177e4SLinus Torvalds
45e19a4e3fSMasahiro Yamada$(addprefix $(obj)/,__divqu.o __remqu.o __divlu.o __remlu.o): \
463eec0291SMasahiro Yamada						$(src)/$(ev6-y)divide.S FORCE
473eec0291SMasahiro Yamada	$(call if_changed_rule,as_o_S)
484758ce82SRichard Henderson
494758ce82SRichard Henderson# There are direct branches between {str*cpy,str*cat} and stx*cpy.
504758ce82SRichard Henderson# Ensure the branches are within range by merging these objects.
514758ce82SRichard Henderson
524758ce82SRichard HendersonLDFLAGS_stycpy.o := -r
534758ce82SRichard HendersonLDFLAGS_styncpy.o := -r
544758ce82SRichard Henderson
554758ce82SRichard Henderson$(obj)/stycpy.o: $(obj)/strcpy.o $(obj)/$(ev67-y)strcat.o \
564758ce82SRichard Henderson		 $(obj)/$(ev6-y)stxcpy.o FORCE
574758ce82SRichard Henderson	$(call if_changed,ld)
584758ce82SRichard Henderson
594758ce82SRichard Henderson$(obj)/styncpy.o: $(obj)/strncpy.o $(obj)/$(ev67-y)strncat.o \
604758ce82SRichard Henderson		 $(obj)/$(ev6-y)stxncpy.o FORCE
614758ce82SRichard Henderson	$(call if_changed,ld)
62