loader: add skein/edonr support
[unleashed.git] / usr / src / boot / sys / boot / zfs / Makefile.com
blob48f1db3986074f0888af025c3447878d7338b7aa
2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
5 # 1.0 of the CDDL.
7 # A full copy of the text of the CDDL should have accompanied this
8 # source.  A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright 2016 Toomas Soome <tsoome@me.com>
14 # Copyright 2016 RackTop Systems.
17 include $(SRC)/Makefile.master
19 LIB=            zfsboot
21 all: libzfsboot.a
23 clean: clobber
25 clobber:
26         $(RM) machine x86 $(OBJS) libzfsboot.a
28 CC=     $(GCC_ROOT)/bin/gcc
29 CPPFLAGS=
31 SRCS +=         ../zfs.c ../gzip.c
32 SRCS +=         $(SRC)/common/crypto/edonr/edonr.c
33 SRCS +=         $(SRC)/common/crypto/skein/skein.c
34 SRCS +=         $(SRC)/common/crypto/skein/skein_iv.c
35 SRCS +=         $(SRC)/common/crypto/skein/skein_block.c
36 OBJS +=         zfs.o gzip.o edonr.o skein.o skein_iv.o skein_block.o
38 CFLAGS= -O2 -D_STANDALONE -nostdinc -I../../../../include -I../../..
39 CFLAGS +=       -I../../common -I../../.. -I.. -I.
40 CFLAGS +=       -I../../../../lib/libstand
41 CFLAGS +=       -I../../../../lib/libz
42 CFLAGS +=       -I../../../cddl/boot/zfs
43 CFLAGS +=       -I$(SRCTOP)/include
45 # Do not unroll skein loops, reduce code size
46 CFLAGS +=       -DSKEIN_LOOP=111
48 CFLAGS +=       -ffreestanding
49 CFLAGS +=       -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
50 CFLAGS +=       -Wformat -Wall -std=gnu99
52 CLEANFILES +=    machine x86
54 machine:
55         $(RM) machine
56         $(SYMLINK) ../../../$(MACHINE)/include machine
58 x86:
59         $(RM) x86
60         $(SYMLINK) ../../../x86/include x86
62 $(OBJS): machine x86
64 libzfsboot.a: $(OBJS)
65         $(AR) $(ARFLAGS) $@ $(OBJS)
67 %.o:    ../%.c
68         $(COMPILE.c) -o $@ $<
70 %.o:    $(SRC)/common/crypto/edonr/%.c
71         $(COMPILE.c) -o $@ $<
73 %.o:    $(SRC)/common/crypto/skein/%.c
74         $(COMPILE.c) -o $@ $<
76 zfs.o: ../zfsimpl.c