Makefile revision 244531
11592Srgrimes# $FreeBSD: head/sys/boot/ficl/Makefile 244531 2012-12-21 05:22:14Z rpaulo $
21592Srgrimes#
31592Srgrimes
41592SrgrimesFICLDIR?=	${.CURDIR}
51592Srgrimes
61592Srgrimes.if !defined(FICL64)
71592Srgrimes.PATH: ${FICLDIR}/${MACHINE_CPUARCH:S/amd64/i386/}
81592Srgrimes.else
91592Srgrimes.PATH: ${FICLDIR}/${MACHINE_CPUARCH}
101592Srgrimes.endif
111592SrgrimesBASE_SRCS=	dict.c ficl.c fileaccess.c float.c loader.c math64.c \
121592Srgrimes		prefix.c search.c stack.c tools.c vm.c words.c
131592Srgrimes
141592SrgrimesSRCS=		${BASE_SRCS} sysdep.c softcore.c
151592SrgrimesCLEANFILES=	softcore.c testmain testmain.o
161592SrgrimesCFLAGS+=	-ffreestanding
171592Srgrimes.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
181592Srgrimes.if !defined(FICL64)
191592SrgrimesCFLAGS+=	-march=i386
201592SrgrimesCFLAGS+=	-mpreferred-stack-boundary=2
211592Srgrimes.endif
221592SrgrimesCFLAGS+=	-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
231592Srgrimes.endif
241592Srgrimes.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm"
251592SrgrimesCFLAGS+=	-msoft-float
261592Srgrimes.endif
271592Srgrimes.if ${MACHINE} == "pc98"
281592SrgrimesCFLAGS+=	-Os -DPC98
291592Srgrimes.endif
301592Srgrimes.if HAVE_PNP
311592SrgrimesCFLAGS+=	-DHAVE_PNP
321592Srgrimes.endif
331592Srgrimes.ifmake testmain
3417478SmarkmCFLAGS+=	-DTESTMAIN -D_TESTMAIN
351592SrgrimesSRCS+=		testmain.c
361592SrgrimesPROG=		testmain
371592Srgrimes.include <bsd.prog.mk>
381592Srgrimes.else
391592SrgrimesLIB=		ficl
4017478SmarkmINTERNALLIB=
411592Srgrimes.include <bsd.lib.mk>
4231329Scharnier.endif
4317478Smarkm
441592Srgrimes# Standard softwords
4531329Scharnier.PATH: ${FICLDIR}/softwords
4631329ScharnierSOFTWORDS=	softcore.fr jhlocal.fr marker.fr freebsd.fr ficllocal.fr \
4745422Sbrian		ifbrack.fr
481592Srgrimes# Optional OO extension softwords
491592Srgrimes#SOFTWORDS+=	oo.fr classes.fr
501592Srgrimes
511592Srgrimes.if ${MACHINE_CPUARCH} == "amd64" && !defined(FICL64)
521592SrgrimesCFLAGS+=	-m32 -I.
531592Srgrimes.endif
541592Srgrimes
551592Srgrimes.if ${MACHINE_ARCH} == "powerpc64"
561592SrgrimesCFLAGS+=	-m32 -mcpu=powerpc -I.
571592Srgrimes.endif
588240Swollman
591592SrgrimesCFLAGS+=	-I${FICLDIR} -I${FICLDIR}/${MACHINE_CPUARCH:S/amd64/i386/} \
601592Srgrimes		-I${FICLDIR}/../common
611592Srgrimes
621592Srgrimessoftcore.c: ${SOFTWORDS} softcore.awk
638240Swollman	(cd ${FICLDIR}/softwords; cat ${SOFTWORDS} \
641592Srgrimes	    | awk -f softcore.awk -v datestamp="`LC_ALL=C date`") > ${.TARGET}
651592Srgrimes
661592Srgrimes.if ${MACHINE_CPUARCH} == "amd64"
671592Srgrimes.if !exists(machine)
681592Srgrimes${SRCS:M*.c:R:S/$/.o/g}: machine
691592Srgrimes
701592Srgrimesbeforedepend ${OBJS}: machine
711592Srgrimes.endif
721592Srgrimes
731592Srgrimesmachine:
741592Srgrimes	ln -sf ${.CURDIR}/../../i386/include machine
751592Srgrimes
761592SrgrimesCLEANFILES+=	machine
771592Srgrimes.endif
781592Srgrimes